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
Is your feature request related to a problem? Please describe.
Structured Outputs have been implemented thanks to @andgordio. With Structured Outputs they've added additional field for when model is unable to generate response in a specified format: refusal, see Refusals in Structured Outputs Guide. For more info.
The field appears in both streamable and regular chat completion objects:
Chat Completion Object - choices.message.refusal API reference
Chat Completion Chunk Object - choices.delta.refusal API Reference
Describe the solution you'd like
Simply add the field to our structures that represent choices.message and choices.delta. It might require refactoring though. Currently we use ChatCompletionMessageParam to both create chat completion and parse Chat Completion Object in a response. But looking at the API reference, it seems that request body and response format are different and so different Swift structured may be used for clearer distinction. Also, the separation into different types makes sense for a request, but not so much for response: API Reference does not specify such distinction, and I don't think we should either.
Describe alternatives you've considered
An alternative would be to continue using ChatCompletionMessageParam to decode Chat Completion Object, it may be faster to implement this way.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Structured Outputs have been implemented thanks to @andgordio. With Structured Outputs they've added additional field for when model is unable to generate response in a specified format:
refusal
, see Refusals in Structured Outputs Guide. For more info.The field appears in both streamable and regular chat completion objects:
Describe the solution you'd like
Simply add the field to our structures that represent
choices.message
andchoices.delta
. It might require refactoring though. Currently we useChatCompletionMessageParam
to both create chat completion and parse Chat Completion Object in a response. But looking at the API reference, it seems that request body and response format are different and so different Swift structured may be used for clearer distinction. Also, the separation into different types makes sense for a request, but not so much for response: API Reference does not specify such distinction, and I don't think we should either.Describe alternatives you've considered
An alternative would be to continue using
ChatCompletionMessageParam
to decode Chat Completion Object, it may be faster to implement this way.Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: