Skip to content

Conversation

@baogang
Copy link

@baogang 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
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • ZhipuAI Integration: Added full support for ZhipuAI models and embeddings, including a new ZhipuAIClient that is OpenAI-compatible.
  • GLM-4 Series Support: Enabled usage of ZhipuAI's GLM-4 series models (flash, plus, standard, air) for text generation.
  • Embedding-3 for RAG: Integrated ZhipuAI's embedding-3 model for Retrieval Augmented Generation (RAG) functionality.
  • SSL Verification Control: Introduced an environment variable (ZHIPUAI_VERIFY_SSL) to control SSL verification for ZhipuAI API calls, useful for proxy/VPN environments.
  • Configuration Updates: Updated README.md files and configuration JSONs (generator.json, embedder.json) to reflect the new ZhipuAI provider and its models/embeddings.
  • Backward Compatibility: Ensured that the new integration does not introduce breaking changes to existing model providers.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant