mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 04:37:31 +08:00
feat(ai-proxy): add OpenRouter provider support (#2823)
This commit is contained in:
@@ -29,7 +29,12 @@ const (
|
||||
reasoningEndTag = "</think>"
|
||||
)
|
||||
|
||||
type NonOpenAIStyleOptions struct {
|
||||
ReasoningMaxTokens int `json:"reasoning_max_tokens,omitempty"`
|
||||
}
|
||||
|
||||
type chatCompletionRequest struct {
|
||||
NonOpenAIStyleOptions
|
||||
Messages []chatMessage `json:"messages"`
|
||||
Model string `json:"model"`
|
||||
Store bool `json:"store,omitempty"`
|
||||
@@ -169,7 +174,9 @@ type chatMessage struct {
|
||||
Role string `json:"role,omitempty"`
|
||||
Content any `json:"content,omitempty"`
|
||||
ReasoningContent string `json:"reasoning_content,omitempty"`
|
||||
Reasoning string `json:"reasoning,omitempty"` // For streaming responses
|
||||
ToolCalls []toolCall `json:"tool_calls,omitempty"`
|
||||
FunctionCall *functionCall `json:"function_call,omitempty"` // For legacy OpenAI format
|
||||
Refusal string `json:"refusal,omitempty"`
|
||||
ToolCallId string `json:"tool_call_id,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user