diff --git a/legacy/src/agentic.ts b/legacy/src/agentic.ts index cf638054..45e2baa4 100644 --- a/legacy/src/agentic.ts +++ b/legacy/src/agentic.ts @@ -41,7 +41,7 @@ export class Agentic { modelParams: {}, timeoutMs: 2 * 60000, retryConfig: { - attempts: 3, + retries: 3, strategy: 'heal', ...opts.openaiModelDefaults?.retryConfig }, diff --git a/legacy/src/llms/llm.ts b/legacy/src/llms/llm.ts index 663c9a6b..8d586cec 100644 --- a/legacy/src/llms/llm.ts +++ b/legacy/src/llms/llm.ts @@ -318,6 +318,7 @@ export abstract class BaseChatModel< } const safeResult = outputSchema.safeParse(output) + if (!safeResult.success) { throw new errors.ZodOutputValidationError(safeResult.error) } diff --git a/legacy/src/task.ts b/legacy/src/task.ts index efea6cad..1e972186 100644 --- a/legacy/src/task.ts +++ b/legacy/src/task.ts @@ -72,6 +72,7 @@ export abstract class BaseTask< : z.object(this.inputSchema) const safeInput = inputSchema.safeParse(input) + if (!safeInput.success) { throw new Error(`Invalid input: ${safeInput.error.message}`) }