Add logprob support
This commit is contained in:
@@ -17,19 +17,27 @@ type CompletionRequest struct {
|
|||||||
|
|
||||||
N int `json:"n,omitempty"`
|
N int `json:"n,omitempty"`
|
||||||
|
|
||||||
LogProbs int `json:"logobs,omitempty"`
|
LogProbs int `json:"logprobs,omitempty"`
|
||||||
|
|
||||||
Echo bool `json:"echo,omitempty"`
|
Echo bool `json:"echo,omitempty"`
|
||||||
Stop string `json:"stop,omitempty"`
|
Stop []string `json:"stop,omitempty"`
|
||||||
|
|
||||||
PresencePenalty float32 `json:"presence_penalty,omitempty"`
|
PresencePenalty float32 `json:"presence_penalty,omitempty"`
|
||||||
FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`
|
FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Choice struct {
|
type Choice struct {
|
||||||
Text string `json:"text"`
|
Text string `json:"text"`
|
||||||
Index int `json:"index"`
|
Index int `json:"index"`
|
||||||
FinishReason string `json:"finish_reason"`
|
FinishReason string `json:"finish_reason"`
|
||||||
|
LogProbs LogprobResult `json:"logprobs"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type LogprobResult struct {
|
||||||
|
Tokens []string `json:"tokens"`
|
||||||
|
TokenLogprobs []float32 `json:"token_logprobs"`
|
||||||
|
TopLogprobs []map[string]float32 `json:"top_logprobs"`
|
||||||
|
TextOffset []int `json:"text_offset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CompletionResponse struct {
|
type CompletionResponse struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user