-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat Support chat completion response format and seed new fields #525
Feat Support chat completion response format and seed new fields #525
Conversation
Codecov Report
@@ Coverage Diff @@
## master #525 +/- ##
=======================================
Coverage 97.59% 97.59%
=======================================
Files 19 19
Lines 872 872
=======================================
Hits 851 851
Misses 15 15
Partials 6 6
|
IMO lint should be a separate PR but this LGTM -- consider also adding https://platform.openai.com/docs/api-reference/chat/create#chat-create-seed |
chat.go
Outdated
Stream bool `json:"stream,omitempty"` | ||
Stop []string `json:"stop,omitempty"` | ||
PresencePenalty float32 `json:"presence_penalty,omitempty"` | ||
ResponseFormat *ChatCompletionResponseFormat `json:"response_format,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's address seed
:
ResponseFormat *ChatCompletionResponseFormat `json:"response_format,omitempty"` | |
ResponseFormat *ChatCompletionResponseFormat `json:"response_format,omitempty"` | |
Seed *int `json:"seed,omitempty"` |
I agree @stillmatic |
@henomis thank you for the PR! Could you please rebase on the latest master version so we could have clean CI runs here? (works for other PRs too!) |
…-completion-response-format
chat.go
Outdated
Stream bool `json:"stream,omitempty"` | ||
Stop []string `json:"stop,omitempty"` | ||
PresencePenalty float32 `json:"presence_penalty,omitempty"` | ||
ResponseFormat *ChatCompletionResponseFormat `json:"response_format,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May not the best choice to set the type as a pointer. Should we use the value type as the other field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Stream bool `json:"stream,omitempty"` | ||
Stop []string `json:"stop,omitempty"` | ||
PresencePenalty float32 `json:"presence_penalty,omitempty"` | ||
ResponseFormat ChatCompletionResponseFormat `json:"response_format,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is optional. So it should have been a pointer: *ChatCompletionResponseFormat
. Now I get:
status code: 400, message: '' is not one of ['json_object', 'text'] - 'response_format.type'
Describe the change
This branch implements the support for chat completion response format optional field
Describe your solution
A new type has been added to support this new field.