mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-11 19:03:43 +08:00
feat: update GeneralOpenAIRequest
This commit is contained in:
@@ -22,16 +22,25 @@ type StreamOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GeneralOpenAIRequest struct {
|
type GeneralOpenAIRequest struct {
|
||||||
|
// https://platform.openai.com/docs/api-reference/chat/create
|
||||||
Messages []Message `json:"messages,omitempty"`
|
Messages []Message `json:"messages,omitempty"`
|
||||||
Model string `json:"model,omitempty"`
|
Model string `json:"model,omitempty"`
|
||||||
Modalities []string `json:"modalities,omitempty"`
|
Store *bool `json:"store,omitempty"`
|
||||||
Audio *Audio `json:"audio,omitempty"`
|
Metadata any `json:"metadata,omitempty"`
|
||||||
FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"`
|
FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"`
|
||||||
|
LogitBias any `json:"logit_bias,omitempty"`
|
||||||
|
Logprobs *bool `json:"logprobs,omitempty"`
|
||||||
|
TopLogprobs *int `json:"top_logprobs,omitempty"`
|
||||||
MaxTokens int `json:"max_tokens,omitempty"`
|
MaxTokens int `json:"max_tokens,omitempty"`
|
||||||
|
MaxCompletionTokens *int `json:"max_completion_tokens,omitempty"`
|
||||||
N int `json:"n,omitempty"`
|
N int `json:"n,omitempty"`
|
||||||
|
Modalities []string `json:"modalities,omitempty"`
|
||||||
|
Prediction any `json:"prediction,omitempty"`
|
||||||
|
Audio *Audio `json:"audio,omitempty"`
|
||||||
PresencePenalty *float64 `json:"presence_penalty,omitempty"`
|
PresencePenalty *float64 `json:"presence_penalty,omitempty"`
|
||||||
ResponseFormat *ResponseFormat `json:"response_format,omitempty"`
|
ResponseFormat *ResponseFormat `json:"response_format,omitempty"`
|
||||||
Seed float64 `json:"seed,omitempty"`
|
Seed float64 `json:"seed,omitempty"`
|
||||||
|
ServiceTier *string `json:"service_tier,omitempty"`
|
||||||
Stop any `json:"stop,omitempty"`
|
Stop any `json:"stop,omitempty"`
|
||||||
Stream bool `json:"stream,omitempty"`
|
Stream bool `json:"stream,omitempty"`
|
||||||
StreamOptions *StreamOptions `json:"stream_options,omitempty"`
|
StreamOptions *StreamOptions `json:"stream_options,omitempty"`
|
||||||
@@ -40,15 +49,21 @@ type GeneralOpenAIRequest struct {
|
|||||||
TopK int `json:"top_k,omitempty"`
|
TopK int `json:"top_k,omitempty"`
|
||||||
Tools []Tool `json:"tools,omitempty"`
|
Tools []Tool `json:"tools,omitempty"`
|
||||||
ToolChoice any `json:"tool_choice,omitempty"`
|
ToolChoice any `json:"tool_choice,omitempty"`
|
||||||
|
ParallelTooCalls *bool `json:"parallel_tool_calls,omitempty"`
|
||||||
|
User string `json:"user,omitempty"`
|
||||||
FunctionCall any `json:"function_call,omitempty"`
|
FunctionCall any `json:"function_call,omitempty"`
|
||||||
Functions any `json:"functions,omitempty"`
|
Functions any `json:"functions,omitempty"`
|
||||||
User string `json:"user,omitempty"`
|
// https://platform.openai.com/docs/api-reference/embeddings/create
|
||||||
Prompt any `json:"prompt,omitempty"`
|
|
||||||
Input any `json:"input,omitempty"`
|
Input any `json:"input,omitempty"`
|
||||||
EncodingFormat string `json:"encoding_format,omitempty"`
|
EncodingFormat string `json:"encoding_format,omitempty"`
|
||||||
Dimensions int `json:"dimensions,omitempty"`
|
Dimensions int `json:"dimensions,omitempty"`
|
||||||
Instruction string `json:"instruction,omitempty"`
|
// https://platform.openai.com/docs/api-reference/images/create
|
||||||
|
Prompt any `json:"prompt,omitempty"`
|
||||||
|
Quality *string `json:"quality,omitempty"`
|
||||||
Size string `json:"size,omitempty"`
|
Size string `json:"size,omitempty"`
|
||||||
|
Style *string `json:"style,omitempty"`
|
||||||
|
// Others
|
||||||
|
Instruction string `json:"instruction,omitempty"`
|
||||||
NumCtx int `json:"num_ctx,omitempty"`
|
NumCtx int `json:"num_ctx,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user