sashabaranov / go-openai

OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go
Apache License 2.0
9.03k stars 1.39k forks source link

feat: Support Structured Outputs #813

Closed eiixy closed 1 month ago

eiixy commented 1 month ago

Support Structured Outputs https://platform.openai.com/docs/guides/structured-outputs/introduction

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.88%. Comparing base (774fc9d) to head (68ee228). Report is 35 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #813 +/- ## ========================================== + Coverage 98.46% 98.88% +0.42% ========================================== Files 24 26 +2 Lines 1364 1347 -17 ========================================== - Hits 1343 1332 -11 + Misses 15 9 -6 Partials 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sashabaranov commented 1 month ago

Thank you for the PR!

Could we please add some tests here? Both integration and unit tests. I believe we also need to update the ChatCompletionResponse to make this work

h0rv commented 1 month ago

Would love to add this to https://github.com/instructor-ai/instructor-go to streamline parsing the responses into Go structs.

eiixy commented 1 month ago

Thank you for the PR!

Could we please add some tests here? Both integration and unit tests. I believe we also need to update the ChatCompletionResponse to make this work

Thanks for the feedback! I've added the requested unit tests. Please review and let me know if anything else is needed.