train_dataset.json
10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
{
"skill": "youtube-data-expert",
"version": "1.0.0",
"total_samples": 40,
"samples": [
{
"id": "train-001",
"type": "api_call",
"task": "批量获取视频详情",
"input": {
"videoIds": ["dQw4w9WgXcQ", "9bZkp7q19f0", "kJQP7kiw5Fk"],
"part": "snippet,statistics,contentDetails"
},
"expected_api": "GET /videos?id=dQw4w9WgXcQ,9bZkp7q19f0,kJQP7kiw5Fk&part=snippet,statistics,contentDetails&key={API_KEY}",
"expected_quota": 1,
"expected_output_fields": ["id", "snippet.title", "snippet.channelId", "statistics.viewCount", "contentDetails.duration"]
},
{
"id": "train-002",
"type": "api_call",
"task": "批量获取频道详情",
"input": {
"channelIds": ["UC_x5XG1OV2P6uZZ5FSM9Ttw", "UCBR8-60-B28hp2BmDPdntcQ"]
},
"expected_api": "GET /channels?id=UC_x5XG1OV2P6uZZ5FSM9Ttw,UCBR8-60-B28hp2BmDPdntcQ&part=snippet,statistics",
"expected_quota": 1
},
{
"id": "train-003",
"type": "search",
"task": "搜索视频",
"input": {
"q": "machine learning tutorial",
"type": "video",
"maxResults": 25,
"order": "relevance"
},
"expected_api": "GET /search?q=machine+learning+tutorial&type=video&maxResults=25&order=relevance",
"expected_quota": 100
},
{
"id": "train-004",
"type": "api_call",
"task": "获取频道上传列表",
"input": {
"uploadsPlaylistId": "UUPxMZIFE215t3YupO8B1Bdw",
"maxResults": 50
},
"expected_api": "GET /playlistItems?playlistId=UUPxMZIFE215t3YupO8B1Bdw&maxResults=50&part=snippet",
"expected_quota": 1
},
{
"id": "train-005",
"type": "pagination",
"task": "分页获取",
"input": {
"endpoint": "/search",
"params": {"q": "python", "type": "video"},
"pageToken": "CAEQAA"
},
"expected_api": "GET /search?q=python&type=video&pageToken=CAEQAA",
"expected_behavior": "使用 pageToken 获取下一页,累加配额"
},
{
"id": "train-006",
"type": "error_handling",
"task": "处理 403 配额耗尽错误",
"input": {"error": {"code": 403, "errors": [{"reason": "quotaExceeded"}]}},
"expected_behavior": "立即停止执行,抛出错误 'API quota exceeded (10000/10000 units)'"
},
{
"id": "train-007",
"type": "error_handling",
"task": "处理 429 速率限制",
"input": {"error": {"code": 429}},
"expected_behavior": "指数退避重试: 等待 1s → 2s → 4s → 8s,最多3次"
},
{
"id": "train-008",
"type": "error_handling",
"task": "处理 404 资源不存在",
"input": {"videoId": "invalid_id_12345"},
"expected_behavior": "跳过该资源,记录警告日志,继续处理其他资源"
},
{
"id": "train-009",
"type": "data_parsing",
"task": "解析 ISO 8601 时长",
"input": {"duration": "PT15M33S"},
"expected_output": 933
},
{
"id": "train-010",
"type": "data_parsing",
"task": "解析 ISO 8601 时长 (小时)",
"input": {"duration": "PT1H30M15S"},
"expected_output": 5415
},
{
"id": "train-011",
"type": "data_parsing",
"task": "解析 ISO 8601 时长 (秒)",
"input": {"duration": "PT30S"},
"expected_output": 30
},
{
"id": "train-012",
"type": "boundary",
"task": "处理 videoCount=0",
"input": {"viewCount": 1000, "videoCount": 0},
"expected_behavior": "views_per_video = 0 (避免除以零)"
},
{
"id": "train-013",
"type": "boundary",
"task": "处理隐藏订阅数",
"input": {"hiddenSubscriberCount": true, "viewCount": 1000000, "videoCount": 100},
"expected_behavior": "estimated_subs = viewCount / videoCount * 10 = 100000"
},
{
"id": "train-014",
"type": "quota_tracking",
"task": "计算配额使用",
"input": {
"requests": [
{"endpoint": "search", "count": 2},
{"endpoint": "videos", "count": 5},
{"endpoint": "channels", "count": 3}
]
},
"expected_quota": 208
},
{
"id": "train-015",
"type": "quota_tracking",
"task": "配额警告检查",
"input": {"quota_used": 8200, "quota_limit": 10000},
"expected_behavior": "发出警告: 'Quota usage 8200/10000, approaching limit'"
},
{
"id": "train-016",
"type": "data_validation",
"task": "验证视频ID格式",
"input": {"videoId": "dQw4w9WgXcQ"},
"expected_behavior": "返回 true (11字符,有效字符)"
},
{
"id": "train-017",
"type": "data_validation",
"task": "验证视频ID格式 (无效)",
"input": {"videoId": "invalid"},
"expected_behavior": "返回 false"
},
{
"id": "train-018",
"type": "data_validation",
"task": "验证频道ID格式",
"input": {"channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw"},
"expected_behavior": "返回 true (UC开头,有效字符)"
},
{
"id": "train-019",
"type": "output_format",
"task": "生成 JSON 输出",
"input": {"videos": [{"id": "abc", "title": "Test"}]},
"expected_output_structure": {
"metadata": {"exported_at": "ISO8601", "total_items": 1, "quota_used": 1},
"data": [{"id": "abc", "title": "Test"}]
}
},
{
"id": "train-020",
"type": "search",
"task": "搜索频道",
"input": {"q": "MKBHD", "type": "channel", "maxResults": 5},
"expected_quota": 100
},
{
"id": "train-021",
"type": "api_call",
"task": "获取视频评论",
"input": {"videoId": "dQw4w9WgXcQ", "maxResults": 20},
"expected_api": "GET /commentThreads?videoId=dQw4w9WgXcQ&maxResults=20&part=snippet",
"expected_quota": 1
},
{
"id": "train-022",
"type": "batch_optimization",
"task": "分割大批量请求",
"input": {"videoIds": ["...75个ID..."]},
"expected_behavior": "分成 2 批: 50个 + 25个,共 2 units"
},
{
"id": "train-023",
"type": "data_parsing",
"task": "解析发布时间为 Date 对象",
"input": {"publishedAt": "2024-03-15T10:30:00Z"},
"expected_output": "Date object or timestamp"
},
{
"id": "train-024",
"type": "data_parsing",
"task": "解析大数字",
"input": {"viewCount": "1234567890"},
"expected_output": 1234567890
},
{
"id": "train-025",
"type": "error_handling",
"task": "处理网络超时",
"input": {"error": {"code": "ETIMEDOUT"}},
"expected_behavior": "重试3次,间隔指数退避,最后报告超时错误"
},
{
"id": "train-026",
"type": "boundary",
"task": "处理缺失的 statistics",
"input": {"id": "abc", "snippet": {"title": "Test"}},
"expected_behavior": "返回默认值: viewCount=0, likeCount=0, commentCount=0"
},
{
"id": "train-027",
"type": "api_call",
"task": "获取视频分类列表",
"input": {"regionCode": "US"},
"expected_api": "GET /videoCategories?regionCode=US&part=snippet",
"expected_quota": 1
},
{
"id": "train-028",
"type": "search",
"task": "带日期范围的搜索",
"input": {"q": "python", "publishedAfter": "2024-01-01T00:00:00Z", "publishedBefore": "2024-03-01T00:00:00Z"},
"expected_quota": 100
},
{
"id": "train-029",
"type": "data_parsing",
"task": "提取缩略图 URL",
"input": {"thumbnails": {"default": {"url": "..."}, "high": {"url": "..."}}},
"expected_behavior": "返回最佳可用质量缩略图 URL"
},
{
"id": "train-030",
"type": "output_format",
"task": "生成 CSV 输出",
"input": {"videos": [{"id": "abc", "title": "Test, with comma", "viewCount": 1000}]},
"expected_behavior": "正确处理逗号和引号,生成有效 CSV"
},
{
"id": "train-031",
"type": "api_call",
"task": "获取相关视频",
"input": {"relatedToVideoId": "dQw4w9WgXcQ", "type": "video"},
"expected_api": "GET /search?relatedToVideoId=dQw4w9WgXcQ&type=video",
"expected_quota": 100
},
{
"id": "train-032",
"type": "quota_tracking",
"task": "配额重置时间",
"input": {},
"expected_behavior": "报告 'Quota resets at midnight Pacific Time'"
},
{
"id": "train-033",
"type": "error_handling",
"task": "处理 400 无效参数",
"input": {"error": {"code": 400, "message": "Invalid parameter"}},
"expected_behavior": "记录错误详情,检查参数后重试一次"
},
{
"id": "train-034",
"type": "api_call",
"task": "获取播放列表详情",
"input": {"playlistId": "PLxxx", "part": "snippet"},
"expected_api": "GET /playlists?id=PLxxx&part=snippet",
"expected_quota": 1
},
{
"id": "train-035",
"type": "data_validation",
"task": "验证日期格式",
"input": {"date": "2024-03-15T10:30:00Z"},
"expected_behavior": "返回 true (有效 ISO 8601)"
},
{
"id": "train-036",
"type": "data_parsing",
"task": "计算视频年龄",
"input": {"publishedAt": "2020-01-01T00:00:00Z"},
"expected_behavior": "返回天数差: ~1500天"
},
{
"id": "train-037",
"type": "search",
"task": "频道内搜索",
"input": {"channelId": "UCxxx", "q": "tutorial"},
"expected_api": "GET /search?channelId=UCxxx&q=tutorial&type=video",
"expected_quota": 100
},
{
"id": "train-038",
"type": "boundary",
"task": "处理超长描述",
"input": {"description": "a".repeat(5000)},
"expected_behavior": "保留完整内容或截断到合理长度"
},
{
"id": "train-039",
"type": "error_handling",
"task": "处理 500 服务器错误",
"input": {"error": {"code": 500}},
"expected_behavior": "延迟3秒后重试一次,仍失败则报告错误"
},
{
"id": "train-040",
"type": "api_call",
"task": "获取热门视频",
"input": {"chart": "mostPopular", "regionCode": "US", "maxResults": 10},
"expected_api": "GET /videos?chart=mostPopular®ionCode=US&maxResults=10",
"expected_quota": 1
}
]
}
</content>