Skip to content

Commit b85aa44

Browse files
committed
test: add snapshot for search with plugin
1 parent 15d00f1 commit b85aa44

7 files changed

+56
-44
lines changed

README.zh-Hans.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public class YourService(IDashScopeClient client)
6767
## 支持的 API
6868

6969
- [文本生成](#文本生成) - QWen3, DeepSeek 等,支持推理/工具调用/网络搜索/翻译等场景
70+
- [多轮对话](#多轮对话)
71+
- [深度思考](#深度思考)
72+
- [联网搜索](#联网搜索)
73+
- [工具调用](#工具调用)
7074
- [多模态](#多模态) - QWen-VL,QVQ 等,支持推理/视觉理解/OCR/音频理解等场景
7175
- [语音合成](#语音合成) - CosyVoice,Sambert 等,支持 TTS 等应用场景
7276
- [图像生成](#图像生成) - wanx2.1 等,支持文生图,人像风格重绘等应用场景

src/Cnblogs.DashScope.Core/TextGenerationSearchPluginUsage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
/// Usage of the search plugin.
55
/// </summary>
66
/// <param name="Count">Usage count.</param>
7-
public record TextGenerationSearchPluginUsage(int Count);
7+
/// <param name="Strategy">Search strategy.</param>
8+
public record TextGenerationSearchPluginUsage(int Count, string Strategy);

test/Cnblogs.DashScope.Tests.Shared/RawHttpData/single-generation-message-search-nosse.request.body.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"model": "qwen-max",
2+
"model": "qwen-plus",
33
"input": {
44
"messages": [
55
{
66
"role": "user",
7-
"content": "总结博客园 dudu 的最新博客"
7+
"content": "阿里股价"
88
}
99
]
1010
},
@@ -16,7 +16,8 @@
1616
"enable_citation": true,
1717
"citation_format": "[ref_<number>]",
1818
"forced_search": true,
19-
"search_strategy": "standard"
19+
"search_strategy": "standard",
20+
"enable_search_extension": true
2021
}
2122
}
2223
}

test/Cnblogs.DashScope.Tests.Shared/RawHttpData/single-generation-message-search-nosse.request.header.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Cache-Control: no-cache
55
Host: dashscope.aliyuncs.com
66
Accept-Encoding: gzip, deflate, br
77
Connection: keep-alive
8-
Content-Length: 592
8+
Content-Length: 581
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"output":{"search_info":{"search_results":[{"site_name":"CSDN - 专业开发者社区","icon":"https://img.alicdn.com/imgextra/i3/O1CN01QA3ndK1maJQ8rZTo1_!!6000000004970-55-tps-32-32.svg","index":1,"title":"我与博客园的20年转载","url":"https://blog.csdn.net/weixin_40884228/article/details/148485212"},{"site_name":"博客园","icon":"https://img.alicdn.com/imgextra/i2/O1CN01FzHbv01o253A3z2Gd_!!6000000005166-55-tps-32-32.svg","index":2,"title":"dudu - 博客园","url":"https://www.cnblogs.com/dudu"},{"site_name":"博客园","icon":"https://img.alicdn.com/imgextra/i2/O1CN01FzHbv01o253A3z2Gd_!!6000000005166-55-tps-32-32.svg","index":3,"title":"dudu - 博客园","url":"https://www.cnblogs.com/dudu?page=36"},{"site_name":"阿里云官方网站","icon":"https://img.alicdn.com/imgextra/i3/O1CN015NhUWq1Z1sdj3359l_!!6000000003135-55-tps-32-32.svg","index":4,"title":"玩转博客园的心路总结 - 阿里云开发者社区","url":"https://developer.aliyun.com/article/331235"},{"site_name":"CSDN - 专业开发者社区","icon":"https://img.alicdn.com/imgextra/i3/O1CN01QA3ndK1maJQ8rZTo1_!!6000000004970-55-tps-32-32.svg","index":5,"title":"为.NET程序员打工的站长——博客园dudu 原创","url":"https://blog.csdn.net/Microsoft_MVP/article/details/2416055"}]},"choices":[{"finish_reason":"stop","message":{"role":"assistant","content":"截至2025年6月7日,博客园的dudu站长发布的内容包括了技术分享和个人经历总结。以下是对dudu最近博客内容的一个概括:\n\n1. 代码重构经验分享:dudu在一篇博客中分享了他在博客园后台开发过程中遇到的一次代码重构经历。这次重构涉及到两个列表的合并(union),他需要实现一个自定义的`EqualityComparer`,基于列表元素的`Id`字段来进行比较,而不是默认的对象引用比较。这表明dudu在持续关注和改进博客园的技术架构,以确保其高效和可维护性。[ref_2]\n\n2. 开源工具介绍:另一篇博客介绍了名为NBearMapping的开源对象映射工具,该工具可用于不同类型的对象、DataRow以及DataReader之间的数据映射。dudu提到这个工具对于开发者来说非常有用,因为它可以简化数据层与业务逻辑层之间的交互。[ref_3]\n\n此外,还有关于个人与博客园共同成长的感想,提到了在过去20年间,无论是个人还是博客园本身都经历了巨大的变化。dudu也提到了自己正面临一些个人生活中的挑战,并表达了对博客园社区理解和支持的感激之情。[ref_1]\n\n这些博客不仅展示了dudu作为技术人员的专业知识和技术分享的热情,还反映了他对博客园这个平台的深厚感情和个人投入。如果您需要更详细的博客内容或有其他问题,请告知我以便提供进一步的帮助。"}}]},"usage":{"plugins":{"search":{"count":1}},"total_tokens":800,"output_tokens":304,"input_tokens":496,"prompt_tokens_details":{"cached_tokens":0}},"request_id":"80753a20-2750-9ab6-bc2a-1b851ef43efc"}
1+
{"output":{"choices":[{"message":{"content":"截至2025年10月17日,阿里巴巴美股(BABA)的实时价格为167.05美元,较上个交易日收盘价165.09美元上涨1.19%[根据权威渠道的实时信息]。\n\n近期,多家券商上调了对阿里巴巴的目标股价。其中,摩根大通在2025年10月1日将阿里巴巴美股的目标价由170美元大幅上调至245美元,这是目前外资机构中的最高预测[ref_1][ref_3]。此外,大和证券、瑞银、花旗、高盛、摩根士丹利等也纷纷上调目标价并维持“买入”或类似评级[ref_1]。\n\n从市场表现来看,阿里巴巴股价在近期有所波动。例如,在2025年10月初,其美股价格一度接近189美元,随后有所回落[根据权威渠道的实时信息]。与此同时,港股方面,截至2025年10月3日收盘,阿里巴巴-SW(09988)报185.100港元,上涨2.000港元,涨幅1.09%[ref_2]。","role":"assistant"},"finish_reason":"stop"}],"search_info":{"extra_tool_info":[{"result":"阿里巴巴美股:\n实时价格167.05USD\n上个交易日收盘价165.09USD\n日环比%1.19%\n月环比%-6.53\n日同比%66.33\n月同比%74.05\n历史价格列表[{\"date\":\"2025-10-17\",\"endPri\":\"167.050\"},{\"date\":\"2025-10-16\",\"endPri\":\"165.090\"},{\"date\":\"2025-10-15\",\"endPri\":\"165.910\"},{\"date\":\"2025-10-14\",\"endPri\":\"162.860\"},{\"date\":\"2025-10-13\",\"endPri\":\"166.810\"},{\"date\":\"2025-10-10\",\"endPri\":\"159.010\"},{\"date\":\"2025-10-09\",\"endPri\":\"173.680\"},{\"date\":\"2025-10-08\",\"endPri\":\"181.120\"},{\"date\":\"2025-10-07\",\"endPri\":\"181.330\"},{\"date\":\"2025-10-06\",\"endPri\":\"187.220\"},{\"date\":\"2025-10-03\",\"endPri\":\"188.030\"},{\"date\":\"2025-10-02\",\"endPri\":\"189.340\"},{\"date\":\"2025-10-01\",\"endPri\":\"182.780\"},{\"date\":\"2025-09-30\",\"endPri\":\"178.730\"},{\"date\":\"2025-09-29\",\"endPri\":\"179.900\"},{\"date\":\"2025-09-26\",\"endPri\":\"171.910\"},{\"date\":\"2025-09-25\",\"endPri\":\"175.470\"},{\"date\":\"2025-09-24\",\"endPri\":\"176.440\"},{\"date\":\"2025-09-23\",\"endPri\":\"163.080\"},{\"date\":\"2025-09-22\",\"endPri\":\"164.250\"},{\"date\":\"2025-09-19\",\"endPri\":\"162.810\"},{\"date\":\"2025-09-18\",\"endPri\":\"162.480\"},{\"date\":\"2025-09-17\",\"endPri\":\"166.170\"},{\"date\":\"2025-09-16\",\"endPri\":\"162.210\"},{\"date\":\"2025-09-15\",\"endPri\":\"158.040\"},{\"date\":\"2025-09-12\",\"endPri\":\"155.060\"},{\"date\":\"2025-09-11\",\"endPri\":\"155.440\"},{\"date\":\"2025-09-10\",\"endPri\":\"143.930\"},{\"date\":\"2025-09-09\",\"endPri\":\"147.100\"},{\"date\":\"2025-09-08\",\"endPri\":\"141.200\"}]\n\n","tool":"stock"}],"search_results":[{"icon":"https://b.bdstatic.com/searchbox/mappconsole/image/20190805/1239163c-77cc-449e-b91f-9bb1d27e43a7.png","site_name":"无","index":1,"title":"各大券商不断调高 阿里 预期股价!1. 摩根大通:2025年10月1日,摩根大通发布报告将 阿里巴巴 (BABA.US)... - 雪球","url":"https://xueqiu.com/1692213155/355441155"},{"icon":"https://img.alicdn.com/imgextra/i3/O1CN0143d0Wi1XYHQYtbqJI_!!6000000002935-55-tps-32-32.svg","site_name":"无","index":2,"title":"阿里巴巴-SW(09988)_个股概览_股票价格_实时行情_走势图_新闻资讯_股评_财报_FinScope-AI让投资更简单","url":"https://gushitong.baidu.com/stock/hk-09988?code=09988&financeType=stock&market=hk&name=阿里巴巴-SW&subTab=2"},{"icon":"https://b.bdstatic.com/searchbox/mappconsole/image/20190805/1239163c-77cc-449e-b91f-9bb1d27e43a7.png","site_name":"无","index":3,"title":"截至目前为止,外资机构对","url":"https://xueqiu.com/9216592857/355356488"},{"icon":"https://static.alibabagroup.com/static/favicon.ico","site_name":"阿里巴巴集团","index":4,"title":"阿里巴巴投资者关系-阿里巴巴集团","url":"https://www.alibabagroup.com/redirect?path=/cn/ir/home"},{"icon":"https://static.alibabagroup.com/static/favicon.ico","site_name":"阿里巴巴集团","index":5,"title":"阿里巴巴投資者關係-阿里巴巴集團","url":"https://www.alibabagroup.com/zh-HK/investor-relations"}]}},"usage":{"total_tokens":2973,"output_tokens":266,"input_tokens":2707,"plugins":{"search":{"count":1,"strategy":"standard"}},"prompt_tokens_details":{"cached_tokens":0}},"request_id":"cc2b017d-df02-4ad6-8942-858ad10a3f8a"}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
HTTP/1.1 200 OK
22
vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers, Accept-Encoding
33
content-type: application/json
4-
x-request-id: 405d57ba-6cfc-9519-977f-0f519f712364
4+
x-request-id: cc2b017d-df02-4ad6-8942-858ad10a3f8a
55
x-dashscope-call-gateway: true
6+
x-dashscope-inner-csi: verified
67
x-dashscope-finished: true
78
x-dashscope-timeout: 298
8-
req-cost-time: 810
9-
req-arrive-time: 1751899675324
10-
resp-start-time: 1751899676135
11-
x-envoy-upstream-service-time: 802
9+
req-cost-time: 8863
10+
req-arrive-time: 1760877219936
11+
resp-start-time: 1760877228799
12+
x-envoy-upstream-service-time: 8856
1213
content-encoding: gzip
13-
date: Mon, 07 Jul 2025 14:47:55 GMT
14+
date: Sun, 19 Oct 2025 12:33:48 GMT
1415
server: istio-envoy
1516
transfer-encoding: chunked

0 commit comments

Comments
 (0)