Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
阿里云百炼
https://help.aliyun.com/zh/model-studio/
Admin
阿里云百炼是一站式大模型开发与应用平台,集成了通义千问及主流第三方模型,为开发者提供兼容OpenAI的API和全链路模型服务,并支持可视化应用构建,快速创建智能体和AI应用。
Tokens:
151,272
Snippets:
890
Trust Score:
10
Update:
2 months ago
Context
Chat
Benchmark
32.36
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Install langchain_openai SDK Source: https://help.aliyun.com/zh/model-studio/compatibility-of-openai-with-dashscope Command to install the necessary SDK for integrating with DashScope via LangChain. ```bash pip install langchain-openai ``` -------------------------------- ### Install langchain_openai Source: https://help.aliyun.com/zh/model-studio/compatibility-of-openai-with-dashscope Install the required library to enable OpenAI-compatible SDK support. ```bash pip install -U langchain_openai ``` -------------------------------- ### Install OpenAI SDK for Node.js Source: https://help.aliyun.com/zh/model-studio/first-api-call-to-qwen Commands to install the OpenAI SDK using npm or yarn. ```bash npm install --save openai # 或者 yarn add openai ``` -------------------------------- ### Start Recognition Dialog Source: https://help.aliyun.com/zh/model-studio/android-sdk-for-paraformer-real-time-service Method signature for starting the recognition process, including an example of updating the API key. ```java public synchronized int startDialog(VadMode vad_mode, String dialog_params) ``` ```json { "apikey": "st-****" } ``` -------------------------------- ### Check Java and Maven Versions Source: https://help.aliyun.com/zh/model-studio/first-api-call-to-qwen Verify that Java and Maven are correctly installed in the environment. ```bash java -version # (可选)如果使用maven管理和构建java项目,还需确保maven已正确安装到您的开发环境中 mvn --version ``` -------------------------------- ### startDialog Source: https://help.aliyun.com/zh/model-studio/android-sdk-for-paraformer-real-time-service Starts the speech recognition process. ```APIDOC ## startDialog ### Method `public synchronized int startDialog(VadMode vad_mode, String dialog_params)` ### Parameters - **vad_mode** (VadMode) - VAD mode, fixed to VadMode.TYPE_P2T. - **dialog_params** (String) - Optional JSON string to update API Key if expired. ``` -------------------------------- ### Configure npm Registry Source: https://help.aliyun.com/zh/model-studio/first-api-call-to-qwen Use this command if the standard installation fails due to network restrictions. ```bash npm config set registry https://registry.npmmirror.com/ ``` -------------------------------- ### SFT-ChatML Format Example Source: https://help.aliyun.com/zh/model-studio/data-processing The standard JSONL structure required for SFT-ChatML training datasets. ```json { "messages": [ { "role": "user", "content": "你经常锻炼身体吗?" }, { "role": "assistant", "content": "经常锻炼身体。" } ] } ``` -------------------------------- ### Initialize SDK Instance Source: https://help.aliyun.com/zh/model-studio/android-sdk-for-paraformer-real-time-service Method signature for initializing the SDK. This call is blocking and should be performed on a non-UI thread. ```java public synchronized int initialize(final INativeNuiCallback callback, String parameters, final Constants.LogLevel level, final boolean save_log) ``` -------------------------------- ### Invoke Qwen API with Node.js Source: https://help.aliyun.com/zh/model-studio/first-api-call-to-qwen Example script to initialize the OpenAI client and send a chat completion request. ```javascript import OpenAI from "openai"; try { const openai = new OpenAI( { // 若没有配置环境变量,请用阿里云百炼API Key将下行替换为: apiKey: "sk-xxx", apiKey: process.env.DASHSCOPE_API_KEY, // 以下为华北2(北京)地域的URL,各地域的URL不同。调用时请将{WorkspaceId}替换为真实的业务空间ID。 baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1" } ); const completion = await openai.chat.completions.create({ model: "qwen-plus", //模型列表: https://help.aliyun.com/model-studio/getting-started/models messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "你是谁?" } ], }); console.log(completion.choices[0].message.content); } catch (error) { console.log(`错误信息:${error}`); console.log("请参考文档:https://help.aliyun.com/model-studio/developer-reference/error-code"); } ``` -------------------------------- ### Data Augmentation Output Example Source: https://help.aliyun.com/zh/model-studio/data-processing Example of an augmented data entry containing a system-generated foreignKey. ```json { "messages": [ { "role": "user", "content": "你喜欢阅读哪种类型的书籍?" }, { "role": "assistant", "content": "我喜欢阅读科幻类和历史类的书籍。" } ], "foreignKey": "8ba0304e2452476d89ed6a60c4xxxxxx" } ``` -------------------------------- ### SDK初始化与连接参数配置 Source: https://help.aliyun.com/zh/model-studio/android-sdk-for-paraformer-real-time-service 通过initialize接口传入JSON格式的连接与控制参数,配置服务地址、API Key及运行模式。 ```APIDOC ## SDK 初始化参数配置 ### Description 初始化SDK时,通过传入JSON字符串配置连接与控制参数。 ### Parameters - **url** (String) - Required - 服务地址,固定为 wss://dashscope.aliyuncs.com/api-ws/v1/inference - **apikey** (String) - Required - API Key - **service_mode** (String) - Required - 运行模式,实时语音识别固定为 "1" - **device_id** (String) - Required - 终端用户唯一标识符 - **debug_path** (String) - Optional - 日志文件存储路径 - **save_wav** (String) - Optional - 是否保存调试音频文件,默认 "false" - **max_log_file_size** (int) - Optional - 日志文件最大字节数,默认 104857600 - **log_track_level** (int) - Optional - 日志过滤级别,默认 2 ### Request Example { "url": "wss://dashscope.aliyuncs.com/api-ws/v1/inference", "apikey": "st-****", "device_id": "my_device_id", "service_mode": "1" } ``` -------------------------------- ### Model Output Example Source: https://help.aliyun.com/zh/model-studio/deep-thinking Example of the console output generated by the deep thinking model, showing the reasoning process followed by the final response. ```text ====================思考过程==================== 好的,用户问“你是谁?”,我需要根据之前的设定来回答。首先,我的角色是千问,阿里巴巴集团旗下的超大规模语言模型。要保持口语化,简洁易懂。 用户可能刚接触我,或者想确认我的身份。应该先直接回答我是谁,然后简要说明我的功能和用途,比如回答问题、创作文字、编程等。还要提到支持多语言,这样用户知道我可以处理不同语言的需求。 另外,根据指导方针,要保持拟人性,所以语气要友好,可能用表情符号增加亲切感。同时,可能需要引导用户进一步提问或使用我的功能,比如问他们需要什么帮助。 需要注意不要使用复杂术语,避免冗长。检查是否有遗漏的关键点,比如多语言支持和具体能力。确保回答符合所有要求,包括口语化和简洁。 ====================完整回复==================== 你好!我是千问,阿里巴巴集团旗下的超大规模语言模型。我能够回答问题、创作文字,比如写故事、写公文、写邮件、写剧本、逻辑推理、编程等,还能表达观点,玩游戏等。我熟练掌握多种语言,包括但不限于中文、英文、德语、法语、西班牙语等。有什么需要我帮忙的吗? ``` -------------------------------- ### Initialize Anthropic Client Source: https://help.aliyun.com/zh/model-studio/anthropic-api-messages Basic setup for the Anthropic Python client with API key and base URL configuration. ```python import anthropic import os client = anthropic.Anthropic( api_key=os.getenv("DASHSCOPE_API_KEY"), base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/apps/anthropic", ) ``` -------------------------------- ### Model Response Output Example Source: https://help.aliyun.com/zh/model-studio/deep-thinking Example of the structured output received when deep thinking is enabled, showing separated reasoning and final answer content. ```text ====================思考过程==================== 嗯,用户问“你是谁?”,我需要先确定他们想知道什么。可能他们第一次接触我,或者想确认我的身份。首先,我应该介绍自己的名字,千问,然后说明我是通义实验室研发的超大规模语言模型。接下来,可能需要解释我的功能,比如回答问题、创作文字、编程等,这样用户能了解我的用途。还要提到我支持多种语言,这样国际用户也能知道他们可以用不同语言交流。最后,保持友好,邀请他们提问,这样能促进进一步的互动。要注意用简洁易懂的语言,避免技术术语太多,让用户容易理解。可能用户有更深层的需求,比如测试我的能力,或者寻找帮助,所以提供具体的例子会更好,比如写故事、写公文、写邮件等。还要确保回答结构清晰,分点说明功能,但可能不需要用项目符号,而是自然过渡。另外,要强调我是AI助手,没有个人意识,所有回答都基于训练数据,这样避免误解。可能需要检查有没有遗漏的重要信息,比如多模态能力,或者最新的更新,但根据之前的回复,可能不需要太深入。总之,回答要全面但简洁,友好且有帮助,让用户感到被理解和支持。 ====================完整回复==================== 我是千问,阿里巴巴集团旗下的通义实验室自主研发的超大规模语言模型。我可以帮助你: 1. **回答问题**:无论是学术问题、常识问题还是专业领域问题,我都可以尝试为你解答。 2. **创作文字**:写故事、写公文、写邮件、写剧本等,我都可以帮你完成。 3. **逻辑推理**:我可以帮助你进行逻辑推理和解决问题。 4. **编程**:我可以理解并生成多种编程语言的代码。 5. **多语言支持**:我支持多种语言,包括但不限于中文、英文、德语、法语、西班牙语等。 如果你有任何问题或需要帮助,随时告诉我! ====================Token 消耗==================== {"input_tokens": 11, "output_tokens": 405, "total_tokens": 416, "output_tokens_details": {"reasoning_tokens": 256}, "prompt_tokens_details": {"cached_tokens": 0}} ``` -------------------------------- ### 检查Node.js环境 Source: https://help.aliyun.com/zh/model-studio/first-api-call-to-qwen 验证Node.js和npm的安装版本。 ```bash node -v npm -v ``` -------------------------------- ### Prepare JSONL Input File for Multimodal Models Source: https://help.aliyun.com/zh/model-studio/batch-interfaces-compatible-with-openai Example content for a JSONL file supporting image URL and Base64 encoded inputs for multimodal models. ```json {"custom_id":"image-url","method":"POST","url":"/v1/chat/completions","body":{"model":"qwen-vl-plus","messages":[{"role":"user","content":[{"type":"image_url","image_url":{"url":"https://dashscope.oss-cn-beijing.aliyuncs.com/images/dog_and_girl.jpeg"}},{"type":"text","text":"请描述这张图片"}]}]}} {"custom_id":"image-base64","method":"POST","url":"/v1/chat/completions","body":{"model":"qwen-vl-plus","messages":[{"role":"user","content":[{"type":"image_url","image_url":{"url":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEA8ADwAAD..."}},{"type":"text","text":"请描述这张图片"}]}]}} ``` -------------------------------- ### GET /api/v1/tasks/{task_id} Source: https://help.aliyun.com/zh/model-studio/first-call-to-image-and-video-api 根据任务 ID 查询生成任务的状态及结果。 ```APIDOC ## GET /api/v1/tasks/{task_id} ### Description 使用 task_id 通过轮询方式查询任务状态,直到任务完成并获取最终的图像或视频 URL。 ### Method GET ### Endpoint https://dashscope.aliyuncs.com/api/v1/tasks/{task_id} ### Parameters #### Path Parameters - **task_id** (string) - Required - 任务唯一标识 ### Response #### Success Response (200) - **results** (array) - 包含生成结果的数组,包含 url #### Response Example { "results": [ { "orig_prompt": "一间有着精致窗户的花店,漂亮的木质门,摆放着花朵", "actual_prompt": "...", "url": "https://dashscope-result-wlcb.oss-cn-wulanchabu.aliyuncs.com/..." } ] } ``` -------------------------------- ### Error Response Example Source: https://help.aliyun.com/zh/model-studio/compatibility-of-openai-with-dashscope The structure of an error response when a request fails. ```json { "error": { "message": "Incorrect API key provided. ", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" } } ``` -------------------------------- ### Streaming Response Example Source: https://help.aliyun.com/zh/model-studio/compatibility-of-openai-with-dashscope The format of the server-sent events during a streaming request. ```text data: {"choices":[{"delta":{"content":"","role":"assistant"},"index":0,"logprobs":null,"finish_reason":null}],"object":"chat.completion.chunk","usage":null,"created":1715931028,"system_fingerprint":null,"model":"qwen-plus","id":"chatcmpl-3bb05cf5cd819fbca5f0b8d67a025022"} data: {"choices":[{"finish_reason":null,"delta":{"content":"我是"},"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1715931028,"system_fingerprint":null,"model":"qwen-plus","id":"chatcmpl-3bb05cf5cd819fbca5f0b8d67a025022"} data: {"choices":[{"delta":{"content":"来自"},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1715931028,"system_fingerprint":null,"model":"qwen-plus","id":"chatcmpl-3bb05cf5cd819fbca5f0b8d67a025022"} data: {"choices":[{"delta":{"content":"阿里"},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1715931028,"system_fingerprint":null,"model":"qwen-plus","id":"chatcmpl-3bb05cf5cd819fbca5f0b8d67a025022"} data: {"choices":[{"delta":{"content":"云的大规模语言模型"},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1715931028,"system_fingerprint":null,"model":"qwen-plus","id":"chatcmpl-3bb05cf5cd819fbca5f0b8d67a025022"} data: {"choices":[{"delta":{"content":",我叫千问。"},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1715931028,"system_fingerprint":null,"model":"qwen-plus","id":"chatcmpl-3bb05cf5cd819fbca5f0b8d67a025022"} data: {"choices":[{"delta":{"content":""},"finish_reason":"stop","index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1715931028,"system_fingerprint":null,"model":"qwen-plus","id":"chatcmpl-3bb05cf5cd819fbca5f0b8d67a025022"} data: [DONE] ``` -------------------------------- ### Generate Music with Lyrics in Java Source: https://help.aliyun.com/zh/model-studio/fun-music Demonstrates how to send a POST request to the music generation endpoint with lyrics and gender parameters. ```java import java.io.*; import java.net.HttpURLConnection; import java.net.URL; public class FunMusicLyricsDemo { public static void main(String[] args) throws Exception { String apiKey = System.getenv("DASHSCOPE_API_KEY"); String endpoint = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/music/generation"; HttpURLConnection conn = (HttpURLConnection) new URL(endpoint).openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Authorization", "Bearer " + apiKey); conn.setRequestProperty("Content-Type", "application/json"); conn.setDoOutput(true); String lyrics = "[verse]\n清晨的阳光穿过窗帘,\n" + "咖啡的香气弥漫房间.\n" + "翻开昨天未读完的书,\n" + "时光就这样悄悄流转.\n\n" + "[chorus]\n慢慢来不着急,\n" + "生活本该如此惬意.\n" + "把烦恼都丢进风里,\n" + "拥抱每一个晴天雨季."; String jsonBody = "{\"model\":\"fun-music-v1\"," + "\"input\":{\"lyrics\":\"" + lyrics + "\"," + "\"gender\":\"female\"}}"; try (OutputStream os = conn.getOutputStream()) { os.write(jsonBody.getBytes("UTF-8")); } try (BufferedReader reader = new BufferedReader( new InputStreamReader(conn.getInputStream(), "UTF-8"))) { StringBuilder sb = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { sb.append(line); } System.out.println(sb.toString()); } } } ``` -------------------------------- ### Get SDK Version Source: https://help.aliyun.com/zh/model-studio/android-sdk-for-paraformer-real-time-service Retrieves the current version information of the SDK. ```java public synchronized String GetVersion(); ``` -------------------------------- ### Prepare JSONL Input File for Test Model Source: https://help.aliyun.com/zh/model-studio/batch-interfaces-compatible-with-openai Example content for a JSONL file using the batch-test-model for validation. ```json {"custom_id":"1","method":"POST","url":"/v1/chat/ds-test","body":{"model":"batch-test-model","messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"你好!有什么可以帮助你的吗?"}]}} {"custom_id":"2","method":"POST","url":"/v1/chat/ds-test","body":{"model":"batch-test-model","messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"What is 2+2?"}]}} ``` -------------------------------- ### 调用深度思考模型(DashScope 接口) Source: https://help.aliyun.com/zh/model-studio/deep-thinking 使用 DashScope SDK 调用模型,直接设置 enable_thinking 参数。推荐使用流式调用以实时查看思考过程。 ```python # 导入依赖... response = Generation.call( # 若没有配置环境变量,请用阿里云百炼API Key将下行替换为:api_key = "sk-xxx", api_key=os.getenv("DASHSCOPE_API_KEY"), # 可按需更换为其它深度思考模型 model="qwen-plus", messages=messages, result_format="message", enable_thinking=True, stream=True, incremental_output=True ) ``` -------------------------------- ### 查询任务结果 Source: https://help.aliyun.com/zh/model-studio/first-call-to-image-and-video-api 使用 GET 请求根据 task_id 查询任务状态。建议每隔 3-5 秒轮询一次,直到任务状态不再为 RUNNING。 ```bash curl -X GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id} \ --header "Authorization: Bearer $DASHSCOPE_API_KEY" ``` ```json curl -X GET https://dashscope.aliyuncs.com/api/v1/tasks/2de3f7e1-52ce-4cf4-a466-f2d3f8061c43 \ --header "Authorization: Bearer $DASHSCOPE_API_KEY" {"request_id":"24143559-9964-4898-8f9c-d968bba182b9","output":{"task_id":"2de3f7e1-52ce-4cf4-a466-f2d3f8061c43","task_status":"SUCCEEDED","submit_time":"2025-12-03 10:19:18.293","scheduled_time":"2025-12-03 10:19:18.320","end_time":"2025-12-03 10:19:31.890","results":[{"orig_prompt":"一间有着精致窗户的花店,漂亮的木质门,摆放着花朵","actual_prompt":"一间温馨雅致的花店,外墙装饰着精致的雕花窗户,窗框为深褐色木质结构,玻璃洁净透亮,透出店内柔和的光线。花店正门是一扇漂亮的实木门,表面保留天然木纹,配以黄铜门把手和复古门牌,散发出浓厚的手工艺气息。门前台阶两侧和店内窗台、门口区域错落有致地摆放着各式鲜花——有盛开的玫瑰、淡雅的绣球、清新的雏菊和翠绿的尤加利叶,色彩丰富而和谐。背景为宁静的欧洲小镇街景,石板路与爬满藤蔓的邻墙烘托出浪漫氛围。整体画面采用写实摄影风格,光线柔和自然,突出木质纹理与花卉细节。","url":"https://dashscope-result-wlcb.oss-cn-wulanchabu.aliyuncs.com/1d/59/20251203/7a2bee47/2de3f7e1-52ce-4cf4-a466-f2d3f8061c43.png?Expires=1764814771&OSSAccessKeyId=xxx"}],"task_metrics":{"TOTAL":1,"FAILED":0,"SUCCEEDED":1}},"usage":{"image_count":1}} ``` -------------------------------- ### Tool Use with Anthropic API Source: https://help.aliyun.com/zh/model-studio/anthropic-api-messages Examples for defining and using tools with the Anthropic API. ```python import anthropic import os client = anthropic.Anthropic( api_key=os.getenv("DASHSCOPE_API_KEY"), base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/apps/anthropic", ) tools = [ { "name": "get_weather", "description": "获取指定城市的天气信息", "input_schema": { "type": "object", "properties": { "city": { "type": "string", "description": "城市名称" } }, "required": ["city"] } } ] message = client.messages.create( model="qwen3.7-plus", max_tokens=1024, tools=tools, messages=[ { "role": "user", "content": "杭州今天天气怎么样?" } ] ) print(message.content) ``` ```typescript import Anthropic from "@anthropic-ai/sdk"; async function main() { const anthropic = new Anthropic({ apiKey: process.env.DASHSCOPE_API_KEY, baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/apps/anthropic", }); const message = await anthropic.messages.create({ model: "qwen3.7-plus", max_tokens: 1024, tools: [ { name: "get_weather", description: "获取指定城市的天气信息", input_schema: { type: "object", properties: { city: { type: "string", description: "城市名称" } }, required: ["city"], }, }, ], messages: [{ role: "user", content: "杭州今天天气怎么样?" }], }); console.log(JSON.stringify(message.content, null, 2)); } ``` -------------------------------- ### Chat Completion Response Example Source: https://help.aliyun.com/zh/model-studio/compatibility-of-openai-with-dashscope The standard JSON response structure returned by the API. ```json { "choices": [ { "message": { "role": "assistant", "content": "我是来自阿里云的大规模语言模型,我叫千问。" }, "finish_reason": "stop", "index": 0, "logprobs": null } ], "object": "chat.completion", "usage": { "prompt_tokens": 11, "completion_tokens": 16, "total_tokens": 27 }, "created": 1715252778, "system_fingerprint": "", "model": "qwen-plus", "id": "chatcmpl-xxx" } ``` -------------------------------- ### initialize Source: https://help.aliyun.com/zh/model-studio/android-sdk-for-paraformer-real-time-service Initializes the speech recognition SDK instance. This method is blocking and should be called on a non-UI thread. ```APIDOC ## initialize ### Method `public synchronized int initialize(final INativeNuiCallback callback, String parameters, final Constants.LogLevel level, final boolean save_log)` ### Parameters - **callback** (INativeNuiCallback) - Implementation of the event and data callback interface. - **parameters** (String) - JSON string containing authentication, connection, and debugging parameters. - **level** (Constants.LogLevel) - Log level for the SDK. - **save_log** (boolean) - Whether to save local logs. ``` -------------------------------- ### 使用OpenAI SDK调用模型 Source: https://help.aliyun.com/zh/model-studio/first-api-call-to-qwen 通过OpenAI兼容接口调用Qwen模型。 ```python import os from openai import OpenAI try: client = OpenAI( # 若没有配置环境变量,请用阿里云百炼API Key将下行替换为: api_key="sk-xxx", api_key=os.getenv("DASHSCOPE_API_KEY"), # 以下为华北2(北京)地域的URL,各地域的URL不同。调用时请将{WorkspaceId}替换为真实的业务空间ID。 base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1", ) completion = client.chat.completions.create( model="qwen-plus", # 模型列表: https://help.aliyun.com/model-studio/getting-started/models messages=[ {'role': 'system', 'content': 'You are a helpful assistant.'}, {'role': 'user', 'content': '你是谁?'} ] ) print(completion.choices[0].message.content) except Exception as e: print(f"错误信息:{e}") print("请参考文档:https://help.aliyun.com/model-studio/developer-reference/error-code") ``` -------------------------------- ### Prompt Configuration Template Source: https://help.aliyun.com/zh/model-studio/data-processing Template structure for defining LLM training tasks including Question, Context, and Answer fields. ```text 一个完整的大语言模型的训练示例可以定义为以下的结构: Question: 描述期待大语言模型要做的任务。 Context: 描述期待大语言模型要分析的内容。 Answer: 期待大语言模型输出的正确结果。 给定的Question: ${Question} 给定的<Context, Answer>数据对: Context: ${Context} Answer: ${Answer} 【注意事项】 1. 为了保证你编写的答案的准确性,你需要先根据你对给定Question和Answer的理解来构造一个新的Answer。 2. 你编写的新Answer要和给定的Question匹配。 3. 你编写的新Answer格式要和给定的Answer匹配。 4. 根据你编写的Answer来构造蕴含这个Answer的Context。 5. 你编写的Context长度要和示例Context长度相当。 6. 把你编写的Answer和Context组合在一个JSON中,具体格式为${Format_Constraint} 请首先分析给定的<Question>和<Context, Answer>数据的特点,然后构造新的<Answer, Context>,满足【注意事项】中的所有要求,你可以参考这个执行步骤: 1. 首先分析给定的<Question>和<Context, Answer>数据的特点。 2. 理解【注意事项】中的每一条内容。 3. 构造新的Answer和Context,按照指定格式输出。 按照参考步骤,一步一步地执行给定的任务。 ``` -------------------------------- ### Set Recognition Parameters Source: https://help.aliyun.com/zh/model-studio/android-sdk-for-paraformer-real-time-service Method signature for setting recognition parameters before starting the dialog. ```java public synchronized int setParams(String params) ``` -------------------------------- ### GET /compatible-mode/v1/batches Source: https://help.aliyun.com/zh/model-studio/batch-interfaces-compatible-with-openai Retrieves a list of Batch tasks with optional filtering and pagination parameters. ```APIDOC ## GET /compatible-mode/v1/batches ### Description Retrieves a list of Batch tasks. Supports filtering by status, file IDs, name, and creation time, as well as pagination. ### Method GET ### Endpoint /compatible-mode/v1/batches ### Parameters #### Query Parameters - **after** (String) - Optional - Cursor for pagination, the ID of the last task from the previous page. - **limit** (Integer) - Optional - Number of tasks to return per page, range [1, 100], default 20. - **ds_name** (String) - Optional - Fuzzy match by task name. - **input_file_ids** (String) - Optional - Filter by file IDs, comma-separated, max 20. - **status** (String) - Optional - Filter by task status, comma-separated. - **create_after** (String) - Optional - Filter tasks created after this time, format: yyyyMMddHHmmss. - **create_before** (String) - Optional - Filter tasks created before this time, format: yyyyMMddHHmmss. ### Response #### Success Response (200) - **object** (String) - Type, fixed value 'list'. - **data** (Array) - List of Batch task objects. - **first_id** (String) - ID of the first task on the current page. - **last_id** (String) - ID of the last task on the current page. - **has_more** (Boolean) - Whether there is a next page. ``` -------------------------------- ### OpenCode 运行命令 Source: https://help.aliyun.com/zh/model-studio/explicit-cache-guide 设置API Key并启动OpenCode。 ```bash export DASHSCOPE_API_KEY=sk-xxxxx opencode run -m "bailian/qwen3.7-max" "..." ```