Add the rest of the Chat Completion fields (#92)

Per https://platform.openai.com/docs/api-reference/chat/create
This commit is contained in:
Parham Negahdar
2023-03-02 01:06:24 -05:00
committed by GitHub
parent b0b26afd50
commit de9a632138

10
chat.go
View File

@@ -21,6 +21,16 @@ type ChatCompletionMessage struct {
type ChatCompletionRequest struct {
Model string `json:"model"`
Messages []ChatCompletionMessage `json:"messages"`
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float32 `json:"temperature,omitempty"`
TopP float32 `json:"top_p,omitempty"`
N int `json:"n,omitempty"`
Stream bool `json:"stream,omitempty"`
Stop []string `json:"stop,omitempty"`
PresencePenalty float32 `json:"presence_penalty,omitempty"`
FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`
LogitBias map[string]int `json:"logit_bias,omitempty"`
User string `json:"user,omitempty"`
}
type ChatCompletionChoice struct {