mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-05 23:50:29 +08:00
- Add `is-compat` support to OpenAI compatibility model config, capabilities, hashing, and example config. - Propagate `IsCompat` through API-key model resolution and switch OpenAI-compat executor translation to compatibility-aware routing. - Keep Claude assistant thinking content in compatibility mode while keeping default behavior unchanged when `is-compat` is disabled. Closes: #4776
20 lines
845 B
Go
20 lines
845 B
Go
package diff
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
|
|
)
|
|
|
|
func TestModelHashesIncludeIsCompat(t *testing.T) {
|
|
if ComputeClaudeModelsHash([]config.ClaudeModel{{Name: "m"}}) == ComputeClaudeModelsHash([]config.ClaudeModel{{Name: "m", IsCompat: true}}) {
|
|
t.Fatal("Claude model hash did not change when IsCompat changed")
|
|
}
|
|
if ComputeGeminiModelsHash([]config.GeminiModel{{Name: "m"}}) == ComputeGeminiModelsHash([]config.GeminiModel{{Name: "m", IsCompat: true}}) {
|
|
t.Fatal("Gemini model hash did not change when IsCompat changed")
|
|
}
|
|
if ComputeOpenAICompatModelsHash([]config.OpenAICompatibilityModel{{Name: "m"}}) == ComputeOpenAICompatModelsHash([]config.OpenAICompatibilityModel{{Name: "m", IsCompat: true}}) {
|
|
t.Fatal("OpenAI compatibility model hash did not change when IsCompat changed")
|
|
}
|
|
}
|