Dashscope Agent
Run an Aliyun DashScope application as a LangBot AgentRunner.
DashScope Agent
Run an Aliyun DashScope application as a LangBot AgentRunner.
Runner ID
plugin:langbot-team/DashScopeAgent/default
Configuration
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| app-type | select | yes | agent | Application type (agent/workflow) |
| api-key | secret | yes | '' | DashScope API key |
| app-id | string | yes | '' | Application ID |
| references_quote | string | no | 参考资料来自: | Quote text for references |
| timeout | number | no | 120 | Request timeout in seconds |
| langbot-assets-enabled | boolean | no | false | Register a short-lived LangBot asset token for each run and pass it via biz_params |
| langbot-assets-gateway-host | string | no | 0.0.0.0 | Host for the local LangBot Asset Gateway |
| langbot-assets-gateway-port | integer | no | 8765 | Port for the local LangBot Asset Gateway |
| langbot-assets-gateway-request-timeout | integer | no | 60 | Timeout for individual gateway tool calls |
| langbot-assets-token-ttl | integer | no | 3600 | Lifetime of each run token in seconds |
| langbot-assets-input-name | string | no | langbot_asset_run_token | biz_params key that receives the run token |
Capabilities
streaming: yes
LangBot Asset Callback Through 百炼 MCP
The DashScope (百炼) agent app can call back into LangBot assets through the SDK
Asset Gateway, the same mechanism the Dify runner uses. The gateway is a
run-token-authorized MCP server (POST /mcp, JSON-RPC) exposing the
run-authorized LangBot tools: langbot_list_assets,
langbot_get_current_event, langbot_history_page,
langbot_retrieve_knowledge, langbot_get_tool_detail, and langbot_call_tool.
How it works
- When
langbot-assets-enabledis true, this runner registers a short-lived, run-scoped token before calling the app and passes it through DashScopebiz_paramsunder the keylangbot-assets-input-name(defaultlangbot_asset_run_token). This works for bothagentandworkflowapp types; the asset callback needs the agent app type (tool-calling). - The 百炼 app references that value (e.g. via a prompt/plugin variable bound to
biz_params) and passes it as therun_tokenargument on every LangBot MCP tool call. - The runner removes the token when the run ends. Tool calls without a valid token are rejected by the gateway.
The gateway accepts the token via an Authorization: Bearer header or via a
run_token tool-call argument. Use the run_token argument approach here.
Configure 百炼
- In the 百炼 agent app, attach the LangBot Asset Gateway as an MCP service whose
URL routes to the gateway
/mcp(a public HTTPS URL for 百炼 Cloud). - Add an app input/variable bound to
biz_params.langbot_asset_run_token. - In the app prompt, instruct the agent to pass that value as
run_tokenon every LangBot MCP tool call, and to calllangbot_list_assetsfirst when it needs to discover the run's assets.
Configure LangBot
Select the DashScope runner and set:
app-type = agent
api-key = <DashScope API key>
app-id = <百炼 app id>
langbot-assets-enabled = true
langbot-assets-gateway-host = 0.0.0.0
langbot-assets-gateway-port = 8765
langbot-assets-token-ttl = 3600
langbot-assets-input-name = langbot_asset_run_token
Limitations
- 百炼 Cloud cannot reach
localhost; use a public HTTPS URL for the gateway/mcpendpoint. - The run token is short-lived and run-scoped; the app must complete its asset callbacks within the app run.
- The gateway exposes only the assets permitted by the current run: current event, history page, knowledge retrieval, tool detail, and tool call.
- The 百炼 app must support attaching an external MCP service and forwarding the
biz_paramsvalue into the tool call. Verify thetools/listhandshake and end-to-end token passing in your 百炼 app before relying on it.
Legacy Runner
Migrated from dashscope-app-api in LangBot.
Use Dashscope Agent in Feishu/Lark bots, DingTalk bots, WeCom bots, WeChat bots, QQ bots, Slack bots, Discord bots, Telegram bots, LINE Bots, and Matrix Bots.
Host your bot on LangBot Cloud and connect this extension to the collaboration platforms your team already uses.