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.
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
Literaltype can't have its values sourced dynamically. When not usingsimpleaichatI 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_schemato 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.