Open robbie-daniels opened 1 month ago
Hi @robbie-daniels and thank you for the issue! Compatibility with the OpenAI API for JSON generation is definitely a planned feature, but admittedly our support for remote API models lags our support for locally hosted models at the present moment.
If you can't run a local model, we do currently support constrained decoding with Azure-hosted Phi 3.5 using the AzureGuidance
model class in our latest (pre) release.
Hope to provide some updates in the near future!
Is your feature request related to a problem? Please describe. I would like to use OpenAI models to generate
pydantic
objects.I tried replicating this example from OpenAI's documentation:
and get this error:
It doesn't look like it's trying to generate a json. I believe the model I used supports structured outputs. Is
json
just unsupported with OpenAI models for now?Describe the solution you'd like The prompt returns:
CalendarEvent(name='Science Fair', date='Friday', participants=['Alice', 'Bob'])
Describe alternatives you've considered I tried a simpler example, adding clearer instructions to
user
:but I get similar errors.
If my examples are incorrect, has anybody else tried this and gotten it working?