The SDK intelligent assistant built into the DashScope Python SDK — describe your requirement to get version-verified runnable code, or paste an error or file path to auto-diagnose, fix, and verify.
DashScope SDK Expert (hereafter "SDK Expert") is an SDK intelligent assistant CLI built into the dashscope Python SDK (>=1.27.3). This page is the general usage guide: how to use SDK Expert for development and troubleshooting. For complete parameters of each interface, see the corresponding single-interface reference page in the sidebar; capability domains are listed in "Coverage overview" below.
After installing the SDK Expert knowledge pack, the following skills are available (
SDK Expert covers all DashScope SDK capability domains — text generation, multi-modal, speech, retrieval, fine-tuning and deployment, agents, and more. To look up API documentation/examples, use
Pain point: The SDK has many APIs and frequent version iterations; developers often have to dig through docs to confirm parameter names, input formats, and model lists.
Approach: Describe your requirements to SDK Expert, and SDK Expert will automatically:
Tips:
Pain point: When a call fails, the error code meaning is unclear and the stack trace points inside the SDK, making it hard to tell whether it is a code or parameter issue.
Approach (three paths, choose by scenario):
Tips:
Will SDK Expert modify my source code without asking?
No. Before changing files, SDK Expert generates a diff preview for your confirmation; changes are applied only after you confirm and support rollback.
Can it work offline?
No. SDK Expert calls model inference (consuming tokens, billed by Model Studio); it requires network access and a valid API Key.
Can the generated code run in production directly?
SDK Expert generates version-verified runnable code, but before production you should review quota, concurrency, error handling, and sensitive info yourself.
Can it generate non-Python code?
It can generate other languages' code text, but does not verify non-Python SDK versions (different version schemes — review yourself).
Will my code be uploaded?
When diagnosing (
Quick start
-
Prepare API Key and base_url: Create a key (
sk-prefix) in the Model Studio console under "API Key"; keys are region-specific. Configure via environment variable or/setupin the session:base_url differs by region; for the domain mapping see Base URL overview. -
Install/upgrade the SDK: SDK Expert was introduced with dashscope Python SDK 1.27.3, and SDK Expert's CLI capabilities are provided by the separate package dashscope-agenticx.
-
Start the CLI: Run
dashscope(without a subcommand) in your terminal to enter the SDK Expert interactive session (on first launch, you will be prompted to download the SDK Expert knowledge pack, which includes specialized skills such as api-doc and diagnose). SDK Expert's CLI capability (the originalpython -m dashscope.aclientry point) has been split out into the dashscope-agenticx package; to manually install the knowledge pack, use the AgenticX entry point instead:If the command-line script is already installed, you can also run it directly:Once the download completes, ask questions through the SDK:Asking questions viadashscope expertrequires dashscope and dashscope-agenticx to be installed in the same Python environment — usepip install -U "dashscope[acli]"to install both at once; if installed separately, run them in the same virtual environment. -
View help: Enter
/helpin the session to view all commands and skills. Commands are session operations (such as/clear,/help,/exit); skills are domain capability switches (/skill <名称>). If unsure, just ask in natural language and SDK Expert will automatically match a skill. -
Ask as needed: Simply describe your needs in natural language, for example:
- "Stream output with qwen-plus and count token consumption"
- "What does the error
Throttling.RateQuotamean, and how do I fix it?" - "Read gen.py and diagnose the root cause of the InvalidParameter error"
@file pathto attach files for SDK Expert to read directly, and ↑ to recall command history are also supported.
Capability overview
After installing the SDK Expert knowledge pack, the following skills are available (/skill to view all):
- api-doc — Look up SDK API documentation
- sdk-example — Generate example code
- error-code — Error code meanings and fix suggestions
- diagnose — Read code files and locate root causes
- explain-code — Explain specific code logic
- translate — Multilingual translation
- update-sdk — Update the knowledge base index
/skill to switch skills (run without arguments to view all); common examples:
api-doc/sdk-example; to generate code or troubleshoot, simply ask in natural language.
SDK Expert is a full agentic CLI that also supports multi-agent collaboration, MCP (Model Context Protocol, the standard for external tool integration) servers, scheduled tasks (
/cron), auditing (/audit), session compression and history (/compress, /history), and more. Common in-session / commands are grouped by category:- Session management:
/help/clear/info/stats/setup/exit/feedback - Capabilities and tools:
/skill/mcp/voice/tts/copy - History and auditing:
/history/compress/cron/audit/dev/example
/help output for the complete list.Best practice 1: State your needs without reading docs and get runnable code directly
Pain point: The SDK has many APIs and frequent version iterations; developers often have to dig through docs to confirm parameter names, input formats, and model lists.
Approach: Describe your requirements to SDK Expert, and SDK Expert will automatically:
- Match the built-in SDK knowledge base (model list/parameters/input-output structures/error codes)
- Verify the local SDK version (reminds you to upgrade if it is inconsistent)
- Generate runnable code, execute it, and show the output
- Specify language/framework: e.g. "Wrap it as a FastAPI endpoint", "Call it asynchronously with async/await"
- Specify version: "We're on dashscope 1.20.x — is this parameter supported?" — SDK Expert checks the installed version before answering
- Follow up on details: "What's the parameter value range?" "What other models are available?"
Best practice 2: Troubleshoot issues and let it locate and fix bugs automatically
Pain point: When a call fails, the error code meaning is unclear and the stack trace points inside the SDK, making it hard to tell whether it is a code or parameter issue.
Approach (three paths, choose by scenario):
- Paste the error code/error message →
/skill error-code <错误码>(e.g./skill error-code Throttling.RateQuota) → SDK Expert outputs the error code meaning + actionable fix suggestions (adjust concurrency/change parameters/apply for quota) + optional code snippets. - Provide the path of the problematic code file →
/skill diagnose <文件路径>(e.g./skill diagnose gen.py) → SDK Expert reads the source code and, against common root causes (mixing old prompt formats, incorrect messages structure, unconfigured api_key/workspace, improperly polled asynchronous tasks), outputs suspected root causes + suggested changes. - Automatic fix loop →
/skill diagnoselocates the root cause → generates a diff preview for your confirmation → once confirmed, SDK Expert applies the changes and reruns the script to verify → forming a "read → diagnose → fix → verify" workflow. SDK Expert asks for confirmation before modifying files, and changes can be rolled back.
- Attach
request_idwith the error for correlating server-side logs (request_idis in theresponse.request_idfield of the response body or in the error object's attributes) - For complex issues, first ask SDK Expert to "explain this code logic" (
/skill explain-code) to confirm a shared understanding before fixing - If the SDK itself has defects or your needs are unmet, file an Issue on GitHub
FAQ
Will SDK Expert modify my source code without asking?
No. Before changing files, SDK Expert generates a diff preview for your confirmation; changes are applied only after you confirm and support rollback.
Can it work offline?
No. SDK Expert calls model inference (consuming tokens, billed by Model Studio); it requires network access and a valid API Key.
Can the generated code run in production directly?
SDK Expert generates version-verified runnable code, but before production you should review quota, concurrency, error handling, and sensitive info yourself.
Can it generate non-Python code?
It can generate other languages' code text, but does not verify non-Python SDK versions (different version schemes — review yourself).
Will my code be uploaded?
When diagnosing (/skill diagnose) or attaching code, the code content is sent to the model for inference; mind sensitive data.