-
Couldn't load subscription status.
- Fork 1.2k
Add GLM Model Support #386
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?
Conversation
baogang
commented
Oct 28, 2025
- Add ZhipuAIClient with OpenAI-compatible API
- Support GLM-4 series models (flash/plus/standard/air)
- Add embedding-3 support for RAG functionality
- SSL verification control via ZHIPUAI_VERIFY_SSL env var
- Backward compatible: no breaking changes to existing providers
- Add ZhipuAIClient with OpenAI-compatible API - Support GLM-4 series models (flash/plus/standard/air) - Add embedding-3 support for RAG functionality - SSL verification control via ZHIPUAI_VERIFY_SSL env var - Backward compatible: no breaking changes to existing providers - Google Gemini top_k parameter made optional (still supported) Features: - 4 chat models: glm-4-flash (default), glm-4-plus, glm-4, glm-4-air - 1 embedding model: embedding-3 - Fully integrated with existing RAG pipeline - Tested with real-world repositories Files changed: - api/zhipuai_client.py (new): ZhipuAI ModelClient implementation - api/config.py: Register ZhipuAIClient - api/config/generator.json: Add zhipuai provider configuration - api/config/embedder.json: Add embedder_zhipuai configuration - api/tools/embedder.py: Add zhipuai embedder support - api/websocket_wiki.py: Add zhipuai handling logic - api/simple_chat.py: Add zhipuai handling logic
Summary of ChangesHello @baogang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the platform's AI capabilities by integrating ZhipuAI as a new model and embedding provider. It introduces a dedicated client for ZhipuAI, leveraging its OpenAI-compatible API to support the GLM-4 series models for text generation and embedding-3 for RAG. The changes also include necessary configuration updates and an option to manage SSL verification for ZhipuAI API calls, all while maintaining backward compatibility with existing providers. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds support for ZhipuAI's GLM models and embedding services. The changes include adding a new ZhipuAIClient, updating configuration files, and modifying API endpoints to handle the new provider.
My review found a critical issue in api/simple_chat.py where the streaming logic for the new zhipuai provider is missing, which will cause requests to fail. I've also identified several medium-severity issues, including leftover debug print statements and an inefficient implementation for non-streaming calls in the new zhipuai_client.py. Additionally, there's significant code duplication between simple_chat.py and websocket_wiki.py that should be refactored to improve maintainability.
Overall, the PR is a good step towards integrating ZhipuAI, but the identified issues should be addressed before merging.