You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a fairly complex zod schema, for better or worse, and am noticing that instructor converts it to schemas with nonexistent definitions, causing it to fail json schema meta validation
where are the zod types converted to json schemas? happy to fix this just don't know where to look :)
here's a toy example of the issue
import { z } from "zod";
const Type = z.enum(["A", "B", "C"]);
const BaseItem = z.object({
foo: z.string(),
type: Type,
});
const Schema = z.object({
a: z.array(BaseItem),
b: z.array(BaseItem)
});
Notably, it's generating a reference to a definition within a top level Root which doesn't exist. this then causes the tool calling to fail with
tools.0.input_schema: JSON schema is invalid - please consult https://json-schema.org or our documentation at https://docs.anthropic.com/en/docs/tool-use
The text was updated successfully, but these errors were encountered:
But in general though, it would be nice if I could control the generation of the json schema when calling instructorjs. eg although this library doesn't support google's gemini vector ai api, that api does have tool calling support with a limited subset of json schema. and in this case, i believe the issue is due to a change in anthropic's api..
I have a fairly complex zod schema, for better or worse, and am noticing that instructor converts it to schemas with nonexistent definitions, causing it to fail json schema meta validation
where are the zod types converted to json schemas? happy to fix this just don't know where to look :)
here's a toy example of the issue
Generated JSON Schema
Notably, it's generating a reference to a definition within a top level
Root
which doesn't exist. this then causes the tool calling to fail withThe text was updated successfully, but these errors were encountered: