docs: explanation about LogitBias. (129) (#426)
This commit is contained in:
committed by
GitHub
parent
7b22898f5d
commit
181fc2ade9
11
chat.go
11
chat.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user