-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add first-class GLM (Zhipu AI) provider support #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,6 +18,7 @@ var KnownProviderTypes = map[string]string{ | |||||||
| "openai": "openai", | ||||||||
| "openrouter": "openrouter", | ||||||||
| "gemini": "gemini", | ||||||||
| "zhipu": "glm", | ||||||||
| } | ||||||||
|
|
||||||||
| // ProviderConfig holds credentials and model configuration for a single provider. | ||||||||
|
|
@@ -116,15 +117,22 @@ var providerEnvVars = map[string]struct{ key, base string }{ | |||||||
| "openai": {"OPENAI_API_KEY", "OPENAI_BASE_URL"}, | ||||||||
| "openrouter": {"OPENROUTER_API_KEY", "OPENROUTER_BASE_URL"}, | ||||||||
| "gemini": {"GEMINI_API_KEY", "GEMINI_BASE_URL"}, | ||||||||
| "zhipu": {"ZHIPU_API_KEY", "ZHIPU_BASE_URL"}, | ||||||||
|
||||||||
| "zhipu": {"ZHIPU_API_KEY", "ZHIPU_BASE_URL"}, | |
| "zhipu": {"ZHIPU_API_KEY", "ZHIPU_BASE_URL"}, | |
| "glm": {"ZHIPU_API_KEY", "ZHIPU_BASE_URL"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provider.gonow supports the provider type "glm", butKnownProviderTypesdoesn't include a "glm" entry. If a user setssettings.providerto "glm" (mirroring how other providers work),ProviderType()will currently default to "openai" and route through the OpenAI client instead of the GLM/LiteLLM path. Consider adding"glm": "glm"here (and aligning env var lookup accordingly) so "glm" works as a first-class provider key, not only as an inferred type for "zhipu".