chore: update project files

This commit is contained in:
CJACK
2026-04-27 02:09:11 +08:00
parent 40d5e3ebb5
commit 90ce595325
27 changed files with 511 additions and 150 deletions

View File

@@ -116,6 +116,18 @@ func TestConvertClaudeToDeepSeekUsesGlobalAliasResolution(t *testing.T) {
}
}
func TestConvertClaudeToDeepSeekUsesNoThinkingAliasResolution(t *testing.T) {
store := config.LoadStore()
req := map[string]any{
"model": "claude-sonnet-4-6-nothinking",
"messages": []any{map[string]any{"role": "user", "content": "Hi"}},
}
out := ConvertClaudeToDeepSeek(req, store)
if out["model"] != "deepseek-v4-flash-nothinking" {
t.Fatalf("expected noThinking alias resolution, got model=%q", out["model"])
}
}
func contains(s, sub string) bool {
return len(s) >= len(sub) && (s == sub || len(sub) == 0 || (len(s) > 0 && (indexOf(s, sub) >= 0)))
}

View File

@@ -372,3 +372,16 @@ func TestConvertClaudeToDeepSeekUsesExplicitModelAlias(t *testing.T) {
t.Fatalf("expected explicit alias override, got %q", out["model"])
}
}
func TestConvertClaudeToDeepSeekUsesExplicitNoThinkingModelAlias(t *testing.T) {
t.Setenv("DS2API_CONFIG_JSON", `{"keys":[],"accounts":[],"model_aliases":{"claude-sonnet-4-6":"deepseek-v4-pro-search"}}`)
store := config.LoadStore()
req := map[string]any{
"model": "claude-sonnet-4-6-nothinking",
"messages": []any{map[string]any{"role": "user", "content": "Hi"}},
}
out := ConvertClaudeToDeepSeek(req, store)
if out["model"] != "deepseek-v4-pro-search-nothinking" {
t.Fatalf("expected explicit alias override with nothinking suffix, got %q", out["model"])
}
}