test(providers): add ResolveProviderSelection tests for LongCat
Add two test cases to TestResolveProviderSelection: - Explicit provider selection with api_base default and proxy wiring - Fallback inference from model name with api_base default
This commit is contained in:
parent
613f788ce8
commit
a080785de9
1 changed files with 20 additions and 0 deletions
|
|
@ -178,6 +178,26 @@ func TestResolveProviderSelection(t *testing.T) {
|
||||||
wantAPIBase: "https://api.moonshot.cn/v1",
|
wantAPIBase: "https://api.moonshot.cn/v1",
|
||||||
wantProxy: "http://127.0.0.1:7890",
|
wantProxy: "http://127.0.0.1:7890",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "explicit longcat provider uses defaults",
|
||||||
|
setup: func(cfg *config.Config) {
|
||||||
|
cfg.Agents.Defaults.Provider = "longcat"
|
||||||
|
cfg.Providers.LongCat.APIKey = "longcat-key"
|
||||||
|
cfg.Providers.LongCat.Proxy = "http://127.0.0.1:7890"
|
||||||
|
},
|
||||||
|
wantType: providerTypeHTTPCompat,
|
||||||
|
wantAPIBase: "https://api.longcat.chat/openai",
|
||||||
|
wantProxy: "http://127.0.0.1:7890",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "longcat model fallback uses longcat base default",
|
||||||
|
setup: func(cfg *config.Config) {
|
||||||
|
cfg.Agents.Defaults.Model = "longcat/LongCat-Flash-Thinking"
|
||||||
|
cfg.Providers.LongCat.APIKey = "longcat-key"
|
||||||
|
},
|
||||||
|
wantType: providerTypeHTTPCompat,
|
||||||
|
wantAPIBase: "https://api.longcat.chat/openai",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "missing keys returns model config error",
|
name: "missing keys returns model config error",
|
||||||
setup: func(cfg *config.Config) {
|
setup: func(cfg *config.Config) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue