Pass custom parameters, primarily to custom plugins and custom nodes, when calling Alibaba Cloud Model Studio's Agent Application and Workflow Application (which replace agent orchestration applications).
You must first obtain and configure an API key and configure the API key as an environment variable. If you call through an SDK, you must also install the DashScope SDK.
The following example shows how to pass custom plugin parameters in an Agent Application.
The following example shows how to pass the custom parameters of the start node in a Workflow Application.
Custom plugin parameter pass-through
This article uses the dormitory convention content query tool as an example to show you how to call the custom plugin parameter pass-through feature of an application through an API.Parameters for custom plugins are passed through an associated Agent Application or a plugin node in a Workflow Application.
Usage
Step 1: Create a custom plugin tool
If you have already created a plugin tool or imported a plugin, skip this step.
-
Create Custom Plug-in: In the left-side navigation pane, select Tool > Plug-in Management to go to the Plug-in Management page. Click Create Plug-in and fill in the plug-in information. If authentication is required, turn on the Enable Authentication switch and fill in the authentication configuration information.
Example plugin description: Dormitory convention query tool, which can query a specific entry based on the entered numeric index.
Example plugin URL: https://domitorgreement-plugin-example-icohrkdjxy.cn-beijing.fcapp.run
Example authentication configuration: select User-level Authentication as the authentication type, Header as the location, and basic as Type. Note: The plugin description briefly explains the purpose of the plugin. It helps the large model determine whether the current task requires calling the current plugin. Describe it in natural language. -
Create a tool: Fill in the tool information and configure the input and output parameters. Note:
- The tool description helps the large model better understand the tool's functions and use cases. Describe it in natural language and provide usage examples where possible.
- A parameter name should be as meaningful as possible to help the large model understand what the parameter information to be identified is.
- A parameter description describes the function of the input parameter. Keep it concise and accurate to help the large model further understand how to obtain the parameter.
- You must select Business Pass-through as the passing method of the input parameter.
article_indexis set as a business pass-through parameter. EnterDormitory convention query toolas the tool name, select POST as the request method, and select application/json as the submission method. Set the type of the input parameterarticle_indexto Number, the passing method to Body, and make it required. Enterarticleas the output parameter name, "Dormitory convention content" as the parameter description, and set the type to String. - Click Test Tool. After the test runs successfully, publish the plugin.
Step 2: Associate the agent application with the specified plugin
Plugin tools can only be associated with Agent Applications in the same workspace.
- On the card of a published plugin, click Add to Agent and select the agent application to associate;
- Alternatively, click + Plugin in an application to associate the specified custom plugin;
- Then, publish the application directly.
Step 3: API call
-
When authentication is not required: To call a custom plugin through an API, use
user_defined_paramsofbiz_paramsto pass the custom plugin information, replaceyour_plugin_codewith the actual plugin ID, and pass the key-value pairs of the input parameters configured in the plugin.The plugin ID can be obtained from the plugin card.
In this example, the value 2 is passed to the dormitory convention indexarticle_indexparameter to query the content of the second dormitory convention, and the correct result is returned.- Python
- Java
- HTTP
Sample requestSample responseCopyimport os import dashscope # 需要 dashscope 2.0.1 及以上版本 from dashscope import DashScopeError client = dashscope.Client( # 若没有配置环境变量,可用百炼API Key将下行替换为:api_key="sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 api_key=os.getenv("DASHSCOPE_API_KEY")) biz_params = { # 智能体应用的自定义插件输入参数传递,自定义的插件ID替换your_plugin_code "user_defined_params": { "your_plugin_code": { "article_index": 2}}} try: response = client.apps.completions.create( app_id='YOUR_APP_ID', prompt='寝室公约内容', biz_params=biz_params) print('%s\n' % (response.text)) # 处理只输出文本text # print('%s\n' % (response.usage)) except DashScopeError as e: print(f'request_id={e.request_id}') print(f'code={e.code}') print(f'message={e.message}') print(f'请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code')Copy寝室公约的第二条规定如下: "寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。" 这表明在寝室内,成员之间应该培养一种积极正面的生活和学习氛围,彼此帮助和支持,同时也要学会理解和尊重他人。如果您需要了解公约的其他条款,请告诉我!Sample requestSample responseCopyimport com.alibaba.dashscope.app.*; import com.alibaba.dashscope.exception.ApiException; import com.alibaba.dashscope.exception.InputRequiredException; import com.alibaba.dashscope.exception.NoApiKeyException; import com.alibaba.dashscope.utils.JsonUtils; public class Main { public static void appCall() throws NoApiKeyException, InputRequiredException { String bizParams = // 智能体应用的自定义插件输入参数传递,自定义的插件ID替换{your_plugin_code} "{\"user_defined_params\":{\"{your_plugin_code}\":{\"article_index\":2}}}"; ApplicationParam param = ApplicationParam.builder() // 若没有配置环境变量,可用百炼API Key将下行替换为:.apiKey("sk-xxx")。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 .apiKey(System.getenv("DASHSCOPE_API_KEY")) .appId("YOUR_APP_ID") .prompt("寝室公约内容") .bizParams(JsonUtils.parse(bizParams)) .build(); Application application = new Application(); ApplicationResult result = application.call(param); System.out.printf("%s\n", result.getOutput().getText()); } public static void main(String[] args) { try { appCall(); } catch (ApiException | NoApiKeyException | InputRequiredException e) { System.out.printf("Exception: %s", e.getMessage()); System.out.println("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code"); } System.exit(0); } }Copy寝室公约的第二条规定如下: 第二条 寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。 这强调了在共同生活环境中,室友之间应该保持积极正面的关系,通过相互帮助和支持来营造一个和谐的生活和学习氛围。如果有更多具体的条款需要了解,请告知我。- curl
- PHP
- Node.js
- C#
- Go
Sample requestCopycurl -X POST https://dashscope.aliyuncs.com/api/v1/apps/YOUR_APP_ID/completion \ --header "Authorization: Bearer $DASHSCOPE_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "input": { "prompt": "寝室公约内容", "biz_params": { "user_defined_params": { "{your_plugin_code}": { "article_index": 2 } } } }, "parameters": {}, "debug":{} }'Replace YOUR_APP_ID with the actual application ID.
Sample responseCopy{"output": {"finish_reason":"stop", "session_id":"e151267ffded4fbdb13d91439011d31e", "text":"寝室公约的第二条内容是:“寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。”这意呀着在寝室生活中,大家要彼此支持,共同创造一个和谐、积极向上的生活环境。"}, "usage":{"models":[{"output_tokens":94,"model_id":"qwen-max","input_tokens":453}]}, "request_id":"a39fd2b5-7e2c-983e-84a1-1039f726f18a"}%Sample requestSample responseCopy<?php # 若没有配置环境变量,可用百炼API Key将下行替换为:$api_key="sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 $api_key = getenv("DASHSCOPE_API_KEY"); $application_id = 'YOUR_APP_ID'; // 替换为实际的应用 ID $url = "https://dashscope.aliyuncs.com/api/v1/apps/$application_id/completion"; //{your_plugin_code}替换为实际的插件ID // 构造请求数据 $data = [ "input" => [ 'prompt' => '寝室公约内容', 'biz_params' => [ 'user_defined_params' => [ '{your_plugin_code}' => [ 'article_index' => 2 ] ] ] ], ]; // 将数据编码为 JSON $dataString = json_encode($data); // 检查 json_encode 是否成功 if (json_last_error() !== JSON_ERROR_NONE) { die("JSON encoding failed with error: " . json_last_error_msg()); } // 初始化 cURL 对话 $ch = curl_init($url); // 设置 cURL 选项 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Authorization: Bearer ' . $api_key ]); // 执行请求 $response = curl_exec($ch); // 检查 cURL 执行是否成功 if ($response === false) { die("cURL Error: " . curl_error($ch)); } // 获取 HTTP 状态码 $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); // 关闭 cURL 对话 curl_close($ch); // 解码响应数据 $response_data = json_decode($response, true); // 处理响应 if ($status_code == 200) { if (isset($response_data['output']['text'])) { echo "{$response_data['output']['text']}\n"; } else { echo "No text in response.\n"; } }else { if (isset($response_data['request_id'])) { echo "request_id={$response_data['request_id']}\n";} echo "code={$status_code}\n"; if (isset($response_data['message'])) { echo "message={$response_data['message']}\n";} else { echo "message=Unknown error\n";} } ?>Copy寝室公约的第二条规定:寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。这是为了保证大家能在一个和谐友爱的环境中生活和学习。如果有更多具体的条款需要了解,或者有其他问题,随时可以问我!Dependencies to install:Sample requestCopynpm install axiosSample responseCopyconst axios = require('axios'); async function callDashScope() { // 若没有配置环境变量,可用百炼API Key将下行替换为:apiKey='sk-xxx'。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 const apiKey = process.env.DASHSCOPE_API_KEY; const appId = 'YOUR_APP_ID';// 替换为实际的应用 ID const pluginCode = 'YOUR_PLUGIN_CODE';// 替换为实际的插件ID const url = `https://dashscope.aliyuncs.com/api/v1/apps/${appId}/completion`; const data = { input: { prompt: "寝室公约内容", biz_params: { user_defined_params: { [pluginCode]: { // article_index为自定义插件的变量,替换为实际的插件变量 'article_index': 3 } } } }, parameters: {}, debug: {} }; try { console.log("Sending request to DashScope API..."); const response = await axios.post(url, data, { headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' } }); if (response.status === 200) { if (response.data.output && response.data.output.text) { console.log(`${response.data.output.text}`); } } else { console.log("Request failed:"); if (response.data.request_id) { console.log(`request_id=${response.data.request_id}`); } console.log(`code=${response.status}`); if (response.data.message) { console.log(`message=${response.data.message}`); } else { console.log('message=Unknown error'); } } } catch (error) { console.error(`Error calling DashScope: ${error.message}`); if (error.response) { console.error(`Response status: ${error.response.status}`); console.error(`Response data: ${JSON.stringify(error.response.data, null, 2)}`); } } } callDashScope();Copy寝室公约的第三条规定如下: 注意安全用电,杜绝火灾隐患。寝室内严禁使用明火、违规电器、各种灶具以及其他违规物品,不得存放易爆、易燃物品,私接电源。 如果您需要了解更多的规定,请告诉我。Sample requestSample responseCopyusing System.Text; class Program { static async Task Main(string[] args) { // 若没有配置环境变量,可用百炼API Key将下行替换为:apiKey="sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 string apiKey = Environment.GetEnvironmentVariable("DASHSCOPE_API_KEY")?? throw new InvalidOperationException("DASHSCOPE_API_KEY environment variable is not set.");; string appId = "YOUR_APP_ID";// 替换为实际的应用ID if (string.IsNullOrEmpty(apiKey)) { Console.WriteLine("请确保设置了 DASHSCOPE_API_KEY。"); return; } string url = $"https://dashscope.aliyuncs.com/api/v1/apps/{appId}/completion"; using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}"); string pluginCode = "{your_plugin_code}"; // {your_plugin_code}替换为实际的插件 ID string jsonContent = $@"{{ ""input"": {{ ""prompt"": ""寝室公约内容"", ""biz_params"": {{ ""user_defined_params"": {{ ""{pluginCode}"": {{ ""article_index"": 2 }} }} }} }}, ""parameters"": {{}}, ""debug"": {{}} }}"; HttpContent content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); try { HttpResponseMessage response = await client.PostAsync(url, content); if (response.IsSuccessStatusCode) { string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine("Request successful:"); Console.WriteLine(responseBody); } else { Console.WriteLine($"Request failed with status code: {response.StatusCode}"); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } } catch (Exception ex) { Console.WriteLine($"Error calling DashScope: {ex.Message}"); } } } }Copy{ "output": { "finish_reason": "stop", "session_id": "237ca6187c814f3b9e7461090a5f8b74", "text": "寝室公约的第二条规定如下: "寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。" 这表示在寝室内,成员之间需要建立起一种积极正面的关系,通过帮助、关心和支持彼此来营造一个和谐的生活和学习环境。同时也要学会理解和接受室友之间的差异,以真诚的态度去交流沟通。如果还有其他条款或具体内容想要了解,请告诉我!" }, "usage": { "models": [ { "output_tokens": 133, "model_id": "qwen-max", "input_tokens": 829 } ] }, "request_id": "64e8c359-d071-9d2e-bb94-187e86cc3a79" }Sample requestSample responseCopypackage main import ( "bytes" "encoding/json" "fmt" "io" "net/http" "os" ) func main() { // 若没有配置环境变量,可用百炼API Key将下行替换为:apiKey := "sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 apiKey := os.Getenv("DASHSCOPE_API_KEY") appId := "YOUR_APP_ID" // 替换为实际的应用 ID pluginCode := "YOUR_PLUGIN_CODE" // 替换为实际的插件 ID if apiKey == "" { fmt.Println("请确保设置了DASHSCOPE_API_KEY。") return } url := fmt.Sprintf("https://dashscope.aliyuncs.com/api/v1/apps/%s/completion", appId) // 创建请求体 requestBody := map[string]interface{}{ "input": map[string]interface{}{ "prompt": "寝室公约内容", "biz_params": map[string]interface{}{ "user_defined_params": map[string]interface{}{ pluginCode: map[string]interface{}{ "article_index": 2, }, }, }, }, "parameters": map[string]interface{}{}, "debug": map[string]interface{}{}, } jsonData, err := json.Marshal(requestBody) if err != nil { fmt.Printf("Failed to marshal JSON: %v\n", err) return } // 创建 HTTP POST 请求 req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) if err != nil { fmt.Printf("Failed to create request: %v\n", err) return } // 设置请求头 req.Header.Set("Authorization", "Bearer "+apiKey) req.Header.Set("Content-Type", "application/json") // 发送请求 client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Printf("Failed to send request: %v\n", err) return } defer resp.Body.Close() // 读取响应 body, err := io.ReadAll(resp.Body) if err != nil { fmt.Printf("Failed to read response: %v\n", err) return } // 处理响应 if resp.StatusCode == http.StatusOK { fmt.Println("Request successful:") fmt.Println(string(body)) } else { fmt.Printf("Request failed with status code: %d\n", resp.StatusCode) fmt.Println(string(body)) } }Copy{ "output": { "finish_reason": "stop", "session_id": "860d2a4c1f3649ac880298537993cb51", "text": "寝室公约的第二条规定如下: 寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。 这强调了在宿舍生活中,室友之间应该保持良好的互助关系,同时也要互相尊重对方。您想要了解其他条款的内容吗?" }, "usage": { "models": [ { "output_tokens": 84, "model_id": "qwen-max", "input_tokens": 876 } ] }, "request_id": "0a250055-90a4-992d-9276-e268ad35d1ab" } -
When authentication is required: To call a custom plugin through an API, the Authentication switch is turned on in the plugin and User-level Authentication is configured.
The plugin ID is obtained from the plugin card.
- Use
user_defined_paramsofbiz_paramsto pass the custom plugin information, replaceyour_plugin_codewith the actual plugin ID, and pass the key-value pairs of the input parameters configured in the plugin. - Use
user_defined_tokensofbiz_paramsto pass the related information, replaceyour_plugin_codewith the actual plugin ID, and fill in the authentication information as the value ofuser_token, such as the actual DASHSCOPE_API_KEY value. - After the authentication succeeds, the specific entry is queried based on the passed index parameter and the correct result is returned.
article_indexparameter, and the value ofuser_token,YOUR_TOKEN, is replaced with the actual DASHSCOPE_API_KEY value. After the authentication succeeds, the content of the second dormitory convention is queried, and the correct result is returned.- Python
- Java
- HTTP
Sample requestSample responseCopyimport os import dashscope # 需要 dashscope 2.0.1 及以上版本 from dashscope import DashScopeError client = dashscope.Client( # 若没有配置环境变量,可用百炼API Key将下行替换为:api_key="sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 api_key=os.getenv("DASHSCOPE_API_KEY")) biz_params = { # 智能体应用的自定义插件鉴权传递,自定义的插件ID替换your_plugin_code,鉴权信息替换YOUR_TOKEN,如API key "user_defined_params": { "your_plugin_code": { "article_index": 2}}, "user_defined_tokens": { "your_plugin_code": { "user_token": "YOUR_TOKEN"}}} try: response = client.apps.completions.create( app_id='YOUR_APP_ID', prompt='寝室公约内容', biz_params=biz_params) print('%s\n' % (response.text)) # 处理只输出文本text # print('%s\n' % (response.usage)) except DashScopeError as e: print(f'request_id={e.request_id}') print(f'code={e.code}') print(f'message={e.message}') print(f'请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code')Copy寝室公约的第二条规定如下: 寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。 如果您需要了解更多的规定内容,请告诉我。Sample requestSample responseCopyimport com.alibaba.dashscope.app.*; import com.alibaba.dashscope.exception.ApiException; import com.alibaba.dashscope.exception.InputRequiredException; import com.alibaba.dashscope.exception.NoApiKeyException; import com.alibaba.dashscope.utils.JsonUtils; public class Main { public static void appCall() throws NoApiKeyException, InputRequiredException { String bizParams = // {your_plugin_code}替换为实际的插件ID,YOUR_TOKEN替换为实际的Token,如API key "{\"user_defined_params\":{\"{your_plugin_code}\":{\"article_index\":2}}," + "\"user_defined_tokens\":{\"{your_plugin_code}\":{\"user_token\":\"YOUR_TOKEN\"}}}"; ApplicationParam param = ApplicationParam.builder() // 若没有配置环境变量,可用百炼API Key将下行替换为:.apiKey("sk-xxx")。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 .apiKey(System.getenv("DASHSCOPE_API_KEY")) .appId("YOUR_APP_ID") .prompt("寝室公约内容") .bizParams(JsonUtils.parse(bizParams)) .build(); Application application = new Application(); ApplicationResult result = application.call(param); System.out.printf("%s\n", result.getOutput().getText()); } public static void main(String[] args) { try { appCall(); } catch (ApiException | NoApiKeyException | InputRequiredException e) { System.out.printf("Exception: %s", e.getMessage()); System.out.println("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code"); } System.exit(0); } }Copy寝室公约的第二条规定如下: 寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。 如果您需要查询更多的规定内容,请告诉我。Replace YOUR_APP_ID with the application ID, your_plugin_code with the custom plugin ID, and YOUR_TOKEN with the authentication token.
- curl
- PHP
- Node.js
- C#
- Go
Sample requestCopycurl -X POST https://dashscope.aliyuncs.com/api/v1/apps/YOUR_APP_ID/completion \ --header "Authorization: Bearer $DASHSCOPE_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "input": { "prompt": "寝室公约内容", "biz_params": { "user_defined_params": { "{your_plugin_code}": { "article_index": 2 } }, "user_defined_tokens": { "{your_plugin_code}": { "user_token": "YOUR_TOKEN" } } } }, "parameters": {}, "debug":{} }'Replace YOUR_APP_ID with the actual application ID, your_plugin_code with the custom plugin ID, and YOUR_TOKEN with the authentication token.
Sample responseCopy{"output":{"finish_reason":"stop", "session_id":"d3b5c3e269dc40479255a7a02df5c630", "text":"寝室公约的第二条内容为:“寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。”这强调了寝室生活中成员之间和谐相处与共同进步的重要性。"}, "usage":{"models":[{"output_tokens":80,"model_id":"qwen-max","input_tokens":432}]}, "request_id":"1f77154c-edc3-9003-b622-816fa2f849cf"}%Sample requestSample responseCopy<?php # 若没有配置环境变量,可用百炼API Key将下行替换为:$api_key="sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 $api_key = getenv("DASHSCOPE_API_KEY"); $application_id = 'YOUR_APP_ID'; // 替换为实际的应用 ID $url = "https://dashscope.aliyuncs.com/api/v1/apps/$application_id/completion"; // 构造请求数据 $data = [ "input" => [ 'prompt' => '寝室公约内容', 'biz_params' => [ 'user_defined_params' => [ '{your_plugin_code}' => [//{your_plugin_code}替换为实际的插件ID 'article_index' => 2 ] ], 'user_defined_tokens' => [ '{your_plugin_code}' => [//{your_plugin_code}替换为实际的插件ID 'user_token' => 'YOUR_TOKEN'//替换为实际的Token,如API key ] ] ] ], ]; // 将数据编码为 JSON $dataString = json_encode($data); // 检查 json_encode 是否成功 if (json_last_error() !== JSON_ERROR_NONE) { die("JSON encoding failed with error: " . json_last_error_msg()); } // 初始化 cURL 对话 $ch = curl_init($url); // 设置 cURL 选项 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Authorization: Bearer ' . $api_key ]); // 执行请求 $response = curl_exec($ch); // 检查 cURL 执行是否成功 if ($response === false) { die("cURL Error: " . curl_error($ch)); } // 获取 HTTP 状态码 $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); // 关闭 cURL 对话 curl_close($ch); // 解码响应数据 $response_data = json_decode($response, true); // 处理响应 if ($status_code == 200) { if (isset($response_data['output']['text'])) { echo "{$response_data['output']['text']}\n"; } else { echo "No text in response.\n"; } }else { if (isset($response_data['request_id'])) { echo "request_id={$response_data['request_id']}\n";} echo "code={$status_code}\n"; if (isset($response_data['message'])) { echo "message={$response_data['message']}\n";} else { echo "message=Unknown error\n";} } ?>Copy寝室公约的第二条规定如下: > 寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。 如果需要了解更多的公约内容或其他信息,请随时告诉我!Dependencies to install:Sample requestCopynpm install axiosSample responseCopyconst axios = require('axios'); async function callDashScope() { // 若没有配置环境变量,可用百炼API Key将下行替换为:apiKey='sk-xxx'。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 const apiKey = process.env.DASHSCOPE_API_KEY; const appId = 'YOUR_APP_ID';// 替换为实际的应用 ID const pluginCode = 'YOUR_PLUGIN_CODE';// 替换为实际的插件ID const url = `https://dashscope.aliyuncs.com/api/v1/apps/${appId}/completion`; const data = { input: { prompt: "寝室公约内容", biz_params: { user_defined_params: { [pluginCode]: { // article_index为自定义插件的变量,替换为实际的插件变量 'article_index': 6 } }, user_defined_tokens: { [pluginCode]: { // YOUR_TOKEN替换为实际的鉴权信息,如API key user_token: 'YOUR_TOKEN' } } } }, parameters: {}, debug: {} }; try { console.log("Sending request to DashScope API..."); const response = await axios.post(url, data, { headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' } }); if (response.status === 200) { if (response.data.output && response.data.output.text) { console.log(`${response.data.output.text}`); } } else { console.log("Request failed:"); if (response.data.request_id) { console.log(`request_id=${response.data.request_id}`); } console.log(`code=${response.status}`); if (response.data.message) { console.log(`message=${response.data.message}`); } else { console.log('message=Unknown error'); } } } catch (error) { console.error(`Error calling DashScope: ${error.message}`); if (error.response) { console.error(`Response status: ${error.response.status}`); console.error(`Response data: ${JSON.stringify(error.response.data, null, 2)}`); } } } callDashScope();Copy寝室公约的第六条规定:养成良好的作息习惯,每一位寝室成员都享有休息的权利和承担保证他人休息权利和义务。如果你需要了解更多的规定内容,请进一步说明。Sample requestSample responseCopyusing System.Text; class Program { static async Task Main(string[] args) { // 若没有配置环境变量,可用百炼API Key将下行替换为:apiKey="sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 string apiKey = Environment.GetEnvironmentVariable("DASHSCOPE_API_KEY")?? throw new InvalidOperationException("DASHSCOPE_API_KEY environment variable is not set.");; string appId = "YOUR_APP_ID";// 替换为实际的应用ID if (string.IsNullOrEmpty(apiKey)) { Console.WriteLine("请确保设置了 DASHSCOPE_API_KEY。"); return; } string url = $"https://dashscope.aliyuncs.com/api/v1/apps/{appId}/completion"; using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}"); string pluginCode = "your_plugin_code"; // your_plugin_code替换为实际的插件 ID // YOUR_TOKEN替换为实际的Token,如API key string jsonContent = $@"{{ ""input"": {{ ""prompt"": ""寝室公约内容"", ""biz_params"": {{ ""user_defined_params"": {{ ""{pluginCode}"": {{ ""article_index"": 2 }} }}, ""user_defined_tokens"": {{ ""{pluginCode}"": {{ ""user_token"": ""YOUR_TOKEN"" }} }} }} }}, ""parameters"": {{}}, ""debug"": {{}} }}"; HttpContent content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); try { HttpResponseMessage response = await client.PostAsync(url, content); if (response.IsSuccessStatusCode) { string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine("Request successful:"); Console.WriteLine(responseBody); } else { Console.WriteLine($"Request failed with status code: {response.StatusCode}"); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } } catch (Exception ex) { Console.WriteLine($"Error calling DashScope: {ex.Message}"); } } } }Copy{ "output": { "finish_reason": "stop", "session_id": "1a1913a9922a401f8eba36df8ea1a062", "text": "寝室公约的第二条规定如下: 寝室成员应当互帮互助、互相关心、互相学习、共同提高;宽容谦让、相互尊重、以诚相待。 如需了解更详细的公约内容,请进一步指明。" }, "usage": { "models": [ { "output_tokens": 66, "model_id": "qwen-max", "input_tokens": 802 } ] }, "request_id": "04bac806-c5e6-9fab-a846-a66641862be9" }Sample requestSample responseCopypackage main import ( "bytes" "encoding/json" "fmt" "io" "net/http" "os" ) func main() { // 若没有配置环境变量,可用百炼API Key将下行替换为:apiKey := "sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。 apiKey := os.Getenv("DASHSCOPE_API_KEY") appId := "YOUR_APP_ID" // 替换为实际的应用 ID pluginCode := "YOUR_PLUGIN_CODE" // 替换为实际的插件 ID if apiKey == "" { fmt.Println("请确保设置了DASHSCOPE_API_KEY。") return } url := fmt.Sprintf("https://dashscope.aliyuncs.com/api/v1/apps/%s/completion", appId) // 创建请求体 requestBody := map[string]interface{}{ "input": map[string]interface{}{ "prompt": "寝室公约内容", "biz_params": map[string]interface{}{ "user_defined_params": map[string]interface{}{ pluginCode: map[string]interface{}{ "article_index": 10, }, }, "user_defined_tokens": map[string]interface{}{ pluginCode: map[string]interface{}{ "user_token": "YOUR_USER_TOKEN", // 替换实际的鉴权 token,如API key }, }, }, }, "parameters": map[string]interface{}{}, "debug": map[string]interface{}{}, } jsonData, err := json.Marshal(requestBody) if err != nil { fmt.Printf("Failed to marshal JSON: %v\n", err) return } // 创建 HTTP POST 请求 req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) if err != nil { fmt.Printf("Failed to create request: %v\n", err) return } // 设置请求头 req.Header.Set("Authorization", "Bearer "+apiKey) req.Header.Set("Content-Type", "application/json") // 发送请求 client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Printf("Failed to send request: %v\n", err) return } defer resp.Body.Close() // 读取响应 body, err := io.ReadAll(resp.Body) if err != nil { fmt.Printf("Failed to read response: %v\n", err) return } // 处理响应 if resp.StatusCode == http.StatusOK { fmt.Println("Request successful:") fmt.Println(string(body)) } else { fmt.Printf("Request failed with status code: %d\n", resp.StatusCode) fmt.Println(string(body)) } }Copy{ "output": { "finish_reason": "stop", "session_id": "b8e051ba7e954ff8919208e7b84430fa", "text": "寝室公约的第十条规定,寝室成员应共同努力,营造和维护内务整洁干净、美观、高文化品味的寝室环境。如果需要了解完整的寝室公约内容,可能还需要查看其他条款或直接咨询宿舍管理部门。对于更多具体内容,您还有想要了解的部分吗?" }, "usage": { "models": [ { "output_tokens": 70, "model_id": "qwen-max", "input_tokens": 855 } ] }, "request_id": "0921ee34-2754-9616-a826-cea33a0e0a14" } - Use
Custom node parameter pass-through
This article uses the querying the administrative divisions of a city by city name example to show you how to call the custom node parameter pass-through feature of an application through an API.Custom node parameters of an application are passed through the start node of a Workflow Application.
Usage
Step 1: Configure custom node parameters
Open the target application in the workflow list. In the Start node, add aString variable named city. Insert city and query into the prompt, then publish the application.
Step 2: API call
When calling, pass city through thebiz_params field and query through the prompt field.
- Python
- Java
- HTTP
Sample requestSample response
Copy
import os
import dashscope
from dashscope import DashScopeError
client = dashscope.Client(
# 若没有配置环境变量,可用百炼API Key将下行替换为:api_key="sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。
api_key=os.getenv("DASHSCOPE_API_KEY"))
# 工作流应用自定义参数传递
biz_params = {"city": "杭州"}
try:
response = client.apps.completions.create(
app_id='YOUR_APP_ID', # 替换为实际的应用 ID
prompt='查询这个城市的行政区域划分',
biz_params=biz_params # 传递业务参数
)
print(f'{response.text}') # 处理只输出文本text
except DashScopeError as e:
print(f'request_id={e.request_id}')
print(f'code={e.code}')
print(f'message={e.message}')
print(f'请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code')
Copy
杭州市,作为浙江省的省会城市,其行政区域划分包括10个市辖区:上城区、拱墅区、西湖区、滨江区、萧山区、余杭区、临平区、钱塘区、富阳区、临安区。每个区都有其独特的特色和发展重点。
- 上城区:位于杭州市中心地带,是杭州的政治、经济、文化中心之一。
- 拱墅区:以运河文化为特色,拥有众多历史文化遗产。
- 西湖区:著名的西湖风景区就位于此区,是旅游观光的重要目的地。
- 滨江区:高新技术产业聚集地,阿里巴巴等知名企业坐落于此。
- 萧山区:东南部的一个行政区,经济发展迅速,特别是制造业方面。
- 余杭区:近年来发展快速,尤其是互联网经济领域,阿里巴巴总部也设在这里(注:阿里巴巴总部实际位于滨江区)。
- 临平区:新成立的行政区,旨在促进该地区经济社会全面发展。
- 钱塘区:同样是一个较新的行政区划调整结果,强调创新发展和生态保护相结合。
- 富阳区:位于杭州西南方向,以其丰富的自然景观和悠久的历史文化著称。
- 临安区:地处杭州西部,以生态优美闻名,并且有着深厚的文化底蕴。
请注意,随着时间推移,具体的城市规划可能会有所变化,请参考最新的官方信息。
Sample requestSample response
Copy
import com.alibaba.dashscope.app.*;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;
import io.reactivex.Flowable;
public class Main {
public static void appCall() throws NoApiKeyException, InputRequiredException {
String bizParams =
"{\"city\":\"杭州\"}";
ApplicationParam param = ApplicationParam.builder()
// 若没有配置环境变量,可用百炼API Key将下行替换为:.apiKey("sk-xxx")。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.appId("YOUR_APP_ID")
.prompt("查询这个城市的行政区域划分")
.bizParams(JsonUtils.parse(bizParams))
.build();
Application application = new Application();
ApplicationResult result = application.call(param);
System.out.printf("%s\n",
result.getOutput().getText());
}
public static void main(String[] args) {
try {
appCall();
} catch (ApiException | NoApiKeyException | InputRequiredException e) {
System.out.printf("Exception: %s", e.getMessage());
System.out.println("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code");
}
System.exit(0);
}
}
Copy
杭州市是浙江省的省会城市,其行政区域划分主要包括10个市辖区:上城区、拱墅区、西湖区、滨江区、萧山区、余杭区、临平区、钱塘区、富阳区、临安区。每个区都有自己的特色和发展重点。
- 上城区:位于杭州市中心,拥有许多历史文化遗产。
- 拱墅区:以大运河文化而闻名,同时也是一个重要的商业和居住区。
- 西湖区:以其美丽的自然风光著称,包括著名的西湖风景区。
- 滨江区:高新技术产业集聚地,杭州国家高新技术产业开发区就设在这里。
- 萧山区:经济发展迅速,尤其在制造业方面表现突出。
- 余杭区:近年来随着阿里巴巴等高科技企业的发展而快速崛起。
- 临平区:2021年由原余杭区部分区域调整而来,注重生态建设和科技创新。
- 钱塘区:同样是在2021年成立的新区,定位为杭州东部交通枢纽及产业发展新高地。
- 富阳区:历史悠久的文化名城,也是造纸业的重要基地之一。
- 临安区:位于杭州西部,森林覆盖率高,生态环境良好。
这些区域共同构成了杭州市独特的地理格局和社会经济结构。如果你对某个特定区域感兴趣或需要更详细的信息,请告诉我!
- curl
- PHP
- Node.js
- C#
- Go
Sample request
Copy
curl -X POST https://dashscope.aliyuncs.com/api/v1/apps/YOUR_APP_ID/completion \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": {
"prompt": "查询这个城市的行政区域划分",
"biz_params": {
"city": "杭州"}
},
"parameters": {}
}'
Replace YOUR_APP_ID with the actual application ID.Sample response
Copy
{"output":{"finish_reason":"stop","session_id":"c211219896004b50a1f6f66f2ec5413e",
"text":"杭州市下辖10个区、1个县,代管2个县级市,分别为:
上城区、拱墅区、西湖区、滨江区、萧山区、余杭区、临平区、钱塘区、富阳区、临安区、桐庐县、淳安县、建德市、诸暨市。
注意,诸暨市由浙江省直辖、杭州市与绍兴市共同管理。"},"usage":{},
"request_id":"02c3c9e1-7912-9505-91aa-248d04fb1f5d"}
Sample requestSample response
Copy
<?php
# 若没有配置环境变量,可用百炼API Key将下行替换为:$api_key="sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。
$api_key = getenv("DASHSCOPE_API_KEY");
$application_id = 'YOUR_APP_ID'; // 替换为实际的应用 ID
$url = "https://dashscope.aliyuncs.com/api/v1/apps/$application_id/completion";
// 构造请求数据
$data = [
"input" => [
'prompt' => '查询这个城市的行政区域划分',
'biz_params' => [
'city' => '杭州'
]
],
];
// 将数据编码为 JSON
$dataString = json_encode($data);
// 检查 json_encode 是否成功
if (json_last_error() !== JSON_ERROR_NONE) {
die("JSON encoding failed with error: " . json_last_error_msg());
}
// 初始化 cURL 对话
$ch = curl_init($url);
// 设置 cURL 选项
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer ' . $api_key
]);
// 执行请求
$response = curl_exec($ch);
// 检查 cURL 执行是否成功
if ($response === false) {
die("cURL Error: " . curl_error($ch));
}
// 获取 HTTP 状态码
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// 关闭 cURL 对话
curl_close($ch);
// 解码响应数据
$response_data = json_decode($response, true);
// 处理响应
if ($status_code == 200) {
if (isset($response_data['output']['text'])) {
echo "{$response_data['output']['text']}\n";
} else {
echo "No text in response.\n";
}
} else {
if (isset($response_data['request_id'])) {
echo "request_id={$response_data['request_id']}\n";
}
echo "code={$status_code}\n";
if (isset($response_data['message'])) {
echo "message={$response_data['message']}\n";
} else {
echo "message=Unknown error\n";
}
}
Copy
杭州市是浙江省的省会城市,其行政区域划分主要包括10个市辖区:上城区、拱墅区、西湖区、滨江区、萧山区、余杭区、临平区、钱塘区、富阳区、临安区。
每个区都有自己的特色和发展重点,比如:
- **上城区**和**拱墅区**位于杭州市中心,商业繁华,历史悠久。
- **西湖区**以美丽的西湖而闻名,同时也是一个重要的科教文化区。
- **滨江区**则以其高新技术产业发展著称。
- **萧山区**、**余杭区**等则是近年来随着城市发展迅速崛起的新城区或经济开发区。
- **临安区**、**富阳区**等地则更多保留了自然风光与乡村风貌。
请注意,中国的行政区划可能会根据国家政策调整有所变化,请通过官方渠道获取最新信息。
Dependencies to install:Sample requestSample response
Copy
npm install axios
Copy
const axios = require('axios');
async function callDashScope() {
// 若没有配置环境变量,可用百炼API Key将下行替换为:apiKey='sk-xxx'。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。
const apiKey = process.env.DASHSCOPE_API_KEY;
const appId = 'YOUR_APP_ID'; // 替换为实际的应用 ID
const url = `https://dashscope.aliyuncs.com/api/v1/apps/${appId}/completion`;
const data = {
input: {
prompt: "查询这个城市的行政区域划分",
biz_params: {
'city': '杭州',
},
},
parameters: {},
debug: {},
};
try {
console.log("Sending request to DashScope API...");
const response = await axios.post(url, data, {
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
});
if (response.status === 200) {
if (response.data.output && response.data.output.text) {
console.log(`${response.data.output.text}`);
}
} else {
console.log("Request failed:");
if (response.data.request_id) {
console.log(`request_id=${response.data.request_id}`);
}
console.log(`code=${response.status}`);
if (response.data.message) {
console.log(`message=${response.data.message}`);
} else {
console.log('message=Unknown error');
}
}
} catch (error) {
console.error(`Error calling DashScope: ${error.message}`);
if (error.response) {
console.error(`Response status: ${error.response.status}`);
console.error(`Response data: ${JSON.stringify(error.response.data, null, 2)}`);
}
}
}
callDashScope();
Copy
杭州市是浙江省的省会,其行政区域划分包括10个市辖区。具体如下:
1. 上城区(Shàngchéng Qū):位于杭州市中心偏南,是杭州历史最悠久、文化底蕴最深厚的区域之一。
2. 拱墅区(Gǒngshù Qū):原为下城区和拱墅区合并而成的新区,位于杭州市北部。
3. 西湖区(Xīhú Qū):以世界文化遗产西湖而闻名,拥有丰富的自然与人文景观。
4. 滨江区(Bīnjiāng Qū):地处钱塘江南岸,是一个高新技术产业集聚地。
5. 萧山区(Xiāoshān Qū):位于杭州市东部,是中国重要的制造业基地之一。
6. 余杭区(Yúháng Qū):曾经是中国四大名镇之一的临平所在地,现已成为杭州重要的经济发展区。
7. 富阳区(Fùyáng Qū):位于杭州市西南部,因富春江穿流其间而得名。
8. 临安区(Lín'ān Qū):位于杭州市西部山区,以其美丽的自然风光著称。
9. 钱塘区(Qiántáng Qū):成立于2021年,由原大江东产业集聚区及部分萧山区组成,旨在促进杭州东部地区的发展。
10. 临平区(Lín Píng Qū):从余杭区分设出来的一个新行政区划,主要涵盖原余杭区内的临平街道等地。
以上信息反映了截至我最后更新时的情况,请注意行政区划可能会有所调整,请以官方发布的最新消息为准。
Sample requestSample response
Copy
using System.Text;
class Program
{
static async Task Main(string[] args)
{
//若没有配置环境变量,可用百炼API Key将下行替换为:apiKey="sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。
string apiKey = Environment.GetEnvironmentVariable("DASHSCOPE_API_KEY") ?? throw new InvalidOperationException("DASHSCOPE_API_KEY environment variable is not set.");
string appId = "YOUR_APP_ID"; // 替换为实际的应用ID
string url = $"https://dashscope.aliyuncs.com/api/v1/apps/{appId}/completion";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");
string jsonContent = @"{
""input"": {
""prompt"": ""查询这个城市的行政区域划分"",
""biz_params"":{
""city"":""杭州""
}
},
""parameters"": {},
""debug"": {}
}";
HttpContent content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
try
{
HttpResponseMessage response = await client.PostAsync(url, content);
if (response.IsSuccessStatusCode)
{
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine("Request successful:");
Console.WriteLine(responseBody);
}
else
{
Console.WriteLine($"Request failed with status code: {response.StatusCode}");
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
catch (Exception ex)
{
Console.WriteLine($"Error calling DashScope: {ex.Message}");
}
}
}
}
Copy
{
"output": {
"finish_reason": "stop",
"session_id": "7a9ff57eec7d475fa5d487de5f5178d2",
"text": "杭州市是浙江省的省会,它下辖有10个市辖区:上城区、拱墅区、西湖区、滨江区、萧山区、余杭区、临平区、钱塘区、富阳区和临安区。每个区都有其独特的地理位置和发展特色。例如,西湖区以美丽的自然风光著称,尤其是著名的杭州西湖就位于此;而滨江区则更多地以其高新技术产业发展闻名。此外,随着城市的发展,行政区划也可能会有所调整,请关注官方发布的最新信息。"
},
"usage": {
},
"request_id": "d2c2fcc9-f821-98c9-9430-8704a2a41225"
}
Sample requestSample response
Copy
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
func main() {
// 若没有配置环境变量,可用百炼API Key将下行替换为:apiKey := "sk-xxx"。但不建议在生产环境中直接将API Key硬编码到代码中,以减少API Key泄露风险。
apiKey := os.Getenv("DASHSCOPE_API_KEY")
appId := "YOUR_APP_ID" // 替换为实际的应用 ID
if apiKey == "" {
fmt.Println("请确保设置了DASHSCOPE_API_KEY。")
return
}
url := fmt.Sprintf("https://dashscope.aliyuncs.com/api/v1/apps/%s/completion", appId)
// 创建请求体
requestBody := map[string]interface{}{
"input": map[string]interface{}{
"prompt": "查询这个城市的行政区域划分",
"biz_params": map[string]interface{}{
"city": "杭州",
},
},
"parameters": map[string]interface{}{},
"debug": map[string]interface{}{},
}
jsonData, err := json.Marshal(requestBody)
if err != nil {
fmt.Printf("Failed to marshal JSON: %v\n", err)
return
}
// 创建 HTTP POST 请求
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
fmt.Printf("Failed to create request: %v\n", err)
return
}
// 设置请求头
req.Header.Set("Authorization", "Bearer "+apiKey)
req.Header.Set("Content-Type", "application/json")
// 发送请求
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Printf("Failed to send request: %v\n", err)
return
}
defer resp.Body.Close()
// 读取响应
body, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Printf("Failed to read response: %v\n", err)
return
}
// 处理响应
if resp.StatusCode == http.StatusOK {
fmt.Println("Request successful:")
fmt.Println(string(body))
} else {
fmt.Printf("Request failed with status code: %d\n", resp.StatusCode)
fmt.Println(string(body))
}
}
Copy
{
"output": {
"finish_reason": "stop",
"session_id": "2dc3e1a9dcd248c6bb9ca92bffc3e745",
"text": "杭州市,简称“杭”,是浙江省的省会城市。根据最新的行政区划调整,杭州市现辖10个市辖区、2个县级市和1个县,具体如下:
- 市辖区(10个):上城区、拱墅区、西湖区、滨江区、萧山区、余杭区、临平区、钱塘区、富阳区、临安区。
- 县级市(2个):建德市、桐庐县(注意这里的桐庐实际上被列为县级市处理,但准确地说它是一个县)。
- 县(1个):淳安县。
请注意,随着时间的变化,行政区域可能会有所调整,请以官方最新发布的消息为准。上述信息基于较新的资料整理而来,对于最新的变动情况,建议访问政府官方网站获取最准确的信息。"
},
"usage": {
},
"request_id": "d3c8f368-b645-9446-bfe4-20ca51821a02"
}