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

14
chat.go
View File

@@ -19,8 +19,18 @@ type ChatCompletionMessage struct {
// ChatCompletionRequest represents a request structure for chat completion API. // ChatCompletionRequest represents a request structure for chat completion API.
type ChatCompletionRequest struct { type ChatCompletionRequest struct {
Model string `json:"model"` Model string `json:"model"`
Messages []ChatCompletionMessage `json:"messages"` 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 { type ChatCompletionChoice struct {