qwencloud-text
Original:🇺🇸 English
Translated
3 scriptsChecked / no sensitive code detected
[QwenCloud] Generate text, have conversations, write code, reason, and call functions with Qwen models. TRIGGER when: user asks to chat with Qwen, generate text, write code with Qwen, use Qwen function calling, or explicitly invokes this skill by name (e.g. use qwencloud-text). DO NOT TRIGGER when: general coding questions without Qwen, non-Qwen AI model usage (OpenAI, Gemini, etc.), image/video understanding (use qwencloud-vision), image/video/audio generation.
5installs
Sourceqwencloud/qwencloud-ai
Added on
NPX Install
npx skill4agent add qwencloud/qwencloud-ai qwencloud-textTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Agent setup: If your agent doesn't auto-load skills (e.g. Claude Code), see agent-compatibility.md once per session.
Qwen Text Chat (OpenAI-Compatible)
Generate text, conduct conversations, write code, and invoke tools using Qwen models through the OpenAI-compatible API.
This skill is part of qwencloud/qwencloud-ai.
Skill directory
Use this skill's internal files to execute and learn. Load reference files on demand when the default path fails or you
need details.
| Location | Purpose |
|---|---|
| Default execution — chat/completions request, streaming, output save |
| Fallback: curl, Python SDK, function calling, thinking mode |
| API supplement and full code examples |
| Prompt engineering: CO-STAR framework, CoT, few-shot, task steps |
| Official documentation URLs (manual lookup only) |
| Agent self-check: register skills in project config for agents that don't auto-load |
Security
NEVER output any API key or credential in plaintext. Always use variable references ( in shell,
in Python). Any check or detection of credentials must be non-plaintext: report
only status (e.g. "set" / "not set", "valid" / "invalid"), never the value. Never display contents of or config
files that may contain secrets.
$DASHSCOPE_API_KEYos.environ["DASHSCOPE_API_KEY"].envWhen the API key is not configured, NEVER ask the user to provide it directly. Instead, help create a file with a placeholder () and instruct the user to replace it with their actual key from the QwenCloud Console. Only write the actual key value if the user explicitly requests it.
.envDASHSCOPE_API_KEY=sk-your-key-hereKey Compatibility
Scripts require a standard QwenCloud API key (). Coding Plan keys () cannot be used for direct
API calls — they are designed exclusively for interactive coding tools (Cursor, Claude Code, Qwen Code) and do not work
on QwenCloud API endpoints. The script detects keys at startup and prints a warning. If qwencloud-ops-auth is installed,
see its for details on key types, endpoint mapping, and error codes.
sk-...sk-sp-...sk-sp-references/codingplan.mdModel Selection
| Model | Use Case |
|---|---|
| Recommended default — balanced performance, cost, speed, 1M context |
| Fast, low-cost, 1M context |
| Strongest capability |
| General purpose |
| Cheapest, low latency |
| Recommended code model — best balance of quality, speed, cost; agentic coding |
| Code generation — highest quality for complex tasks |
| Code generation — fast responses, lower cost |
| Reasoning / chain-of-thought |
| Machine translation — best quality, 92 languages |
| Machine translation — fast, low cost, 92 languages |
| Machine translation — real-time chat, fastest, 31 languages |
| Role-playing — recommended for Singapore |
| Role-playing — character restoration, empathetic dialog |
| Role-playing — fast, lower cost |
- User specified a model → use directly.
- Consult the qwencloud-model-selector skill when model choice depends on requirement, scenario, or pricing.
- No signal, clear task → (default).
qwen3.5-plus
Fallback: if model-selector is unavailable, the defaults in the table above apply.
⚠️ Important: The model list above is a point-in-time snapshot and may be outdated. Model availability changes frequently. Always check the official model list for the authoritative, up-to-date catalog before making model decisions.
Execution
Prerequisites
- API Key: Check that (or
DASHSCOPE_API_KEY) is set using a non-plaintext check only (e.g. in shell:QWEN_API_KEY; report only "set" or "not set", never the key value). If not set: run the * qwencloud-ops-auth* skill if available; otherwise guide the user to obtain a key from QwenCloud Console and set it via[ -n "$DASHSCOPE_API_KEY" ]file (.envin project root or current directory) or environment variable. The script searches forecho 'DASHSCOPE_API_KEY=sk-your-key-here' >> .envin the current working directory and the project root. Skills may be installed independently — do not assume qwencloud-ops-auth is present..env - Python 3.9+ (stdlib only, no pip install needed for script execution)
Environment Check
Before first execution, verify Python is available:
bash
python3 --version # must be 3.9+If is not found, try or . If Python is unavailable or below 3.9, skip to *
Path 2 (curl)* in execution-guide.md.
python3python --versionpy -3 --versionDefault: Run Script
Script path: Scripts are in the subdirectory of this skill's directory (the directory containing this
SKILL.md). You MUST first locate this skill's installation directory, then ALWAYS use the full absolute path to execute
scripts. Do NOT assume scripts are in the current working directory. Do NOT use to switch directories before
execution.
scripts/cdExecution note: Run all scripts in the foreground — wait for stdout; do not background.
Discovery: Run first to see all available arguments.
python3 <this-skill-dir>/scripts/text.py --helpbash
python3 <this-skill-dir>/scripts/text.py \
--request '{"messages":[{"role":"user","content":"Hello!"}],"model":"qwen3.5-plus"}' \
--output output/qwencloud-text/ --print-responseFor streaming (recommended for interactive use):
bash
python3 <this-skill-dir>/scripts/text.py \
--request '{"messages":[{"role":"user","content":"Write a poem about the sea"}],"model":"qwen3.5-plus"}' \
--stream --print-response| Argument | Description |
|---|---|
| JSON request body |
| Load request from file (alternative to |
| Enable streaming output |
| Save response JSON to directory |
| Print response to stdout |
| Override model (also settable in request JSON) |
Verify Result
- Exit code + output contains valid JSON with
0field → successchoices - Non-zero exit, HTTP error, empty response, or JSON with /
"code"error → fail"message" - If agent cannot read exit codes, scan output for error patterns (,
Error,Traceback,401)403 - Post-execution check: When is used, verify the response JSON file exists and contains
--outputchoices - MANDATORY — stderr signal check: After confirming the result, scan the command's stderr output for
or
[ACTION_REQUIRED]. If either signal is present, you MUST follow the instructions in Update Check below before responding to the user.[UPDATE_AVAILABLE]
On Failure
If the script fails, match the error output against the diagnostic table below to determine the resolution. If no match,
read execution-guide.md for alternative paths: curl commands (Path 2), Python SDK code
generation (Path 3), and autonomous resolution (Path 5).
If Python is not available at all → skip directly to Path 2 (curl)
in execution-guide.md.
| Error Pattern | Diagnosis | Resolution |
|---|---|---|
| Python not on PATH | Try |
| Script version check failed | Upgrade Python to 3.9+ |
| Python < 3.9 | Upgrade Python to 3.9+ |
| Missing API key | Obtain key from QwenCloud Console; add to |
| Invalid or mismatched key | Run qwencloud-ops-auth (non-plaintext check only); verify key is valid |
| SSL cert issue (proxy/corporate) | macOS: run |
| Network unreachable | Check internet; set |
| Rate limited | Wait and retry with backoff |
| Server error | Retry with backoff |
| Can't write output | Use |
Quick Reference
Request Fields
| Field | Type | Description |
|---|---|---|
| string | array | User input or message list |
| string | Model ID (e.g. |
| string | System prompt (optional) |
| float | 0–2, controls randomness |
| int | Max output tokens |
| array | Function definitions for tool calling |
| bool | Enable streaming (recommended for interactive use) |
| bool | Enable thinking mode. Model defaults apply: |
Response Fields
| Field | Description |
|---|---|
| Generated text content |
| Model used |
| Token usage (prompt_tokens, completion_tokens) |
| Function call requests (if tools used) |
Advanced Features
These are API-level features supported through request parameters. All use the same endpoint.
chat/completions| Feature | How to Enable | Notes |
|---|---|---|
| Structured output | | Force JSON output conforming to schema |
| Web search | | Real-time web search augmented responses |
| Deep thinking | | Extended reasoning; only when user requests it |
| Function calling | | Define functions for tool use |
| Context cache | Automatic for repeated prefixes; or explicit session-based | Reduces cost for repeated context |
| Partial mode | | Continue/complete a prefix |
| Batch inference | Async batch API with JSONL input | 50% cost discount |
For detailed usage of each feature, see api-guide.md and sources.md.
Error Handling
| Error | Cause | Action |
|---|---|---|
| Invalid or missing API key | Run qwencloud-ops-auth if available; else prompt user to set key (non-plaintext check only) |
| Rate limit exceeded | Retry with backoff |
| Server error | Retry; check status page |
| Model ID not found | Verify model name against Model Selection table |
| Bad request body | Validate JSON and field types |
| openai SDK vs httpx incompatibility | |
Output Location
Prefer the current working directory for all outputs. Default subdirectory when is used:
.
--output./output/qwencloud-text/Write prohibition: NEVER write output files into this skill's installation directory or any hierarchy. All generated content must go to under the current working directory or a user-specified path.
skills/output/Update Check (MANDATORY Post-Execution)
After script execution, check stderr for action signals. The script automatically detects update status and emits
structured signals. You MUST act on them. This section also applies when the user explicitly asks to check for updates.
Signal: [ACTION_REQUIRED] qwencloud-update-check skill is not installed
[ACTION_REQUIRED] qwencloud-update-check skill is not installedWhen stderr contains this signal, you MUST present the following options to the user and wait for their response
before proceeding. Do NOT silently skip this.
The update-check skill is not installed. It keeps you informed about new qwencloud/qwencloud-ai features and bug fixes.
- Install now — I'll run the install command for you
- Skip for now — do nothing this time
- Never remind me — permanently suppress this prompt
After the user responds:
- User chooses 1 → run:
, then run:
npx skills add QwenCloud/qwencloud-ai --skill qwencloud-update-check -ypython3 <this-skill-scripts-dir>/gossamer.py --dismiss - User chooses 2 → run: , then continue normally
python3 <this-skill-scripts-dir>/gossamer.py --dismiss - User chooses 3 → run: , then continue normally
python3 <this-skill-scripts-dir>/gossamer.py --never-install
Signal: [UPDATE_AVAILABLE]
[UPDATE_AVAILABLE]When stderr contains this signal, you MUST append a brief update notice to your response, including the version info and
the update command shown in the stderr output.
No signal in stderr
If stderr contains neither nor , no action is needed — the skill is installed
and up to date (or cached within 24h).
[ACTION_REQUIRED][UPDATE_AVAILABLE]Explicit user request
When the user explicitly asks to check for updates (e.g. "check for updates", "check version"):
- Look for in sibling skill directories.
qwencloud-update-check/SKILL.md - If found — run: and report the result.
python3 <qwencloud-update-check-dir>/scripts/check_update.py --print-response - If not found — present the install options above.
References
- execution-guide.md — Fallback paths (curl, SDK, autonomous), function calling, thinking mode
- api-guide.md — API supplementary guide with full code examples
- sources.md — Official documentation URLs