agentscope-extensions-model-dashscope integrates Alibaba Cloud DashScope Qwen models, including multimodal and reasoning-capable Qwen models.
Add the dependency
ModelRegistry
SetDASHSCOPE_API_KEY, then use either dashscope:<model> or the Qwen short form:
Explicit builder
Use the builder when you need DashScope-specific options such as endpoint type, thinking, search, encryption:Documents
DashScope reads documents two ways, matched by the source of theDocumentBlock:
- File id (
qwen-long,qwen-doc-turbo): upload the file through the OpenAI-compatiblefilesendpoint and pass aFileIdSourcewith provider"dashscope". The formatter injects afileid://system message before the turn that references the document. Historical turns keep their references: a long conversation re-sends one system message per past file-id document on every request. - Public URL (
qwen-doc-turbo): pass aURLSourcepointing at a publicly reachable file. Up to 10 URL entries are accepted per request and they travel asdoc_urlcontent parts inside the user turn itself. This limit includes documents resent with the conversation history; repeated URLs count again. Compaction can replace old documents with text references, but it is not guaranteed to run before the limit is reached.
doc_url parts are only accepted by the
text-generation endpoint: vision models (routed to the multimodal endpoint) reject URL documents
and need a per-model alternative - check the model’s own input-capability table (file id, or no
document input at all) instead of assuming the file-id path works everywhere.
The parsing strategy can be configured per document through the block metadata:
PPT generation (qwen-doc-turbo)
qwen-doc-turbo can generate a PowerPoint file from the document in the conversation. The skill
requires streaming and travels through additional body params, which the DashScope HTTP client
merges into the request parameters. The example below configures it as a model default via
defaultOptions, so every call of that model carries it; for a one-off call, pass the same
GenerateOptions through your model’s per-call options entry point instead:
DashScopeSkill.pptTemplate(...)) reads the document as plain text carried in the
system message body — a fileid:// reference or a doc_url part is not consumed there. Per the
official input-capability table, generating a PPT from a file ID or from a doc_url document
requires creative mode (pptCreative()), which is what the example above uses. The outline and
page content stream back through thinking blocks (reasoning_content); the final PPT download URL
arrives as the text content of the last response. That reply carries the metadata key dashscope.skill (value
ppt, exposed as DashScopeSkill.RESPONSE_METADATA_KEY), so consumers can identify skill output.
The metadata contains the skill type; the download URL remains in the text content.