mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-09 22:38:10 -05:00
- Add Z AI provider configuration to ProviderMap - Include BaseURL for Z AI API endpoint - Add test case for Z AI provider existence - Add glm to OpenAI model prefixes list - Reorder gpt-5 in model prefixes list - Support new Z AI provider in OpenAI compatible plugins
48 lines
906 B
Go
48 lines
906 B
Go
package openai_compatible
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestCreateClient(t *testing.T) {
|
|
testCases := []struct {
|
|
name string
|
|
provider string
|
|
exists bool
|
|
}{
|
|
{
|
|
name: "Existing provider - Mistral",
|
|
provider: "Mistral",
|
|
exists: true,
|
|
},
|
|
{
|
|
name: "Existing provider - Groq",
|
|
provider: "Groq",
|
|
exists: true,
|
|
},
|
|
{
|
|
name: "Existing provider - Z AI",
|
|
provider: "Z AI",
|
|
exists: true,
|
|
},
|
|
{
|
|
name: "Non-existent provider",
|
|
provider: "NonExistent",
|
|
exists: false,
|
|
},
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
client, exists := CreateClient(tc.provider)
|
|
if exists != tc.exists {
|
|
t.Errorf("Expected exists=%v for provider %s, got %v",
|
|
tc.exists, tc.provider, exists)
|
|
}
|
|
if exists && client == nil {
|
|
t.Errorf("Expected non-nil client for provider %s", tc.provider)
|
|
}
|
|
})
|
|
}
|
|
}
|