mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
feat: add zhipu declarative provider with ZHIPU_BASE_URL override (#8204)
Signed-off-by: fre <anonwurcod@proton.me>
This commit is contained in:
@@ -47,6 +47,7 @@ fn map_provider_name(provider: &str) -> &str {
|
||||
"aws_bedrock" => "amazon-bedrock",
|
||||
"gcp_vertex_ai" => "google-vertex",
|
||||
"gemini_oauth" => "google",
|
||||
"zhipu" => "zhipuai",
|
||||
_ => provider,
|
||||
}
|
||||
}
|
||||
@@ -490,6 +491,16 @@ mod tests {
|
||||
Some("x-ai/grok-3".to_string())
|
||||
);
|
||||
|
||||
// === Zhipu AI ===
|
||||
assert_eq!(
|
||||
map_to_canonical_model("zhipu", "glm-4.7", r),
|
||||
Some("zhipuai/glm-4.7".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
map_to_canonical_model("zhipu", "glm-5", r),
|
||||
Some("zhipuai/glm-5".to_string())
|
||||
);
|
||||
|
||||
// === GCP Vertex AI ===
|
||||
assert_eq!(
|
||||
map_to_canonical_model("gcp_vertex_ai", "gemini-2.5-flash", r),
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "zhipu",
|
||||
"engine": "openai",
|
||||
"display_name": "Zhipu AI",
|
||||
"description": "Zhipu AI GLM models. Set ZHIPU_BASE_URL to override the default endpoint (e.g. https://open.bigmodel.cn/api/coding/paas/v4 for Coding Plan models).",
|
||||
"api_key_env": "ZHIPU_API_KEY",
|
||||
"base_url": "${ZHIPU_BASE_URL}",
|
||||
"env_vars": [
|
||||
{
|
||||
"name": "ZHIPU_BASE_URL",
|
||||
"required": false,
|
||||
"secret": false,
|
||||
"default": "https://open.bigmodel.cn/api/paas/v4",
|
||||
"description": "Zhipu API base URL. Change to https://open.bigmodel.cn/api/coding/paas/v4 for Coding Plan models like GLM-5.1."
|
||||
}
|
||||
],
|
||||
"catalog_provider_id": "zhipuai",
|
||||
"dynamic_models": true,
|
||||
"models": [
|
||||
{"name": "glm-4.5", "context_limit": 131072},
|
||||
{"name": "glm-4.5-flash", "context_limit": 131072},
|
||||
{"name": "glm-4.6", "context_limit": 204800},
|
||||
{"name": "glm-4.7", "context_limit": 204800},
|
||||
{"name": "glm-4.7-flash", "context_limit": 200000},
|
||||
{"name": "glm-5", "context_limit": 204800}
|
||||
],
|
||||
"supports_streaming": true
|
||||
}
|
||||
Reference in New Issue
Block a user