feat: add reasoning effort configuration for models
- Support setting reasoning effort via model name suffix - Add `-high`, `-medium`, and `-low` suffixes to control reasoning effort - Update README with new model configuration option - Modify OpenAI adaptor to handle reasoning effort settings
This commit is contained in:
@@ -117,6 +117,13 @@ func (a *Adaptor) ConvertRequest(c *gin.Context, info *relaycommon.RelayInfo, re
|
||||
if strings.HasPrefix(request.Model, "o3") {
|
||||
request.Temperature = nil
|
||||
}
|
||||
if strings.HasSuffix(request.Model, "high") {
|
||||
request.ReasoningEffort = "high"
|
||||
} else if strings.HasSuffix(request.Model, "low") {
|
||||
request.ReasoningEffort = "low"
|
||||
} else if strings.HasSuffix(request.Model, "medium") {
|
||||
request.ReasoningEffort = "medium"
|
||||
}
|
||||
}
|
||||
if request.Model == "o1" || request.Model == "o1-2024-12-17" || strings.HasPrefix(request.Model, "o3") {
|
||||
//修改第一个Message的内容,将system改为developer
|
||||
|
||||
@@ -14,6 +14,9 @@ var ModelList = []string{
|
||||
"o1-preview", "o1-preview-2024-09-12",
|
||||
"o1-mini", "o1-mini-2024-09-12",
|
||||
"o3-mini", "o3-mini-2025-01-31",
|
||||
"o3-mini-high", "o3-mini-2025-01-31-high",
|
||||
"o3-mini-low", "o3-mini-2025-01-31-low",
|
||||
"o3-mini-medium", "o3-mini-2025-01-31-medium",
|
||||
"o1", "o1-2024-12-17",
|
||||
"gpt-4o-audio-preview", "gpt-4o-audio-preview-2024-10-01",
|
||||
"gpt-4o-realtime-preview", "gpt-4o-realtime-preview-2024-10-01", "gpt-4o-realtime-preview-2024-12-17",
|
||||
|
||||
Reference in New Issue
Block a user