Context
Qwen/DashScope is currently usable through a custom OpenAI-compatible ModelConfig, but it is not first-class in yoagent:
- No
ModelConfig::qwen(...) / ModelConfig::dashscope(...)
- No
OpenAiCompat::qwen()
ThinkingFormat::Qwen already exists, but no preset uses it
- The provider is absent from the Model Presets docs
This should be added as a first-class OpenAI-compatible preset, similar to DeepSeek, MiniMax, and Z.ai.
Current official API references
Primary OpenAI-compatible docs:
Feature-specific docs:
Relevant API details from docs
OpenAI-compatible Chat Completions base URLs are region-specific:
- International/Singapore:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1
- China/Beijing:
https://dashscope.aliyuncs.com/compatible-mode/v1
- US/Virginia:
https://dashscope-us.aliyuncs.com/compatible-mode/v1
Auth:
Authorization: Bearer $DASHSCOPE_API_KEY
Endpoint:
Examples in current docs use model IDs such as:
qwen3.6-plus
qwen3.5-plus
qwen-plus
qwen-flash
qwen3-coder-plus
qwen3-coder-flash
Qwen-specific Chat Completions parameters include:
enable_thinking
thinking_budget
enable_search
search_options
top_k
Streaming is documented with:
"stream": true,
"stream_options": { "include_usage": true }
Tool calling is supported through OpenAI-compatible tools / tool_calls for supported Qwen text and selected multimodal models.
Proposed yoagent changes
Add an OpenAI-compatible Qwen/DashScope preset:
- Add
OpenAiCompat::qwen().
- Add
ModelConfig::qwen(id, name) using the international base URL by default:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1
- Optionally add region-specific helpers, or document how callers can override
base_url for China/US regions.
- Set:
provider = "qwen" or "dashscope"; choose one and document it
api = ApiProtocol::OpenAiCompletions
compat = Some(OpenAiCompat::qwen())
thinking_format = ThinkingFormat::Qwen
supports_usage_in_streaming = true
max_tokens_field = MaxTokensField::MaxTokens
- Decide whether
supports_reasoning_effort should remain false; current Qwen docs use Qwen-specific enable_thinking / thinking_budget, not OpenAI reasoning_effort.
Optional follow-up:
- Extend
OpenAiCompat with Qwen-specific thinking controls if yoagent wants ThinkingLevel to map to enable_thinking / thinking_budget.
- Consider OpenAI Responses API support for Qwen separately. Qwen Responses uses a different base URL:
https://dashscope-intl.aliyuncs.com/api/v2/apps/protocols/compatible-mode/v1
Docs/tests
Add tests for:
OpenAiCompat::qwen() flags.
ModelConfig::qwen(...) provider, base URL, protocol, and compat.
- Request body uses
max_tokens, not max_completion_tokens.
- Existing
reasoning_content parsing still works for Qwen streams.
Update docs:
docs/providers/model-presets.md
docs/providers/openai-compat.md
docs/providers/overview.md
- README provider table if needed
Why this matters
Qwen/DashScope is a common hosted path for Qwen models and exposes an OpenAI-compatible API with tool calling and streaming. Since yoagent already supports adjacent first-class OpenAI-compatible providers, adding Qwen would reduce custom config boilerplate and make provider behavior explicit.
Context
Qwen/DashScope is currently usable through a custom OpenAI-compatible
ModelConfig, but it is not first-class in yoagent:ModelConfig::qwen(...)/ModelConfig::dashscope(...)OpenAiCompat::qwen()ThinkingFormat::Qwenalready exists, but no preset uses itThis should be added as a first-class OpenAI-compatible preset, similar to DeepSeek, MiniMax, and Z.ai.
Current official API references
Primary OpenAI-compatible docs:
https://docs.qwencloud.com/api-reference/toolkitframework/openai-compatible/overview
https://www.alibabacloud.com/help/en/model-studio/qwen-api-reference/
https://www.alibabacloud.com/help/en/model-studio/text-generation
Feature-specific docs:
stream_options.include_usage:https://www.alibabacloud.com/help/en/model-studio/stream
https://www.alibabacloud.com/help/en/model-studio/qwen-function-calling
https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-responses
https://www.alibabacloud.com/help/en/model-studio/models
Relevant API details from docs
OpenAI-compatible Chat Completions base URLs are region-specific:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1https://dashscope.aliyuncs.com/compatible-mode/v1https://dashscope-us.aliyuncs.com/compatible-mode/v1Auth:
Authorization: Bearer $DASHSCOPE_API_KEYEndpoint:
POST /chat/completionsExamples in current docs use model IDs such as:
qwen3.6-plusqwen3.5-plusqwen-plusqwen-flashqwen3-coder-plusqwen3-coder-flashQwen-specific Chat Completions parameters include:
enable_thinkingthinking_budgetenable_searchsearch_optionstop_kStreaming is documented with:
Tool calling is supported through OpenAI-compatible
tools/tool_callsfor supported Qwen text and selected multimodal models.Proposed yoagent changes
Add an OpenAI-compatible Qwen/DashScope preset:
OpenAiCompat::qwen().ModelConfig::qwen(id, name)using the international base URL by default:https://dashscope-intl.aliyuncs.com/compatible-mode/v1base_urlfor China/US regions.provider = "qwen"or"dashscope"; choose one and document itapi = ApiProtocol::OpenAiCompletionscompat = Some(OpenAiCompat::qwen())thinking_format = ThinkingFormat::Qwensupports_usage_in_streaming = truemax_tokens_field = MaxTokensField::MaxTokenssupports_reasoning_effortshould remainfalse; current Qwen docs use Qwen-specificenable_thinking/thinking_budget, not OpenAIreasoning_effort.Optional follow-up:
OpenAiCompatwith Qwen-specific thinking controls if yoagent wantsThinkingLevelto map toenable_thinking/thinking_budget.https://dashscope-intl.aliyuncs.com/api/v2/apps/protocols/compatible-mode/v1Docs/tests
Add tests for:
OpenAiCompat::qwen()flags.ModelConfig::qwen(...)provider, base URL, protocol, and compat.max_tokens, notmax_completion_tokens.reasoning_contentparsing still works for Qwen streams.Update docs:
docs/providers/model-presets.mddocs/providers/openai-compat.mddocs/providers/overview.mdWhy this matters
Qwen/DashScope is a common hosted path for Qwen models and exposes an OpenAI-compatible API with tool calling and streaming. Since yoagent already supports adjacent first-class OpenAI-compatible providers, adding Qwen would reduce custom config boilerplate and make provider behavior explicit.