summaryrefslogtreecommitdiff
path: root/data/en_us/maasaisearchproxy/2026-04-24/api-docs.php
blob: 7b631d6a4ce0b6776290b7d091ce507dd6324e1f (plain)
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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
<?php return [
    'version' => '1.0',
    'info' => ['style' => 'ROA', 'product' => 'MaasAISearchProxy', 'version' => '2026-04-24'],
    'directories' => ['QaChat', 'WebSearch'],
    'components' => [
        'schemas' => [],
    ],
    'apis' => [
        'QaChat' => [
            'summary' => 'Performs web-connected Q&A (OpenAI compatible, supports multi-turn context and follow-up recommendations, SSE streaming / JSON non-streaming).',
            'path' => '/qa/chat',
            'methods' => ['post'],
            'schemes' => ['https', 'sse'],
            'security' => [
                [
                    'AK' => [],
                ],
                [
                    'ApiKey' => [],
                ],
            ],
            'consumes' => ['application/json'],
            'produces' => ['text/event-stream', 'application/json'],
            'operationType' => 'write',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'publicInformation'],
            'parameters' => [
                [
                    'name' => 'body',
                    'in' => 'body',
                    'style' => 'json',
                    'schema' => [
                        'title' => '',
                        'description' => 'The request body parameters.',
                        'type' => 'object',
                        'properties' => [
                            'appId' => ['title' => '', 'description' => 'The application ID.', 'type' => 'string', 'example' => '2052929167853146113', 'required' => false],
                            'sessionId' => ['title' => '', 'description' => 'The session ID.', 'type' => 'string', 'example' => 'chat-abc123', 'required' => false],
                            'message' => [
                                'title' => '',
                                'description' => 'The user message.',
                                'type' => 'object',
                                'properties' => [
                                    'role' => [
                                        'title' => '',
                                        'description' => 'The message role.',
                                        'type' => 'string',
                                        'example' => 'user',
                                        'enum' => ['user'],
                                        'required' => false,
                                    ],
                                    'parts' => [
                                        'title' => '',
                                        'description' => 'The message content.',
                                        'type' => 'array',
                                        'items' => [
                                            'title' => '',
                                            'description' => 'The content block.',
                                            'type' => 'object',
                                            'properties' => [
                                                'type' => [
                                                    'title' => '',
                                                    'description' => 'The content block type.',
                                                    'type' => 'string',
                                                    'example' => 'text',
                                                    'enum' => ['text', 'file'],
                                                    'required' => false,
                                                ],
                                                'text' => ['title' => '', 'description' => 'The text content.', 'type' => 'string', 'example' => '今天杭州天气怎么样?', 'required' => false],
                                                'url' => ['title' => '', 'description' => 'The image URL.', 'type' => 'string', 'example' => 'https://example.com/img.jpg', 'required' => false],
                                                'mediaType' => ['title' => '', 'description' => 'The media type.', 'type' => 'string', 'example' => 'image/jpeg', 'required' => false],
                                            ],
                                            'required' => false,
                                            'example' => '',
                                        ],
                                        'required' => false,
                                        'example' => '',
                                    ],
                                ],
                                'required' => false,
                                'example' => '',
                            ],
                            'stream' => ['title' => '', 'description' => 'Specifies whether to enable streaming.', 'type' => 'boolean', 'example' => 'true', 'required' => false],
                            'options' => [
                                'title' => '',
                                'description' => 'The business parameters.',
                                'type' => 'object',
                                'properties' => [
                                    'searchMode' => [
                                        'title' => '',
                                        'description' => 'The web search mode.',
                                        'type' => 'string',
                                        'example' => 'force',
                                        'enum' => ['force', 'auto'],
                                        'required' => false,
                                    ],
                                    'enableRewrite' => ['title' => '', 'description' => 'Specifies whether to enable query rewriting.', 'type' => 'boolean', 'example' => 'true', 'required' => false],
                                    'enableCitation' => ['title' => '', 'description' => 'Specifies whether to enable citation superscripts.', 'type' => 'boolean', 'example' => 'false', 'required' => false],
                                    'enableFollowUp' => ['title' => '', 'description' => 'Specifies whether to enable follow-up recommendations.', 'type' => 'boolean', 'example' => 'false', 'required' => false],
                                    'enableImages' => ['title' => '', 'description' => 'Specifies whether to enable mixed text-and-image answers.', 'type' => 'boolean', 'example' => 'false', 'required' => false],
                                    'followUpPrompt' => ['title' => '', 'description' => 'The follow-up guidance prompt.', 'type' => 'string', 'example' => '从旅游攻略和历史文化两个角度推荐追问', 'required' => false],
                                    'systemPrompt' => ['title' => '', 'description' => 'The system prompt.', 'type' => 'string', 'example' => '你是专业旅游向导,回答简洁,不超过200字,使用中文。', 'required' => false],
                                ],
                                'required' => false,
                                'example' => '',
                            ],
                        ],
                        'required' => false,
                        'example' => '',
                    ],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'type' => 'object',
                        'properties' => [
                            'event' => ['title' => '', 'description' => 'The event type (the type field in an SSE frame when stream=true, consistent with data.type):'."\n"
                                ."\n"
                                .'1. Lifecycle'."\n"
                                .'   - start / finish'."\n"
                                .'   - Marks the beginning and end of a message. The start event carries messageId.'."\n"
                                ."\n"
                                .'2. Text content'."\n"
                                .'   - text-start / text-delta / text-end'."\n"
                                .'   - Streaming output of Markdown body content. Text blocks within the same segment share the same id.'."\n"
                                ."\n"
                                .'3. Recall intermediate results (only when action=search)'."\n"
                                .'   - data-recall'."\n"
                                .'   - Deduplicated recall items for frontend "thinking process" display.'."\n"
                                ."\n"
                                .'4. Source references (only when action=search)'."\n"
                                .'   - data-reference'."\n"
                                .'   - Web source list. items[].sourceType=web.'."\n"
                                ."\n"
                                .'5. Follow-up recommendations (when enableFollowUp=true and results are available)'."\n"
                                .'   - data-follow-up'."\n"
                                .'   - A questions array.'."\n"
                                ."\n"
                                .'6. Phase timing (all branches)'."\n"
                                .'   - data-usage'."\n"
                                .'   - qp_ms / recall_rank_ms / first_token_ms / answer_ms / follow_up_ms / grand_total_ms / input_tokens / output_tokens / total_tokens (included based on the branch).'."\n"
                                ."\n"
                                .'7. Errors'."\n"
                                .'   - error (errorText / errorCode / retryable) → finish(finishReason=error) → [DONE]'."\n"
                                ."\n"
                                .'Typical sequences:'."\n"
                                .'- search: start → data-recall → text-* → data-reference → [data-follow-up] → data-usage → finish → [DONE]'."\n"
                                .'- answer: start → text-* → [data-follow-up] → data-usage → finish → [DONE]'."\n"
                                .'- clarify: start → text-* → data-usage → finish → [DONE]'."\n"
                                ."\n"
                                .'Note: Events such as data-qp / data-ranked / data-image-info / data-video-info / json-* for image, text, and video templates are not included.', 'type' => 'string', 'example' => 'start'],
                            'data' => [
                                'title' => '',
                                'description' => 'The protocol data.',
                                'type' => 'object',
                                'properties' => [
                                    'type' => ['title' => '', 'description' => 'The event type, same as event.', 'type' => 'string', 'example' => 'start'],
                                    'requestId' => ['title' => '', 'description' => 'The request ID.', 'type' => 'string', 'example' => '2a127bc9-9474-405d-916d-8bc4475fa459'],
                                    'id' => ['title' => '', 'description' => 'The request ID, same as requestId.', 'type' => 'string', 'example' => '2a127bc9-9474-405d-916d-8bc4475fa459'],
                                    'delta' => ['title' => '', 'description' => 'The text delta.', 'type' => 'string', 'example' => '杭州今天多云,气温 18~25℃。'],
                                    'data' => ['title' => '', 'description' => 'The structured payload.', 'type' => 'string', 'example' => '{'."\n"
                                        .'  "items": ['."\n"
                                        .'    {'."\n"
                                        .'      "sourceType": "web",'."\n"
                                        .'      "index": 1,'."\n"
                                        .'      "title": "杭州天气预报",'."\n"
                                        .'      "url": "https://example.com/weather",'."\n"
                                        .'      "snippet": "今日杭州多云...",'."\n"
                                        .'      "score": 0.95,'."\n"
                                        .'      "favicon": "https://example.com/favicon.ico"'."\n"
                                        .'    }'."\n"
                                        .'  ]'."\n"
                                        .'}'."\n"],
                                    'finishReason' => [
                                        'title' => '',
                                        'description' => 'The finish reason.',
                                        'type' => 'string',
                                        'example' => 'stop',
                                        'enum' => ['stop', 'error'],
                                    ],
                                    'errorCode' => ['title' => '', 'description' => 'The error code.', 'type' => 'string', 'example' => 'INTERNAL_ERROR'],
                                    'errorText' => ['title' => '', 'description' => 'The error description.', 'type' => 'string', 'example' => '模型服务暂时不可用'],
                                    'retryable' => ['title' => '', 'description' => 'Indicates whether the request can be retried.', 'type' => 'boolean', 'example' => 'true'],
                                ],
                                'example' => '',
                            ],
                            'id' => ['title' => '', 'description' => 'The request ID.', 'type' => 'string', 'example' => '2a127bc9-9474-405d-916d-8bc4475fa459'],
                        ],
                        'description' => 'stream=true (default): Content-Type is text/event-stream. Each frame is formatted as data: {json}\\n\\n, and the stream ends with data: [DONE]\\n\\n.'."\n"
                            .'The schema below aligns with the ais-engine response structure (event + data + id). The fields within data correspond to the SSE JSON payload.'."\n"
                            ."\n"
                            .'stream=false: Content-Type is application/json;charset=UTF-8. A one-time aggregated object is returned (not wrapped in event/data/id):'."\n"
                            .'requestId, messageId, finishReason, content, action,'."\n"
                            .'recall (only when action=search), references, follow_up, usage.'."\n"
                            .'When finishReason=error, the response contains error{errorText, errorCode, retryable}.'."\n"
                            .'Internal pipeline data such as qp and ranked is not delivered.',
                        'title' => '',
                        'example' => '',
                    ],
                ],
            ],
            'staticInfo' => ['returnType' => 'synchronous'],
            'title' => 'Web-connected Q&A',
            'requestParamsDescription' => '- `sessionId` and `message` are required parameters. `stream` is optional and defaults to `true` (SSE streaming). Set it to `false` to receive a one-time JSON aggregated response.'."\n"
                .'- This operation uses the Chat UI protocol: each request sends only the current `message`. Multi-turn history is managed server-side by `sessionId`, so **you do not need to include historical messages in the request body**. Reuse the same `sessionId` to continue a multi-turn conversation.'."\n"
                .'- `appId` is optional. When provided, the proxy loads the published policy from the console and merges it into `options`. Non-null fields in the request body `options` override policy values. `appId` is consumed by the proxy and is not passed through to upstream services.'."\n"
                .'- All `type=text` entries in `message.parts` are concatenated in order to form the current question. Entries with `type=file` and `mediaType` of `image/*` (or unspecified) are treated as image inputs.'."\n"
                .'- Image `url` supports HTTPS URLs, `data:image/*;base64,...`, or raw base64. A single base64 image must not exceed 10 MB. Files with a non-`image/*` type are ignored.'."\n"
                .'- When calling with an API key, pass a flat JSON body. Do not wrap it in a `body` field. Use camelCase for all field names.',
            'responseParamsDescription' => '- Response format: When stream=true (default), Content-Type is text/event-stream. Frames are pushed via SSE, and the last frame is data: [DONE]. When stream=false, Content-Type is application/json, and a one-time aggregated object is returned.'."\n"
                .'- Streaming frame structure: Each SSE frame contains three top-level fields: event, data, and id. data.type is consistent with event.'."\n"
                .'- requestId: Every SSE event except [DONE] carries a requestId for end-to-end troubleshooting.'."\n"
                .'- Citation superscripts: When enableCitation=true, the body text contains [[cite:n]] superscripts, where n corresponds one-to-one with references.items[].index.'."\n"
                .'- snippet usage: The snippet in recall and references is a short summary returned by the search engine. The content may be truncated and does not represent the full web page. To obtain the full text, fetch the page content from the corresponding url.'."\n"
                .'- Internal data: qp and ranked are internal pipeline data on the server side and are not delivered to the client.'."\n"
                ."\n"
                .'---.'."\n"
                ."\n"
                .'#### Successful response (stream=false)'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "requestId": "2a127bc9-9474-405d-916d-8bc4475fa459",'."\n"
                .'  "messageId": "msg-2a127bc9-9474-405d-916d-8bc4475fa459",'."\n"
                .'  "finishReason": "stop",'."\n"
                .'  "content": "杭州今天多云,气温 18~25℃。[[cite:1]]",'."\n"
                .'  "action": "search",'."\n"
                .'  "recall": {'."\n"
                .'    "total": 2,'."\n"
                .'    "items": ['."\n"
                .'      {'."\n"
                .'        "title": "杭州天气预报",'."\n"
                .'        "link": "https://example.com/weather",'."\n"
                .'        "snippet": "今日杭州多云,气温 18~25℃...",'."\n"
                .'        "date": "2026-06-23T08:00:00Z",'."\n"
                .'        "rank_score": 0.95,'."\n"
                .'        "source": {'."\n"
                .'          "name": "中国天气网",'."\n"
                .'          "domain": "weather.com.cn",'."\n"
                .'          "favicon": "https://example.com/favicon.ico"'."\n"
                .'        }'."\n"
                .'      }'."\n"
                .'    ]'."\n"
                .'  },'."\n"
                .'  "references": {'."\n"
                .'    "items": ['."\n"
                .'      {'."\n"
                .'        "sourceType": "web",'."\n"
                .'        "index": 1,'."\n"
                .'        "title": "杭州天气预报",'."\n"
                .'        "url": "https://example.com/weather",'."\n"
                .'        "snippet": "今日杭州多云...",'."\n"
                .'        "score": 0.95,'."\n"
                .'        "favicon": "https://example.com/favicon.ico"'."\n"
                .'      }'."\n"
                .'    ]'."\n"
                .'  },'."\n"
                .'  "follow_up": {'."\n"
                .'    "questions": ["杭州明天天气怎么样?", "杭州近期适合出游吗?"]'."\n"
                .'  },'."\n"
                .'  "usage": {'."\n"
                .'    "qp_ms": 120.5,'."\n"
                .'    "recall_rank_ms": 350.2,'."\n"
                .'    "answer_ms": 1500.0,'."\n"
                .'    "follow_up_ms": 856.2,'."\n"
                .'    "grand_total_ms": 9716.0,'."\n"
                .'    "input_tokens": 2480,'."\n"
                .'    "output_tokens": 356,'."\n"
                .'    "total_tokens": 2836'."\n"
                .'  }'."\n"
                .'}'."\n"
                .'```.'."\n"
                ."\n"
                .'#### Successful response (stream=true, SSE single frame example)'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "event": "text-delta",'."\n"
                .'  "data": {'."\n"
                .'    "type": "text-delta",'."\n"
                .'    "requestId": "2a127bc9-9474-405d-916d-8bc4475fa459",'."\n"
                .'    "id": "txt-2a127bc9-9474-405d-916d-8bc4475fa459",'."\n"
                .'    "delta": "杭州今天多云,气温 18~25℃。"'."\n"
                .'  },'."\n"
                .'  "id": "2a127bc9-9474-405d-916d-8bc4475fa459"'."\n"
                .'}'."\n"
                .'```.'."\n"
                ."\n"
                .'#### Failed response (stream=false)'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "requestId": "2a127bc9-9474-405d-916d-8bc4475fa459",'."\n"
                .'  "messageId": "msg-2a127bc9-9474-405d-916d-8bc4475fa459",'."\n"
                .'  "finishReason": "error",'."\n"
                .'  "error": {'."\n"
                .'    "errorText": "模型服务暂时不可用",'."\n"
                .'    "errorCode": "INTERNAL_ERROR",'."\n"
                .'    "retryable": true'."\n"
                .'  }'."\n"
                .'}'."\n"
                .'```.'."\n"
                ."\n"
                .'#### Failed response (gateway layer / streaming)'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "error": {'."\n"
                .'    "message": "userId不能为空",'."\n"
                .'    "code": "403"'."\n"
                .'  }'."\n"
                .'}'."\n"
                .'```.'."\n"
                ."\n"
                .'#### Error codes'."\n"
                ."\n"
                .'| Error code | message | Description | Recommended action |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `INVALID_PARAM` | query 不能为空 / 图片超过 10MB | Invalid request parameters. | Check whether `message.parts` contains valid text or images, and then retry the request. |'."\n"
                .'| `INTERNAL_ERROR` | 模型服务暂时不可用 | Internal service error. | Retry later. If the error persists, contact technical support and provide the `requestId` and request parameters. |'."\n"
                .'| `403` | Account not in whitelist | The account does not have web-connected Q&A permissions. | Request access to the beta whitelist and then retry. |'."\n"
                .'| `400` | userId不能为空 | Missing caller account information. | Verify that the API key is bound to a valid primary account. |'."\n"
                .'| `400` | request body is empty | The request body is empty. | Check the request body format and Content-Type. |'."\n"
                .'| `400` | Request was denied due to user flow control | The request rate exceeds the QPS threshold. | Reduce the request frequency. |'."\n"
                .'| `NoPermission` | — | Missing RAM permissions. | Grant the `maasaisearchproxy:QaChat` and `maasaisearchproxy:CallWithBearerToken` permissions. |'."\n"
                .'| `InvalidApiKey` | — | The API key is invalid. | Verify that the key is the full-length key generated at creation time. |'."\n"
                .'| `503` | The request has failed due to a temporary failure of the server | The server is busy or under maintenance. | Wait a moment and retry. If the issue persists, contact technical support. |.',
            'changeSet' => [],
            'ramActions' => [],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"event\\": \\"start\\",\\n  \\"data\\": {\\n    \\"type\\": \\"start\\",\\n    \\"requestId\\": \\"2a127bc9-9474-405d-916d-8bc4475fa459\\",\\n    \\"id\\": \\"2a127bc9-9474-405d-916d-8bc4475fa459\\",\\n    \\"delta\\": \\"杭州今天多云,气温 18~25℃。\\",\\n    \\"data\\": \\"{\\\\n  \\\\\\"items\\\\\\": [\\\\n    {\\\\n      \\\\\\"sourceType\\\\\\": \\\\\\"web\\\\\\",\\\\n      \\\\\\"index\\\\\\": 1,\\\\n      \\\\\\"title\\\\\\": \\\\\\"杭州天气预报\\\\\\",\\\\n      \\\\\\"url\\\\\\": \\\\\\"https://example.com/weather\\\\\\",\\\\n      \\\\\\"snippet\\\\\\": \\\\\\"今日杭州多云...\\\\\\",\\\\n      \\\\\\"score\\\\\\": 0.95,\\\\n      \\\\\\"favicon\\\\\\": \\\\\\"https://example.com/favicon.ico\\\\\\"\\\\n    }\\\\n  ]\\\\n}\\\\n\\",\\n    \\"finishReason\\": \\"stop\\",\\n    \\"errorCode\\": \\"INTERNAL_ERROR\\",\\n    \\"errorText\\": \\"模型服务暂时不可用\\",\\n    \\"retryable\\": true\\n  },\\n  \\"id\\": \\"2a127bc9-9474-405d-916d-8bc4475fa459\\"\\n}","type":"json"}]',
        ],
        'WebSearch' => [
            'summary' => 'The Web Search API allows you to perform real-time searches across the internet and retrieve a structured list of web results. You can integrate it into scenarios such as AI Q&A, content aggregation, public opinion monitoring, and knowledge augmentation, providing your applications with real-time, multi-source external knowledge support.'."\n"
                ."\n"
                .'Two search modes are available:'."\n"
                .'1. Pro: Suitable for complex queries, delivers more relevant and authoritative results, and supports searching global sources.'."\n"
                .'2. Lite: Suitable for everyday queries, with faster response times and lower costs.',
            'path' => '/api/web-search',
            'methods' => ['post'],
            'schemes' => ['https'],
            'security' => [
                [
                    'AK' => [],
                ],
                [
                    'ApiKey' => [],
                ],
            ],
            'consumes' => ['application/json'],
            'produces' => ['application/json'],
            'operationType' => 'read',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'publicInformation'],
            'parameters' => [
                [
                    'name' => 'body',
                    'in' => 'body',
                    'style' => 'json',
                    'schema' => [
                        'description' => 'Request body parameters',
                        'type' => 'object',
                        'properties' => [
                            'query' => ['description' => 'The search query, supporting natural language expressions. The recommended maximum length is 100 characters.', 'type' => 'string', 'required' => false, 'example' => 'Alibaba Cloud Latest News', 'title' => ''],
                            'limit' => ['description' => 'The maximum number of results to return. Valid values: 1 to 10. Default value: 10.', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '10', 'title' => ''],
                            'includeDomain' => [
                                'description' => 'Allowlisted domains. When configured, only results from the specified domains are returned. A maximum of 30 domains are supported per request. Note: This parameter takes effect only when the region parameter is set to global.',
                                'type' => 'array',
                                'items' => ['description' => 'url', 'type' => 'string', 'required' => false, 'example' => 'www.aliyun.com', 'title' => ''],
                                'required' => false,
                                'title' => '',
                                'example' => '',
                            ],
                            'excludeDomain' => [
                                'description' => 'Blocklisted domains. When configured, results from the specified domains are excluded. A maximum of 30 domains are supported per request.',
                                'type' => 'array',
                                'items' => ['description' => 'url', 'type' => 'string', 'required' => false, 'example' => 'example.com', 'title' => ''],
                                'required' => false,
                                'title' => '',
                                'example' => '',
                            ],
                            'startTime' => ['description' => 'Returns search results published on or after this date (inclusive). Format: `YYYY-MM-DD`, for example, `2024-01-01`. If not specified, no start date restriction is applied.', 'type' => 'string', 'required' => false, 'example' => '2026-03-06', 'title' => ''],
                            'endTime' => ['description' => 'Returns search results published on or before this date (inclusive). Format: `YYYY-MM-DD`, for example, `2026-01-01`. If not specified, no end date restriction is applied.', 'type' => 'string', 'required' => false, 'example' => '2026-03-06', 'title' => ''],
                            'region' => [
                                'description' => 'The scope of search sources. Currently supported values: mainland_china (Mainland China) and global (Global). Default value: mainland_china.'."\n"
                                    ."\n"
                                    .'Note: If you select global, your data may be transferred across borders. Please assess the relevant risks on your own. By proceeding, you are deemed to have completed the assessment, and you assume all risks and responsibilities associated with cross-border data transfer.',
                                'enumValueTitles' => ['global' => 'Global', 'mainland_china' => 'Mainland China'],
                                'type' => 'string',
                                'required' => false,
                                'example' => 'mainland_china',
                                'title' => '',
                            ],
                            'searchType' => [
                                'description' => 'The search mode. Currently supported values: pro and lite. Default value: pro.'."\n"
                                    ."\n"
                                    .'Note: In lite mode, the region, excludeDomain, and includeDomain parameters are not supported.',
                                'enumValueTitles' => ['pro' => 'pro', 'lite' => 'lite'],
                                'type' => 'string',
                                'required' => false,
                                'example' => 'pro',
                                'title' => '',
                            ],
                        ],
                        'required' => false,
                        'title' => '',
                        'example' => '',
                    ],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'title' => '',
                        'description' => 'Result<WebSearchRsp>',
                        'type' => 'object',
                        'properties' => [
                            'code' => ['title' => '', 'description' => 'The business status code. `200` indicates a successful request. Other values indicate exceptions. For more information, see the "Error Codes" section.', 'type' => 'integer', 'format' => 'int32', 'example' => '200'],
                            'message' => ['title' => '', 'description' => 'The status description. The value is `"successful"` for successful requests, or a specific error message for failed requests.', 'type' => 'string', 'example' => 'successful'],
                            'data' => [
                                'description' => 'The search result data. This field is present only when `code` is `200`.',
                                'type' => 'object',
                                'properties' => [
                                    'total' => ['title' => '', 'description' => 'The total number of results matched by this search.', 'type' => 'integer', 'format' => 'int32', 'example' => '10'],
                                    'result' => [
                                        'description' => 'The list of search results.',
                                        'type' => 'array',
                                        'items' => [
                                            'description' => 'The Result object.',
                                            'type' => 'object',
                                            'properties' => [
                                                'title' => ['title' => '', 'description' => 'The title of the web page.', 'type' => 'string', 'example' => 'Alibaba Cloud: AI and Cloud Computing Services'],
                                                'url' => ['title' => '', 'description' => 'The original URL of the web page.', 'type' => 'string', 'example' => 'https://www.alibabacloud.com/'],
                                                'snippet' => ['title' => '', 'description' => 'A snippet or summary of the web page.', 'type' => 'string', 'example' => 'Everything You Need in One Powerful AI Cloud Platform For AI Builders shaping the future and Enterprises scaling AI securely.'."\n"
                                                    .'Redefining AI economics with unmatched speed, intelligence and affordability.'],
                                                'date' => ['title' => '', 'description' => 'The publication date of the web page in ISO 8601 format.', 'type' => 'string', 'example' => '2026-05-06T00:25:35Z'],
                                                'source' => [
                                                    'title' => '',
                                                    'description' => 'The source information of the web page, including the favicon, domain, and name fields.',
                                                    'type' => 'object',
                                                    'properties' => [
                                                        'name' => ['title' => '', 'description' => 'The name of the website, which is typically the same as the domain name or the display name of the website.', 'type' => 'string', 'example' => 'www.aliyun.com'],
                                                        'domain' => ['title' => '', 'description' => 'The domain of the website.', 'type' => 'string', 'example' => 'www.aliyun.com'],
                                                        'favicon' => ['title' => '', 'description' => 'The favicon URL of the website.', 'type' => 'string', 'example' => 'https://domain.com/sample_favicon.webp'],
                                                    ],
                                                    'example' => '',
                                                ],
                                            ],
                                            'title' => '',
                                            'example' => '',
                                        ],
                                        'title' => '',
                                        'example' => '',
                                    ],
                                ],
                                'title' => '',
                                'example' => '',
                            ],
                        ],
                        'example' => '',
                    ],
                ],
            ],
            'staticInfo' => ['returnType' => 'synchronous'],
            'title' => 'Web Search',
            'requestParamsDescription' => '- Both `start_date` and `end_date` are optional parameters that can be used individually or in combination to define a time range. Time filtering is based on the publication date of the web page (date). If a web page does not have an annotated publication date, that result is not subject to time parameter constraints.',
            'responseParamsDescription' => '- Time filtering precision: The filtering granularity of start_date and end_date is at the day level (precise to the date), and relies on the publication date annotated by the web page itself. For web pages without an annotated publication date, time filtering does not take effect.'."\n"
                .'- Result deduplication: The same URL will not appear more than once in a single request, but result sets across different requests are not guaranteed to be entirely different.'."\n"
                .'- Using snippets: The snippet is a short summary returned by the search engine. The content may be truncated and does not represent the full text of the web page. To obtain the full content, fetch the page content from the corresponding URL yourself.'."\n"
                ."\n"
                .'#### Successful Response'."\n"
                .'```'."\n"
                .'{'."\n"
                .'  "code": 200,'."\n"
                .'  "message": "successful",'."\n"
                .'  "data": {'."\n"
                .'    "total": 2,'."\n"
                .'    "result": ['."\n"
                .'      {'."\n"
                .'        "snippet": "Alibaba Cloud — one of the world\'s leading cloud computing and AI technology companies under Alibaba Group...",'."\n"
                .'        "date": "2025-12-10T16: 00: 00Z",'."\n"
                .'        "source": {'."\n"
                .'          "favicon": "https://domain.com/sample_img_1.png",'."\n"
                .'          "domain": "www.aliyun.com",'."\n"
                .'          "name": "Alibaba Cloud"'."\n"
                .'        },'."\n"
                .'        "title": "Alibaba Cloud - Computing for the Incalculable Value",'."\n"
                .'        "url": "http://www.aliyun.com/"'."\n"
                .'      },'."\n"
                .'      {'."\n"
                .'        "snippet": "Cloud computing services and cloud solutions...",'."\n"
                .'        "date": "2025-12-10T16: 00: 00Z",'."\n"
                .'        "source": {'."\n"
                .'          "favicon": "https://domain.com/sample_img_2.webp",'."\n"
                .'          "domain": "www.alibabacloud.com",'."\n"
                .'          "name": "www.alibabacloud.com"'."\n"
                .'        },'."\n"
                .'        "title": "Cloud Computing Services and Solutions - Alibaba Cloud",'."\n"
                .'        "url": "https://www.alibabacloud.com/zh/iat/homepage-new-test?_p_lc=1"'."\n"
                .'      }'."\n"
                .'    ]'."\n"
                .'  }'."\n"
                .'}'."\n"
                ."\n"
                .'```'."\n"
                ."\n"
                .'#### Failed Response'."\n"
                .'```'."\n"
                .'{'."\n"
                .'  "code": 401,'."\n"
                .'  "message": "Invalid parameter format"'."\n"
                .'}'."\n"
                ."\n"
                .'```'."\n"
                ."\n"
                .'#### Error Codes'."\n"
                ."\n"
                .'| Error Code | Message | Description | Recommended Action |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'|`201` | Partial results returned due to compliance restrictions | Some search results were blocked due to compliance requirements. | Check whether the query complies with relevant regulations, or ignore the blocked content and use the currently returned results. |'."\n"
                .'| `301` | Request blocked due to legal and regulatory requirements | The request was blocked for security reasons. This request is not billed. | Check whether the content of the query parameter is lawful and compliant, and resubmit the request after modification. |'."\n"
                .'| `400` | Request was denied due to user flow control | The request was too frequent, exceeding the QPS threshold. | Reduce the request frequency. |'."\n"
                .'| `401` | Invalid request parameters | The request parameters are invalid. | Check the format and length of the request parameters, and resubmit the request after modification. |'."\n"
                .'| `500` | Internal server error | An internal server error occurred. | Retry later. If the issue persists, contact technical support and provide the request time and parameters. |'."\n"
                .'| `503` | The request has failed due to a temporary failure of the server | The server is busy or under maintenance and cannot process the current request. | Wait a moment and then refresh the page to retry. If the issue persists, contact technical support. |',
            'changeSet' => [],
            'ramActions' => [
                [
                    'operationType' => 'none',
                    'ramAction' => [
                        'action' => 'maasaisearchproxy:WebSearch',
                        'authLevel' => 'operate',
                        'actionConditions' => [],
                        'resources' => [
                            ['validationType' => 'always', 'product' => 'MaasAISearchProxy', 'resourceType' => 'All Resource', 'arn' => '*'],
                        ],
                    ],
                    'additionalActions' => [
                        ['action' => 'maasaisearchproxy:CallWithBearerToken', 'validationType' => 'conditional'],
                    ],
                ],
            ],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"code\\": 200,\\n  \\"message\\": \\"successful\\",\\n  \\"data\\": {\\n    \\"total\\": 10,\\n    \\"result\\": [\\n      {\\n        \\"title\\": \\"Alibaba Cloud: AI and Cloud Computing Services\\",\\n        \\"url\\": \\"https://www.alibabacloud.com/\\",\\n        \\"snippet\\": \\"Everything You Need in One Powerful AI Cloud Platform For AI Builders shaping the future and Enterprises scaling AI securely.\\\\nRedefining AI economics with unmatched speed, intelligence and affordability.\\",\\n        \\"date\\": \\"2026-05-06T00:25:35Z\\",\\n        \\"source\\": {\\n          \\"name\\": \\"www.aliyun.com\\",\\n          \\"domain\\": \\"www.aliyun.com\\",\\n          \\"favicon\\": \\"https://domain.com/sample_favicon.webp\\"\\n        }\\n      }\\n    ]\\n  }\\n}","type":"json"}]',
        ],
    ],
    'endpoints' => [
        ['regionId' => 'public', 'regionName' => 'Public network', 'areaId' => 'other', 'areaName' => 'Other', 'public' => 'maasaisearchproxy.aliyuncs.com', 'endpoint' => 'maasaisearchproxy.aliyuncs.com', 'vpc' => ''],
    ],
    'errorCodes' => [],
    'changeSet' => [],
    'ram' => [
        'productCode' => 'MaasAISearchProxy',
        'productName' => 'AI Search Proxy',
        'ramCodes' => ['maasaisearchproxy'],
        'ramLevel' => 'OPERATION',
        'ramConditions' => [],
        'ramActions' => [
            [
                'apiName' => 'WebSearch',
                'description' => '',
                'operationType' => 'none',
                'additionalActions' => [
                    ['action' => 'maasaisearchproxy:CallWithBearerToken', 'validationType' => 'conditional'],
                ],
                'ramAction' => [
                    'action' => 'maasaisearchproxy:WebSearch',
                    'authLevel' => 'operate',
                    'actionConditions' => [],
                    'resources' => [
                        ['validationType' => 'always', 'product' => 'MaasAISearchProxy', 'resourceType' => 'All Resource', 'arn' => '*'],
                    ],
                ],
            ],
        ],
        'resourceTypes' => [],
    ],
];