feat: add Z AI provider and glm model support

- 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
This commit is contained in:
Kayvan Sylvan
2025-12-04 11:35:05 +08:00
parent 298abecb3f
commit 4b080fd6dd
5 changed files with 20 additions and 1 deletions

View File

@@ -172,10 +172,11 @@ func (o *Client) supportsResponsesAPI() bool {
func (o *Client) NeedsRawMode(modelName string) bool {
openaiModelsPrefixes := []string{
"glm",
"gpt-5",
"o1",
"o3",
"o4",
"gpt-5",
}
openAIModelsNeedingRaw := []string{
"gpt-4o-mini-search-preview",

View File

@@ -123,6 +123,11 @@ var ProviderMap = map[string]ProviderConfig{
BaseURL: "https://api.venice.ai/api/v1",
ImplementsResponses: false,
},
"Z AI": {
Name: "Z AI",
BaseURL: "https://api.z.ai/api/paas/v4",
ImplementsResponses: false,
},
}
// GetProviderByName returns the provider configuration for a given name with O(1) lookup

View File

@@ -20,6 +20,11 @@ func TestCreateClient(t *testing.T) {
provider: "Groq",
exists: true,
},
{
name: "Existing provider - Z AI",
provider: "Z AI",
exists: true,
},
{
name: "Non-existent provider",
provider: "NonExistent",