阿里雲百煉 CLI 文本對話與 Omni 全模態互動的命令速查。
一條命令即可在終端機呼叫阿里雲百煉文本對話與全模態互動能力。
發送文字模型請求(OpenAI 兼容,DashScope)。需要 API Key 鑑權。
語法
範例:發送文字訊息請求模型回覆
範例:傳送同步 Batch Chat 請求
支援文字輸入與音訊輸出的多模態對話(Qwen-Omni)。需要 API Key 鑑權。
語法
範例:預覽可用音色列表
命令速查
bl text chat
發送文字模型請求(OpenAI 兼容,DashScope)。需要 API Key 鑑權。
語法
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
--api <chat|responses> | string | 否 | 呼叫的 API(預設:chat) |
--model <model> | string | 否 | 模型 ID(預設:qwen3.8-max) |
--message <text> | array | 否 | 消息文字(可重複;可使用 role: 前綴指定角色),也可使用 --messages-file |
--messages-file <path> | string | 否 | 包含 messages 數組的 JSON 檔案(使用 - 從 stdin 讀取) |
--system <text> | string | 否 | 系統提示詞 |
--max-tokens <n> | number | 否 | 最大生成 Token 數(預設:4096) |
--temperature <n> | number | 否 | 採樣溫度 (0.0, 2.0] |
--top-p <n> | number | 否 | 核採樣閾值 |
--enable-search <true|false> | boolean | 否 | 啟用模型內建聯網搜尋(僅 Chat Completions API;qwen3.8-max 預設開啟) |
--stream | switch | 否 | 流式輸出回應 Token(TTY 中預設開啟) |
--tool <json-or-path> | array | 否 | JSON 格式的工具定義或檔案路徑(可重複) |
--enable-thinking | boolean | 否 | 啟用思考/推理模式(適用於 qwen3/qwq 模型);傳 --enable-thinking=false 可關閉 |
--thinking-budget <n> | number | 否 | 思考過程最大 Token 數(預設:4096) |
--batch | switch | 否 | 傳送單次同步 Batch Chat 請求(非串流) |
--prime | switch | 否 | 使用工作空間專屬 Endpoint 的 Prime 模式 |
--workspace-id <id> | string | 否 | 預設 Prime Endpoint 使用的工作空間 ID(也可設定 BAILIAN_WORKSPACE_ID) |
--batch傳送一次同步 Batch Chat 請求,即使在 TTY 中也強制非串流,不能與--prime、--api responses或--stream同時使用。--message或--messages-file表示同一請求的對話內容,不表示檔案中的獨立請求。- Batch Chat 請求總逾時預設為 300 秒,
--timeout取值需為 60–3600 秒。檔案批次推理使用batch create/get/download,建立後傳回任務 ID,不等待完成。 --batch拒絕明確指定的即時或 Token Plan Endpoint;明確指定 Batch 或自訂代理位址時保留現有憑證。不發生自動回退或 POST 重放。- Prime 模式必須顯式指定模型,且目前僅支援 Chat Completions API。
- Prime Endpoint:已設定的 --base-url、DASHSCOPE_BASE_URL 或 Profile base_url 優先;否則依 --workspace-id、BAILIAN_WORKSPACE_ID、設定項 workspace_id 解析工作空間。
--enable-search對應 Chat Completions 的enable_search參數,需要模型支援內建聯網搜尋;白名單模型(qwen3.8-max)預設開啟,可傳--enable-search false明確關閉;Responses API 請改用--tool '{"type":"web_search"}'。--enable-thinking支援明確傳入false;關閉思考時不再傳送thinking_budget。
bl omni
支援文字輸入與音訊輸出的多模態對話(Qwen-Omni)。需要 API Key 鑑權。
語法
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
--message <text> | array | 否 | 消息文字(可重複;可使用 role: 前綴指定角色) |
--model <model> | string | 否 | 模型 ID(預設:qwen3.8-omni-flash) |
--system <text> | string | 否 | 系統提示詞 |
--image <url> | array | 否 | 圖片 URL 或本地檔案(可重複) |
--audio <url> | array | 否 | 音訊 URL 或本地檔案(.wav/.mp3/.amr/.aac/.m4a/.ogg/.3gp/.3gpp) |
--video <url> | array | 否 | 影像檔案 URL / 本地路徑,或以逗號分隔的幀 URL |
--voice <voice> | string | 否 | 輸出音色 ID(預設:Tina)。使用 --list-voices 檢視所有選項 |
--list-voices | switch | 否 | 列出可用的輸出音色並退出 |
--audio-format <fmt> | string | 否 | 音訊輸出格式(預設:wav) |
--audio-out <path> | string | 否 | 將音訊儲存至檔案(預設:自動產生路徑) |
--text-only | switch | 否 | 僅輸出文字,不產生音訊 |
--max-tokens <n> | number | 否 | 最大生成 Token 數 |
--temperature <n> | number | 否 | 採樣溫度 (0.0, 2.0] |