File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 "test:watch" : " npm run test:watch --workspaces" ,
2121 "test:coverage" : " npm run test:coverage --workspaces" ,
2222 "clean" : " npm run clean --workspaces" ,
23- "verify" : " npm run type-check && npm run lint && npm run build && npm run test"
23+ "verify" : " npm run build && npm run type-check && npm run lint && npm run test"
2424 },
2525 "keywords" : [
2626 " agent" ,
Original file line number Diff line number Diff line change 4141 "dependencies" : {
4242 "@agentage/core" : " ^0.1.0" ,
4343 "openai" : " ^6.15.0" ,
44- "zod" : " 4.2.1" ,
45- "zod-to-json-schema" : " 3.24.6"
44+ "zod" : " 4.2.1"
4645 },
4746 "devDependencies" : {
4847 "@types/jest" : " ^30.0.0" ,
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import type {
77} from '@agentage/core' ;
88import OpenAI from 'openai' ;
99import type { ChatCompletionMessageParam } from 'openai/resources/chat/completions' ;
10- import { zodToJsonSchema } from 'zod-to-json-schema' ;
1110import {
1211 MissingApiKeyError ,
1312 NotImplementedError ,
@@ -43,12 +42,10 @@ function convertSchemaToJsonSchema(schema: any): any {
4342 const required : string [ ] = [ ] ;
4443
4544 for ( const [ key , value ] of Object . entries ( schema ) ) {
46- // Check if it's a Zod schema
47- if ( value && typeof value === 'object' && '_def ' in value ) {
45+ // Check if it's a Zod schema (has toJSONSchema method from Zod 4.x)
46+ if ( value && typeof value === 'object' && 'toJSONSchema ' in value ) {
4847 // eslint-disable-next-line @typescript-eslint/no-explicit-any
49- const jsonSchema = zodToJsonSchema ( value as any , {
50- $refStrategy : 'none' ,
51- } ) ;
48+ const jsonSchema = ( value as any ) . toJSONSchema ( ) ;
5249
5350 // Extract the actual schema (remove top-level $schema if present)
5451 // eslint-disable-next-line @typescript-eslint/no-unused-vars
You can’t perform that action at this time.
0 commit comments