Skip to content

support dashscope https://bailian.console.aliyun.com/ #287

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

Merged
merged 1 commit into from
Jul 20, 2025

Conversation

haoyang9804
Copy link
Contributor

Dashscope (or 阿里云百炼 in Chinese) is a provider for a series of models, including text-embedding, Qwen, and Deepseek.
This commit helps support Dashscope for both embedding and generation.

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.

Summary of Changes

Hello @haoyang9804, 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 system's capabilities by integrating Dashscope, a major cloud AI provider. It introduces a new client for interacting with Dashscope's LLM and embedding services, seamlessly incorporating it into the existing model management and chat functionalities. The changes ensure that users can leverage Dashscope models for both text generation and embedding tasks, with robust handling for batch operations and API interactions.

Highlights

  • New Provider Integration: Introduced comprehensive support for Dashscope (Alibaba Cloud) as a new model provider, enabling both large language model (LLM) generation and text embedding capabilities.
  • Dedicated Client Implementation: Added a new DashscopeClient class that acts as a wrapper for the Dashscope API, handling API key management, request conversion, response parsing, and error handling, including retry mechanisms.
  • Configuration and Usability: Updated the core configuration to recognize and utilize Dashscope, including adding it to the list of available clients and defining default models (qwen-plus, qwen-turbo, deepseek-r1) and their parameters.
  • Embedding Enhancements: Implemented specialized components (DashScopeEmbedder, DashScopeBatchEmbedder, DashScopeToEmbeddings) to efficiently handle batch embedding requests, including caching and robust error handling for individual texts within a batch, while respecting Dashscope's batch size limits.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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 the Dashscope AI provider for both generation and embedding tasks. The core logic is implemented in a new api/dashscope_client.py file. The changes also update the configuration and websocket handler to integrate the new provider.

The review identified several areas for improvement in api/dashscope_client.py, including opportunities to reduce code duplication, remove unused parameters, and improve robustness by addressing hardcoded values and imports. A potential performance issue was found related to an incorrect batch size limit for embeddings. In api/websocket_wiki.py, the code for handling different providers is highly repetitive and could be refactored.

@sng-asyncfunc sng-asyncfunc merged commit a5f39e3 into AsyncFuncAI:main Jul 20, 2025
3 checks passed
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.

2 participants