-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add qwen-code support, Free credits #6923
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
Conversation
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.
Thank you for your contribution! I've reviewed the changes and found several issues that need attention before this can be merged.
Critical Issue: The file qwen-cli.ts appears to be a binary file despite having a .ts extension. Binary files should not be committed to the repository. Please remove this file.
|
Hey @nitinprajwal, do you know if this doesn't break any TOS with Qwen? I couldn't find any information about using this OAuth authentication. |
|
Hey @daniel-lxs , thanks for following up, I’ve gone through the Qwen TOS https://chat.qwen.ai/legal-agreement/terms-of-service and it doesn’t seem to violate any rules. Also in the Qwen-code github repo, the gemini cli TOS is still present. Another reason this doesn’t break the rules is that it works differently unlike Gemini CLI. gemini-cli used a different endpoint https://cloudcode-pa.googleapis.com, whereas Qwen uses the regular URL https://chat.qwen.ai/ (which is also used for chatting with Qwen model), which is generally accessible to all users, so this PR uses this base-url for authentication. |
mechanicmuthu
left a comment
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.
Well done.
|
Thank you @mechanicmuthu |
c2d03f4 to
641d4cf
Compare
|
Hey @daniel-lxs, can you help me with these check-types (it was passing all the checks before), the issue is adding new provider "qwen-code" to the providerNames array, but the @roo-code/cloud doesn't support the new "qwen-code". This caused TypeScript errors when passing ClineProvider instances. |
|
I noticed that the In Could you either:
This would ensure consistency between what users see in the settings and what actually happens in the code. |
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
… usage in QwenCodeHandler; change setup link to README in QwenCode component
8284111 to
d9f5dad
Compare
|
Hi @Sourav9063, I’ve addressed the error that occurred during the build command, The issue "qwen-code" property was missing in the type definition for Record. I’ve updated the type definition in src/provider-settings.ts to include "qwen-code" and verified the build. |
| } | ||
|
|
||
| private getBaseUrl(creds: QwenOAuthCredentials): string { | ||
| let baseUrl = creds.resource_url || "https://dashscope.aliyuncs.com/compatible-mode/v1" |
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.
Is this a valid 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.
Yes, It's the same base URL mentioned in docs
https://www.alibabacloud.com/help/en/model-studio/compatibility-of-openai-with-dashscope
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.
Because Aliyun uses a proxy to simulate the OpenAI-compatible API, accessing it directly will result in a 404 error.
However, ${base}/models and ${base}/completions are available.
|
Thank you @nitinprajwal for your contribution! We are merging this PR #7380, but we appreciate the time and effort you put into this one. I'm looking forward to seeing more PRs from you. |
|
Thanks @daniel-lxs for taking the time to review my PR. I’d love to contribute more :) |
Related GitHub Discussion
Implements: Discussion #6861 - "Support Qwen Code CLI as an API Provider"
Link: #6861
Description
This PR implements support for Qwen Code CLI as an API provider in Roo Code, addressing the community feature request from GitHub Discussion #6861.
Key Implementation Details:
Architecture Decisions:
Files Modified:
src/api/providers/qwen-code.ts- Main provider implementationpackages/types/src/providers/qwen-code.ts- Type definitions and model configurationswebview-ui/src/components/settings/providers/QwenCode.tsx- Settings UI componentpackages/types/src/provider-settings.ts- Provider schema integrationsrc/api/index.ts- Provider registrationTest Procedure
Manual Testing Steps:
Setup OAuth Credentials:
~/.qwen/oauth_creds.jsonProvider Configuration:
Functionality Testing:
Integration Testing:
Screenshot
Expected Results:
Pre-Submission Checklist
Settings UI:
Documentation Updates
Additional Notes
Implementation Highlights:
Technical Considerations:
Future Enhancements:
Get in Touch
Discord Username: @nitinprajwal
Feel free to reach out if you have any questions about the implementation, need clarification.
Important
Adds Qwen Code support as an API provider with OAuth2 authentication, UI integration, and comprehensive error handling.
qwen-code.ts.ApiOptions.tsxandQwenCode.tsx.QwenCodeHandlerinindex.tsandproviders/index.ts.providers/qwen-code.ts.provider-settings.tsto include Qwen Code in provider schemas.QwenCode.tsx.settings.jsonfor Qwen Code descriptions and instructions.constants.tsanduseSelectedModel.tsto support Qwen Code models.checkExistApiConfig.tsandvalidate.tsto handle Qwen Code configuration without API keys.This description was created by
for ebe1f7711fd60fd79089ae93af844f34e7f8b65e. You can customize this summary. It will automatically update as commits are pushed.