mirror of
				https://github.com/songquanpeng/one-api.git
				synced 2025-11-04 15:53:42 +08:00 
			
		
		
		
	feat: support openai format enable deepseek v3.1 thinking
This commit is contained in:
		@@ -36,6 +36,12 @@ func ConvertRequest(request model.GeneralOpenAIRequest) *ChatRequest {
 | 
			
		||||
		enableSearch = true
 | 
			
		||||
		aliModel = strings.TrimSuffix(aliModel, EnableSearchModelSuffix)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	enableThinking := false
 | 
			
		||||
	if request.ReasoningEffort != nil {
 | 
			
		||||
		enableThinking = true
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	request.TopP = helper.Float64PtrMax(request.TopP, 0.9999)
 | 
			
		||||
	return &ChatRequest{
 | 
			
		||||
		Model: aliModel,
 | 
			
		||||
@@ -52,6 +58,7 @@ func ConvertRequest(request model.GeneralOpenAIRequest) *ChatRequest {
 | 
			
		||||
			TopK:              request.TopK,
 | 
			
		||||
			ResultFormat:      "message",
 | 
			
		||||
			Tools:             request.Tools,
 | 
			
		||||
			EnableThinking:    enableThinking,
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,7 @@ type Parameters struct {
 | 
			
		||||
	Temperature       *float64     `json:"temperature,omitempty"`
 | 
			
		||||
	ResultFormat      string       `json:"result_format,omitempty"`
 | 
			
		||||
	Tools             []model.Tool `json:"tools,omitempty"`
 | 
			
		||||
	EnableThinking    bool         `json:"enable_thinking,omitempty"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type ChatRequest struct {
 | 
			
		||||
 
 | 
			
		||||
@@ -17,4 +17,5 @@ var ModelList = []string{
 | 
			
		||||
 | 
			
		||||
	"deepseek-r1",
 | 
			
		||||
	"deepseek-v3",
 | 
			
		||||
	"deepseek-v3.1",
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user