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
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.
The text was updated successfully, but these errors were encountered:
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 usingsimpleaichat
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.The text was updated successfully, but these errors were encountered: