@@ -140,22 +140,23 @@ func checkPromptType(prompt any) bool {
|
|||||||
type CompletionRequest struct {
|
type CompletionRequest struct {
|
||||||
Model string `json:"model"`
|
Model string `json:"model"`
|
||||||
Prompt any `json:"prompt,omitempty"`
|
Prompt any `json:"prompt,omitempty"`
|
||||||
Suffix string `json:"suffix,omitempty"`
|
|
||||||
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"`
|
|
||||||
LogProbs int `json:"logprobs,omitempty"`
|
|
||||||
Echo bool `json:"echo,omitempty"`
|
|
||||||
Stop []string `json:"stop,omitempty"`
|
|
||||||
PresencePenalty float32 `json:"presence_penalty,omitempty"`
|
|
||||||
FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`
|
|
||||||
BestOf int `json:"best_of,omitempty"`
|
BestOf int `json:"best_of,omitempty"`
|
||||||
|
Echo bool `json:"echo,omitempty"`
|
||||||
|
FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`
|
||||||
// LogitBias is must be a token id string (specified by their token ID in the tokenizer), not a word string.
|
// 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}`
|
// incorrect: `"logit_bias":{"You": 6}`, correct: `"logit_bias":{"1639": 6}`
|
||||||
// refs: https://platform.openai.com/docs/api-reference/completions/create#completions/create-logit_bias
|
// refs: https://platform.openai.com/docs/api-reference/completions/create#completions/create-logit_bias
|
||||||
LogitBias map[string]int `json:"logit_bias,omitempty"`
|
LogitBias map[string]int `json:"logit_bias,omitempty"`
|
||||||
|
LogProbs int `json:"logprobs,omitempty"`
|
||||||
|
MaxTokens int `json:"max_tokens,omitempty"`
|
||||||
|
N int `json:"n,omitempty"`
|
||||||
|
PresencePenalty float32 `json:"presence_penalty,omitempty"`
|
||||||
|
Seed *int `json:"seed,omitempty"`
|
||||||
|
Stop []string `json:"stop,omitempty"`
|
||||||
|
Stream bool `json:"stream,omitempty"`
|
||||||
|
Suffix string `json:"suffix,omitempty"`
|
||||||
|
Temperature float32 `json:"temperature,omitempty"`
|
||||||
|
TopP float32 `json:"top_p,omitempty"`
|
||||||
User string `json:"user,omitempty"`
|
User string `json:"user,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user