Skip to content

feeding instructor a json schema instead of zod schema #188

@rgarcia

Description

@rgarcia

I'm trying to use LLMs to generate OpenAPI schemas, and running into some roadblocks trying to use instructor. It mainly boils down to the fact that zod + typescript types don't really work well when schemas are recursive (OpenAPI specs have lots of recursion). It also seems weird that I'm doing all this work to convert the OpenAPI schema to zod when they publish a JSON schema.

How would you go about doing this? I've peaked at how instructor-js works and I'm tempted to use some of the primitives in zod-stream there and kind of roll-my-own thing similar to instructor but based on json schema instead of zod. I'm hoping you have better ideas :)

Thanks for building instructor!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions