feat: 更新主流大模型供应商目录
- 按云服务、Coding Plan、API 网关和本地模型分组 - 新增兼容模型发现与供应商协议校验
This commit is contained in:
1 parent
01e4435f29
commit
d8b124fc7c
15 files changed
+838
-237
No files matched your search
@@ -0,0 +1,39 @@
|
||||
package llm
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestApplyReasoningParamsForModernOpenAIModels(t *testing.T) {
|
||||
payload := openaiRequest{
|
||||
Model: "openai/gpt-5.4",
|
||||
Temperature: 0.7,
|
||||
MaxTokens: 8192,
|
||||
}
|
||||
applyReasoningParams(&payload, true)
|
||||
|
||||
if payload.Temperature != 0 || payload.MaxTokens != 0 {
|
||||
t.Fatalf("unsupported parameters were not cleared: %+v", payload)
|
||||
}
|
||||
if payload.MaxCompletionTokens != 8192 || payload.ReasoningEffort != "medium" {
|
||||
t.Fatalf("modern OpenAI parameters were not applied: %+v", payload)
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyReasoningParamsWithoutReasoningEffort(t *testing.T) {
|
||||
payload := openaiRequest{Model: "gpt-5.4-mini", Temperature: 0.7, MaxTokens: 4096}
|
||||
applyReasoningParams(&payload, false)
|
||||
|
||||
if payload.MaxCompletionTokens != 4096 || payload.ReasoningEffort != "" {
|
||||
t.Fatalf("model compatibility parameters are incorrect: %+v", payload)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAnthropicThinkingModels(t *testing.T) {
|
||||
for _, model := range []string{"claude-3-7-sonnet", "claude-sonnet-4-6", "claude-opus-4-8", "claude-sonnet-5", "claude-fable-5"} {
|
||||
if !isAnthropicThinkingModel(model) {
|
||||
t.Fatalf("%q should support thinking parameters", model)
|
||||
}
|
||||
}
|
||||
if isAnthropicThinkingModel("claude-haiku-4-5") {
|
||||
t.Fatal("Claude Haiku should not receive thinking parameters")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user