Add the rest of the Chat Completion fields (#92)
Per https://platform.openai.com/docs/api-reference/chat/create
This commit is contained in:
14
chat.go
14
chat.go
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user