MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / threadGoalSetParams

Function threadGoalSetParams

projects/runtime-node/src/agents.ts:323–334  ·  view source on GitHub ↗
(params: unknown, patch: Partial<AgentGoalSetParams> = {})

Source from the content-addressed store, hash-verified

321}
322
323function 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
336function requiredString(params: unknown, key: string): string {
337 const value = asRecord(params)[key]

Callers 1

Calls 5

normalizeTokenBudgetFunction · 0.85
providerIdFunction · 0.85
requireThreadGoalIdFunction · 0.85
normalizeGoalStatusFunction · 0.85
asRecordFunction · 0.70

Tested by

no test coverage detected