softwaremill / sttp-openai

Apache License 2.0
41 stars 9 forks source link

Add support for Structured Outputs #190 #205

Closed pstutz closed 2 days ago

pstutz commented 3 weeks ago

I haven't tested the changes with the actual OpenAI API yet.

Structured Outputs have two aspects: generating parameters for function calling and formatting responses. In both cases, the new Structured Outputs option can be enabled by setting strict=true. By default, it is set to false.

Infos

Issue: #190 OpenAI Announcement: https://openai.com/index/introducing-structured-outputs-in-the-api OpenAI Docs: https://platform.openai.com/docs/guides/structured-outputs/introduction OpenAI API Reference: https://platform.openai.com/docs/api-reference/chat/create

adamw commented 3 weeks ago

Thanks! Would there be a chance for you to test the changes with OpenAI? :)

pstutz commented 3 weeks ago

@adamw Thanks for the feedback. Yes, I'm looking forward to testing the feature, will post updates.