Skip to content

Allow passing in a "raw" JSON Schema rather than a pydantic model #108

Description

@dmwyatt

Using an instance of a pydantic model isn't always feasible because of some limitations.

For example, I want to dynamically change the enum values of a field. A Literal type can't have its values sourced dynamically. When not using simpleaichat I create my pydantic model, generate a json schema from it, update the schema with my enum values, and then pass that on to openai.

One solution would be to allow output_schema to take in a dict OR a pydantic model and branch accordingly. Another would be to have a separate kwarg for pydantic models and regular json schemas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions