We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1dd29b commit 5a9cb4bCopy full SHA for 5a9cb4b
src/helpers/beta/zod.ts
@@ -17,10 +17,6 @@ export function betaZodFunctionTool<InputSchema extends ZodType>(options: {
17
}): BetaRunnableTool<zodInfer<InputSchema>> {
18
const jsonSchema = z.toJSONSchema(options.parameters, { reused: 'ref' });
19
20
- if (jsonSchema.type !== 'object') {
21
- throw new Error(`Zod schema for tool "${options.name}" must be an object, but got ${jsonSchema.type}`);
22
- }
23
-
24
// TypeScript doesn't narrow the type after the runtime check, so we need to assert it
25
const objectSchema = jsonSchema as typeof jsonSchema & { type: 'object' };
26
0 commit comments