(params: unknown, patch: Partial<AgentGoalSetParams> = {})
| 321 | } |
| 322 | |
| 323 | function threadGoalSetParams(params: unknown, patch: Partial<AgentGoalSetParams> = {}): AgentGoalSetParams { |
| 324 | const record = asRecord(params) |
| 325 | const tokenBudget = "tokenBudget" in record ? normalizeTokenBudget(record.tokenBudget) : undefined |
| 326 | return { |
| 327 | providerId: providerId(params), |
| 328 | threadId: requireThreadGoalId(params), |
| 329 | objective: typeof record.objective === "string" ? record.objective : undefined, |
| 330 | status: normalizeGoalStatus(record.status), |
| 331 | ...(tokenBudget !== undefined ? { tokenBudget } : {}), |
| 332 | ...patch, |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | function requiredString(params: unknown, key: string): string { |
| 337 | const value = asRecord(params)[key] |
no test coverage detected