feat: support OpenRouter reasoning

This commit is contained in:
Laisky.Cai
2025-02-19 01:11:46 +00:00
parent 2a5908586d
commit a5f5e85c44
7 changed files with 80 additions and 18 deletions

View File

@@ -1,5 +1,7 @@
package model
import "github.com/songquanpeng/one-api/relay/adaptor/openrouter"
type ResponseFormat struct {
Type string `json:"type,omitempty"`
JsonSchema *JSONSchema `json:"json_schema,omitempty"`
@@ -68,6 +70,9 @@ type GeneralOpenAIRequest struct {
// Others
Instruction string `json:"instruction,omitempty"`
NumCtx int `json:"num_ctx,omitempty"`
// Openrouter
Provider *openrouter.RequestProvider `json:"provider,omitempty"`
IncludeReasoning *bool `json:"include_reasoning,omitempty"`
}
func (r GeneralOpenAIRequest) ParseInput() []string {