Skip to content

Are JSON Schema tools actually supported, or only Zod? #7470

Closed Answered by dwabyick
dwabyick asked this question in Q&A
Discussion options

You must be logged in to vote

This seems to be incorrect. Passing in schema to DynamicStructuredTool will get overridden as isZodSchema will return false in the constructor.

constructor(fields: DynamicStructuredToolInput<T>) {
    super(fields);
    this.name = fields.name;
    this.description = fields.description;
    this.func = fields.func;
    this.returnDirect = fields.returnDirect ?? this.returnDirect;
    this.schema = (
      isZodSchema(fields.schema) ? fields.schema : z.object({}).passthrough()
    ) as T extends ZodObjectAny ? T : ZodObjectAny;
  }

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@dwabyick
Comment options

@dosubot
Comment options

@dwabyick
Comment options

Answer selected by dwabyick
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant