sashabaranov / go-openai

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

Completion API: add new params #870

Closed isaacseymour closed 1 month ago

isaacseymour commented 1 month ago

Describe the change

Provide OpenAI documentation link https://platform.openai.com/docs/api-reference/chat/create#chat-create-store https://platform.openai.com/docs/api-reference/chat/object#chat/object-usage

Describe your solution Currently it's not possible to opt a completion request in to being stored using go-openai, blocking usage of distillations and evals.

It's also not possible to track usage of audio tokens, nor prompt caching.

Tests These are optional new params, so I've not added specific test cases.

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 99.04%. Comparing base (774fc9d) to head (c85f781). Report is 60 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #870 +/- ## ========================================== + Coverage 98.46% 99.04% +0.58% ========================================== Files 24 26 +2 Lines 1364 1461 +97 ========================================== + Hits 1343 1447 +104 + Misses 15 8 -7 Partials 6 6 ```

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