docs: explanation about LogitBias. (129) (#426)

This commit is contained in:
渡邉祐一 / Yuichi Watanabe
2023-07-09 18:11:39 +09:00
committed by GitHub
parent 7b22898f5d
commit 181fc2ade9
2 changed files with 26 additions and 20 deletions

11
chat.go
View File

@@ -52,10 +52,13 @@ type ChatCompletionRequest struct {
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"`
Functions []FunctionDefinition `json:"functions,omitempty"`
FunctionCall any `json:"function_call,omitempty"`
// LogitBias is must be a token id string (specified by their token ID in the tokenizer), not a word string.
// incorrect: `"logit_bias":{"You": 6}`, correct: `"logit_bias":{"1639": 6}`
// refs: https://platform.openai.com/docs/api-reference/chat/create#chat/create-logit_bias
LogitBias map[string]int `json:"logit_bias,omitempty"`
User string `json:"user,omitempty"`
Functions []FunctionDefinition `json:"functions,omitempty"`
FunctionCall any `json:"function_call,omitempty"`
}
type FunctionDefinition struct {