summaryrefslogtreecommitdiff
path: root/data/en_us/aisearchengine/2026-04-17/api-docs.php
blob: cbc98dcc07026d78499a341e3780dfa13becbae1 (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
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
<?php return [
    'version' => '1.0',
    'info' => ['style' => 'ROA', 'product' => 'AiSearchEngine', 'version' => '2026-04-17'],
    'directories' => ['EngineSearch', 'GetDatasetResourceUrl', 'ImportDatasetData', 'QaChat'],
    'components' => [
        'schemas' => [],
    ],
    'apis' => [
        'EngineSearch' => [
            'path' => '/api/v1/platform/app/search',
            'methods' => ['post'],
            'schemes' => ['https'],
            'security' => [
                [
                    'AK' => [],
                ],
                [
                    'ApiKey' => [],
                ],
            ],
            'consumes' => ['application/json'],
            'produces' => ['application/json'],
            'operationType' => 'readAndWrite',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
            'parameters' => [
                [
                    'name' => 'body',
                    'in' => 'body',
                    'style' => 'json',
                    'schema' => [
                        'title' => '',
                        'description' => 'The request body.',
                        'type' => 'object',
                        'properties' => [
                            'appId' => ['title' => '', 'description' => 'The unique ID of the application.', 'type' => 'string', 'required' => true, 'example' => '2048962366415007746'],
                            'sessionId' => ['title' => '', 'description' => 'This parameter does not need to be specified.', 'type' => 'string', 'required' => false, 'example' => '2e95ef4fbc28437db5008a910bd392a4'],
                            'query' => [
                                'title' => '',
                                'description' => 'The query condition object.',
                                'type' => 'object',
                                'properties' => [
                                    'texts' => [
                                        'title' => '',
                                        'description' => 'The text query list.<br>• Only one text string is supported. The maximum length is 256 characters.',
                                        'type' => 'array',
                                        'items' => ['title' => '', 'description' => 'The query text.', 'type' => 'string', 'example' => '女孩收到小红花', 'required' => false],
                                        'required' => false,
                                        'example' => '["梅花图片"]',
                                    ],
                                    'imageUrls' => [
                                        'title' => '',
                                        'description' => 'The image query list.<br>• Only one image URL is supported. The maximum size of a single image is 10 MB. Supported formats: JPG, PNG, WEBP, and JPEG.',
                                        'type' => 'array',
                                        'items' => ['title' => '', 'description' => 'The image URL.', 'type' => 'string', 'example' => 'https://example.com/img.jpg', 'required' => false],
                                        'required' => false,
                                        'example' => '["https://paperreview.oss-cn-hangzhou.aliyuncs.com/59dd424f-97ed-4855-942e-c961f1f5b67e.jpeg"]',
                                    ],
                                    'pageSize' => ['title' => '', 'description' => 'The number of results returned per page.', 'type' => 'integer', 'format' => 'int32', 'example' => '10', 'required' => false],
                                    'pageNo' => ['title' => '', 'description' => 'The page number, starting from 1.<br>• Default value: `1`.', 'type' => 'integer', 'format' => 'int32', 'example' => '1', 'required' => false],
                                    'excludeIds' => [
                                        'title' => '',
                                        'description' => 'The list of primary key IDs to exclude.<br>• Purpose: filters out previously viewed history records.',
                                        'type' => 'array',
                                        'items' => ['title' => '', 'description' => 'The primary key ID to exclude.', 'type' => 'string', 'example' => 'id_001', 'required' => false],
                                        'required' => false,
                                        'example' => '["24234111","12423525"]',
                                    ],
                                ],
                                'required' => true,
                                'example' => '',
                            ],
                            'grey' => ['title' => '', 'description' => 'Specifies whether to access the draft version.', 'type' => 'boolean', 'required' => false, 'example' => 'false'],
                            'user' => [
                                'title' => '',
                                'description' => 'The user information object, used for subsequent user-perspective analysis.',
                                'type' => 'object',
                                'properties' => [
                                    'userId' => ['title' => '', 'description' => 'The unique ID of the user.', 'type' => 'string', 'example' => 'asdfgnoevnor', 'required' => false],
                                ],
                                'required' => false,
                                'example' => '',
                            ],
                        ],
                        'required' => false,
                        'example' => '',
                    ],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'title' => '',
                        'description' => 'Result<SearchResult>',
                        'type' => 'object',
                        'properties' => [
                            'code' => ['title' => '', 'description' => 'The status code. A value of 200 indicates success.', 'type' => 'integer', 'format' => 'int32', 'example' => '200'],
                            'message' => ['title' => '', 'description' => 'The response message.', 'type' => 'string', 'example' => 'successful'],
                            'data' => [
                                'title' => '',
                                'description' => 'The business data body.',
                                'type' => 'object',
                                'properties' => [
                                    'size' => ['title' => '', 'description' => 'The number of results returned on the current page.', 'type' => 'integer', 'format' => 'int32', 'example' => '10'],
                                    'page' => ['title' => '', 'description' => 'The search page number.', 'type' => 'integer', 'format' => 'int32', 'example' => '1'],
                                    'total' => ['title' => '', 'description' => 'The total number of records.', 'type' => 'integer', 'format' => 'int32', 'example' => '121'],
                                    'traceInfo' => ['title' => '', 'description' => 'The Tracing Analysis information.', 'type' => 'object', 'example' => '{"traceId":"234234324"}'],
                                    'extra' => ['title' => '', 'description' => 'The additional metadata. '."\n"
                                        ."\n"
                                        .'> Contains the exclude_ids field, which represents the list of IDs that were actually excluded. The format is `Array[String]`.'."\n"
                                        .'> - Example: ["id_1", "id_2"].', 'type' => 'object', 'example' => '{exclude_ids: ["id_1", "id_2"]}'],
                                    'items' => [
                                        'title' => '',
                                        'description' => '搜索结果列表',
                                        'type' => 'array',
                                        'items' => [
                                            'title' => '',
                                            'description' => '结果对象',
                                            'type' => 'object',
                                            'properties' => [
                                                'id' => ['title' => '', 'description' => '权益绑定 ID'."\n", 'type' => 'string', 'example' => 'iceberg-tbl-b7420156-6d23-4555-8e05-12285b36d6ca'],
                                                'score' => ['title' => '', 'description' => '相关性得分', 'type' => 'number', 'format' => 'float', 'example' => '0.005369'],
                                                'content' => ['title' => '', 'description' => '内容详情对象(详细结构见下文)', 'type' => 'object', 'example' => '{"titile":"大疆无人机"}'],
                                                'algorithm' => ['title' => '', 'description' => '算法内容', 'type' => 'object', 'example' => '{"rankScore":1.0}'],
                                                'traceInfo' => ['title' => '', 'description' => '回传日志时使用。'."\n"
                                                    ."\n"
                                                    .'取值:'."\n"
                                                    ."\n"
                                                    .'trace_id=ali。', 'type' => 'object', 'example' => '{"traceId":"12285b36d6ca"}'],
                                            ],
                                            'example' => '',
                                        ],
                                        'example' => '',
                                    ],
                                    'status' => ['title' => '', 'description' => 'The execution status.'."\n"
                                        .'200: succeeded.'."\n"
                                        .'500: failed.', 'type' => 'string', 'example' => '200'],
                                    'errorMessage' => ['title' => '', 'description' => 'The error message.', 'type' => 'string', 'example' => '搜索词违禁'],
                                    'requestId' => ['title' => '', 'description' => 'The response ID of this request.', 'type' => 'string', 'example' => '62CC3999-5380-5344-ABC7-46453625A910'],
                                ],
                                'example' => '',
                            ],
                        ],
                        'example' => '',
                    ],
                ],
            ],
            'staticInfo' => ['returnType' => 'synchronous'],
            'title' => 'AI search engine operation',
            'summary' => 'Provides a search API operation for the CleverSee AI Search platform. After you create a search application on the platform, you can invoke this search API operation to retrieve images, documents, and audio/video content in datasets. The platform supports text (natural language), image, or combined text-and-image input, enabling fast adaptation to multi-modal large-scale data search scenarios and helping you efficiently locate target content.',
            'description' => '## Operation description'."\n"
                ."\n"
                .'This operation supports calling two types of search applications on the [CleverSee AI Search platform](https://aisearch.aliyun.com/web-search): **image search applications** (text-to-image, image-to-image, and combined text-and-image search) and **audio/video search applications** (text-to-audio/video, image-to-video, and combined text-and-image-to-video search).'."\n"
                ."\n"
                .'### Data sources'."\n"
                ."\n"
                .'Audio and video data is supported. You can upload and update data through the [CleverSee AI Search platform](https://aisearch.aliyun.com/web-search) UI or through the [Dataset Data Add/Update API](https://www.alibabacloud.com/help/en/document_detail/3038471.html).'."\n"
                ."\n"
                .'# Authentication'."\n"
                ."\n"
                .'Call the CleverSee - Intelligent Search service by using the Alibaba Cloud SDK. For more information, see [AI search engine operation](https://api.aliyun.com/document/AiSearchEngine/2026-04-17/EngineSearch).',
            'requestParamsDescription' => '## Request examples'."\n"
                ."\n"
                .'Normal request example'."\n"
                ."\n"
                .'`JSON` format'."\n"
                ."\n"
                .'```json'."\n"
                .'curl -X POST \'https://pre-ai-search-engine.aliyun-inc.com/api/v1/engine/search\' \\'."\n"
                .'    -H \'Content-Type: application/json\' \\'."\n"
                .'    -H \'X-Acs-Account-Id: 1754376654452940\' \\'."\n"
                .'    -d \'{'."\n"
                .'      "appId": "2048962366415007746",'."\n"
                .'      "query": {'."\n"
                .'        "texts": ["小女孩"],'."\n"
                .'        "imageUrls": ["https://your-image-url"],'."\n"
                .'        "pageSize": 10,'."\n"
                .'        "pageNo": 1,'."\n"
                .'        "excludeIds": []'."\n"
                .'      },'."\n"
                .'      "user": {'."\n"
                .'        "userId": "asdfgnoevnor"'."\n"
                .'      }'."\n"
                .'    }\''."\n"
                .'```.',
            'responseParamsDescription' => '### 3.2 Detailed structure of `items` elements'."\n"
                ."\n"
                .'Each object in the `items` array represents a search result. Depending on the media type (image, video, or audio), the specific properties within the `content` field vary. The following describes the common structure and fields specific to video/audio results:'."\n"
                ."\n"
                .'#### Image search `**items**`'."\n"
                ."\n"
                .'| **Parameter** |                | **Type** | **Description**                                          | **Example**                          |'."\n"
                .'| ---------------- | -------------- | -------------- | ------------------------------------------------------- | ----------------------------------------- |'."\n"
                .'| score            |                | Float          | The relevance score.                                              | `0.005369`                              |'."\n"
                .'| content          |                | Object         | The content details object.                                            | _(See sub-fields)_                              |'."\n"
                .'| ├─             | image\\_url     | String         | The image URL.`<br>`• Signed, valid for 24 hours after dataset creation. | `"https://.../image_1.png?Expires=..."` |'."\n"
                .'| ├─             | s\\_name        | String         | The original file name.                                              | `"image_1.png"`                         |'."\n"
                .'| ├─             | pk\\_id         | String         | The primary key ID of the original resource.                                      | `"01KQ...ZX020"`                        |'."\n"
                .'| └─             | s\\_dataset\\_id | String         | The ID of the dataset to which the resource belongs.                                          | `"594"`                                 |.'."\n"
                ."\n"
                .'#### Audio/video search `**items**`'."\n"
                ."\n"
                .'| **Parameter** |                                | **Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                         | **Example**                                                                             |'."\n"
                .'| ---------------- | ------------------------------ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |'."\n"
                .'| score            |                                | Float          | The relevance score.                                                                                                                                                                                                                                                                                                                                                                                             | `0.005369`                                                                                 |'."\n"
                .'| content          |                                | Object         | The content details object.                                                                                                                                                                                                                                                                                                                                                                                           | _(See sub-fields)_                                                                                 |'."\n"
                .'| ├─             | s\\_raw\\_cover\\_pic             | String         | The cover image URL of the full video.`<br>`• Signed, valid for 24 hours after dataset creation.`<br>`• Returns `null` for audio or plain text results.                                                                                                                                                                                                                                                                                             | `"https://.../frame_0.jpg?Expires=..."`                                                    |'."\n"
                .'| ├─             | s\\_segment\\_cover\\_pic         | String         | The cover image URL of the video segment.`<br>`• Signed, valid for 24 hours after dataset creation.`<br>`• Returns `null` for audio or plain text results.                                                                                                                                                                                                                                                                                             | `"https://.../frame_1.jpg?Expires=..."`                                                    |'."\n"
                .'| ├─             | s\\_raw\\_file\\_path             | String         | The media file URL.`<br>`• Signed, valid for 24 hours after dataset creation.`<br>`• Supports mp4, mp3, jpg, and other formats.                                                                                                                                                                                                                                                                                                     | `"https://.../video.mp4?Expires=..."`                                                      |'."\n"
                .'| ├─             | s\\_name                        | String         | The original file name.                                                                                                                                                                                                                                                                                                                                                                                             | `"video_001.mp4"`                                                                          |'."\n"
                .'| ├─             | pk\\_id                         | String         | The primary key ID of the original resource.                                                                                                                                                                                                                                                                                                                                                                                     | `"01KQ...ZX020"`                                                                           |'."\n"
                .'| ├─             | s\\_dataset\\_id                 | String         | The ID of the dataset to which the resource belongs.                                                                                                                                                                                                                                                                                                                                                                                         | `"594"`                                                                                    |'."\n"
                .'| ├─             | s\\_segment\\_start\\_millisecond | Integer        | The start time of the segment in milliseconds.`<br>`• May be 0 for non-video/audio segments.                                                                                                                                                                                                                                                                                                                                                               | `10000`                                                                                    |'."\n"
                .'| ├─             | s\\_segment\\_end\\_millisecond   | Integer        | The end time of the segment in milliseconds.`<br>`• May be 0 for non-video/audio segments.                                                                                                                                                                                                                                                                                                                                                               | `20000`                                                                                    |'."\n"
                .'| ├─             | s\\_raw\\_length                 | Integer        | The file duration.                                                                                                                                                                                                                                                                                                                                                                                               | `146046`                                                                                   |'."\n"
                .'| ├─             | s\\_video\\_type                 | String         | The video type tag.`<br>`• The video category, an AI-generated video-level tag. Valid values: `<br>课堂录播`, `微课/慕课`, `科普解说`, `技能教程`, `新闻播报`, `访谈/演讲`, `纪录片`, `现场报道`, `宣传片/广告`, `发布会`, `产品演示`, `Vlog/日常`, `影视综艺`, `游戏实况`, `短剧/搞笑`, `美食/旅游`, `音乐舞蹈`, `体育赛事`, `晚会/演出`, `其他` | `课堂录播`                                                                                 |'."\n"
                .'| ├─             | s\\_video\\_topic                | String         | The video topic tag.`<br>`• The core topic of the video, an AI-generated video-level tag. The values are not enumerable.                                                                                                                                                                                                                                                                                                                           | `单机游戏实况`                                                                             |'."\n"
                .'| ├─             | s\\_global\\_summary             | String         | The global summary tag.`<br>`• A core summary of the video content, an AI-generated video-level tag. The values are not enumerable.                                                                                                                                                                                                                                                                                                                       | `本视频详细测评了XX品牌最新款智能手机的各项性能,重点展示了其夜景拍照能力与游戏散热表现。` |'."\n"
                .'| └─             | s\\_global\\_keywords            | String         | The global keywords tag.`<br>`• Two to four keywords that summarize the video content, an AI-generated video-level tag. The values are not enumerable.                                                                                                                                                                                                                                                                                                              | `手机测评, 性能测试`                                                                      |.'."\n"
                ."\n"
                .'## Response examples.'."\n"
                ."\n"
                .'### Normal image search response example'."\n"
                ."\n"
                .'`JSON` format'."\n"
                ."\n"
                .'```json'."\n"
                .'  {'."\n"
                .'    "code": 200,'."\n"
                .'    "message": "success",'."\n"
                .'    "data": {'."\n"
                .'      "size": 1,'."\n"
                .'      "page": 1,'."\n"
                .'      "total": 1,'."\n"
                .'      "traceInfo": null,'."\n"
                .'      "extra": {'."\n"
                .'        "exclude_ids": ["3f95b343xxxxxxxxxxxx"]'."\n"
                .'      },'."\n"
                .'      "items": ['."\n"
                .'        {'."\n"
                .'          "id": "3f95b343xxxxxxxxxxxx",'."\n"
                .'          "score": 0.8029279573006508,'."\n"
                .'          "content": {'."\n"
                .'            "s_name": "sample_image.png",'."\n"
                .'            "image_url": "https://.../image.png?Expires=...",'."\n"
                .'            "pk_id": "3f95b343xxxxxxxxxxxx",'."\n"
                .'            "s_dataset_id": "594"'."\n"
                .'          },'."\n"
                .'          "algorithm": {},'."\n"
                .'          "traceInfo": null'."\n"
                .'        }'."\n"
                .'      ],'."\n"
                .'      "status": "200",'."\n"
                .'      "errorMessage": null'."\n"
                .'    },'."\n"
                .'    "requestId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"'."\n"
                .'  }'."\n"
                .'```.'."\n"
                ."\n"
                .'### Normal video search response example'."\n"
                ."\n"
                .'`JSON` format'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "code": 200,'."\n"
                .'  "data": {'."\n"
                .'    "total": 1,'."\n"
                .'    "size": 1,'."\n"
                .'    "traceInfo": null,'."\n"
                .'    "extra": {'."\n"
                .'      "exclude_ids": ["01XXXXXXXXXXXXXXX"]'."\n"
                .'    },'."\n"
                .'    "errorMessage": null,'."\n"
                .'    "page": 1,'."\n"
                .'    "items": [{'."\n"
                .'      "score": 0.577594,'."\n"
                .'      "traceInfo": null,'."\n"
                .'      "id": "01XXXXXXXXXXXXXXX",'."\n"
                .'      "content": {'."\n"
                .'        "s_raw_file_path": "https://.../video.mp4?Expires=...",'."\n"
                .'        "s_raw_length": 1036122,'."\n"
                .'        "pk_id": "01XXXXXXXXXXXXXXX",'."\n"
                .'        "s_global_summary": "视频前半段围绕人物之间的冲突与协作展开,通过多段剧情推进呈现复杂关系与情绪变化,包含追逐、对话、调查等情节;后半段切换为舞台表演内容,展示歌手在大型活动中的现场演唱与观众互动,整体内容兼具剧情叙事与音乐演出元素。",'."\n"
                .'        "s_raw_cover_pic": "https://.../frame_1.jpg?Expires=...",'."\n"
                .'        "s_name": "demo_video.mp4",'."\n"
                .'        "s_dataset_id": "833",'."\n"
                .'        "s_global_keywords": "剧情互动,人物关系,调查追逐,音乐表演,舞台演唱",'."\n"
                .'        "s_video_topic": "剧情内容与音乐演出",'."\n"
                .'        "s_video_type": "影视综艺"'."\n"
                .'      },'."\n"
                .'      "algorithm": {}'."\n"
                .'    }],'."\n"
                .'    "status": "200"'."\n"
                .'  },'."\n"
                .'  "requestId": "xxxxxxxxxxxxxxxxxxxxxxxx",'."\n"
                .'  "message": "success"'."\n"
                .'}'."\n"
                .'```.'."\n"
                ."\n"
                .'## Error codes'."\n"
                ."\n"
                .'| **HTTP status code** | **Error code** | **Error message**           | **Description**           |'."\n"
                .'| -------------------- | -------------------------- | ----------------------------------------- | ---------------------------- |'."\n"
                .'| 500                  | `SYSTEM_ERROR`           | `system inner error`                  | An internal system error occurred.                 |'."\n"
                .'| 403                  | `APP_FORBIDDEN`          | `no permission to access this app` | Insufficient permissions to access this application.     |'."\n"
                .'| 400                  | `INVALID_PARAM`          | `invalid parameter`                    | Invalid parameter.                     |'."\n"
                .'| 404                  | `APP_NOT_FOUND`          | `app not found`                       | The application does not exist.                   |'."\n"
                .'| 407                  | `APP_ACCESS_UNAVAILABLE` | `app access privilege escalation`    | Application access privilege escalation exception. |'."\n"
                .'| 405                  | `INPUT_TOO_LONG`         | `input text exceeds maximum length` | The input text exceeds the maximum length.                 |'."\n"
                .'| 406                  | `IMAGE_LIMIT_EXCEEDED`   | `image count exceeds maximum limit` | The number of images exceeds the maximum limit.             |.'."\n"
                ."\n"
                .'# Pre-signed URL API for multimedia resources (images and videos) in search results'."\n"
                ."\n"
                .'To obtain data URLs in a dataset and download the data, see [Pre-signed URL API for multimedia resources (images and videos) in search results](https://www.alibabacloud.com/help/en/document_detail/3039566.html).',
            'changeSet' => [],
            'ramActions' => [
                [
                    'operationType' => 'create',
                    'ramAction' => [
                        'action' => 'aisearchengine:EngineSearch',
                        'authLevel' => 'operate',
                        'actionConditions' => [],
                        'resources' => [
                            ['validationType' => 'always', 'product' => 'AiSearchEngine', 'resourceType' => 'All Resource', 'arn' => '*'],
                        ],
                    ],
                ],
            ],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"code\\": 200,\\n  \\"message\\": \\"successful\\",\\n  \\"data\\": {\\n    \\"size\\": 10,\\n    \\"page\\": 1,\\n    \\"total\\": 121,\\n    \\"traceInfo\\": {\\n      \\"traceId\\": \\"234234324\\"\\n    },\\n    \\"extra\\": {\\n      \\"test\\": \\"test\\",\\n      \\"test2\\": 1\\n    },\\n    \\"items\\": [\\n      {\\n        \\"id\\": \\"iceberg-tbl-b7420156-6d23-4555-8e05-12285b36d6ca\\",\\n        \\"score\\": 0.005369,\\n        \\"content\\": {\\n          \\"titile\\": \\"大疆无人机\\"\\n        },\\n        \\"algorithm\\": {\\n          \\"rankScore\\": 1\\n        },\\n        \\"traceInfo\\": {\\n          \\"traceId\\": \\"12285b36d6ca\\"\\n        }\\n      }\\n    ],\\n    \\"status\\": \\"200\\",\\n    \\"errorMessage\\": \\"搜索词违禁\\",\\n    \\"requestId\\": \\"62CC3999-5380-5344-ABC7-46453625A910\\"\\n  }\\n}","type":"json"}]',
        ],
        'GetDatasetResourceUrl' => [
            'path' => '/api/v1/dataset/open/resources',
            'methods' => ['post'],
            'schemes' => ['https'],
            'security' => [
                [
                    'AK' => [],
                ],
                [
                    'ApiKey' => [],
                ],
            ],
            'consumes' => ['application/json'],
            'produces' => ['application/json'],
            'operationType' => 'read',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
            'parameters' => [
                [
                    'name' => 'body',
                    'in' => 'body',
                    'style' => 'json',
                    'schema' => [
                        'description' => 'The request body.',
                        'type' => 'object',
                        'properties' => [
                            'datasetId' => ['description' => 'The dataset ID. You can view this in the dataset list on the console.', 'type' => 'string', 'format' => 'int64', 'required' => true, 'example' => '730', 'title' => ''],
                            'primaryKey' => ['description' => 'The primary key value of the data record in the dataset.', 'type' => 'string', 'required' => true, 'example' => '01KQCJBPM9JVDTXWV50G2AKXXX', 'title' => ''],
                        ],
                        'required' => false,
                        'example' => '{'."\n"
                            .'  "datasetId": 730,'."\n"
                            .'  "primaryKey": "01KQCJBPM9JVDTXWV50G2AKXXX"'."\n"
                            .'}',
                        'title' => '',
                    ],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'title' => '',
                        'description' => 'Result<DatasetOpenResourceVO>',
                        'type' => 'object',
                        'properties' => [
                            'code' => ['description' => 'The business status code. A value of `200` indicates a successful request. Other values indicate an exception. For more information, see error codes.', 'type' => 'integer', 'format' => 'int32', 'example' => '200', 'title' => ''],
                            'message' => ['description' => 'The status description. The value is "success" for successful requests and a specific error message for failed requests.', 'type' => 'string', 'example' => 'success', 'title' => ''],
                            'data' => [
                                'description' => 'The business data body.',
                                'type' => 'object',
                                'properties' => [
                                    'url' => ['description' => 'The temporary OSS access URL with a signature and expiration time (valid for 24 hours). The URL can be used directly for frontend display or download.', 'type' => 'string', 'example' => 'https://maas-ai-search-center-raw.oss-cn-hangzhou.aliyuncs.com/.../sample.mp4...', 'title' => ''],
                                ],
                                'title' => '',
                                'example' => '',
                            ],
                            'requestId' => ['description' => 'The unique request ID, used for troubleshooting.', 'type' => 'string', 'example' => '1a0f40dd17774641794394269ec0e9', 'title' => ''],
                        ],
                        'example' => '',
                    ],
                ],
            ],
            'staticInfo' => ['returnType' => 'synchronous'],
            'title' => 'Retrieve temporary resource URL',
            'summary' => 'Retrieves a temporary public network access URL for an image, audio, or video resource in your dataset.',
            'description' => 'Retrieves a temporary secure access URL for an underlying media resource (such as audio, video, or image) stored in AI Search Platform, based on the dataset ID and data primary key. The URL can be used directly for frontend display or download.'."\n"
                ."\n"
                .'Key use case: When you make a Search API call for a search application created in AI Search Platform, the returned image, audio, and video result URLs are pre-signed links with a validity period of 24 hours. If your application persists these URLs in local storage, subsequent access may fail because the URLs have expired. In this case, invoke this operation with the corresponding dataset ID and data record primary key to retrieve the latest valid access URL for the resource.',
            'responseParamsDescription' => '### Response example.'."\n"
                ."\n"
                .'#### Successful response'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "code": 200,'."\n"
                .'  "message": "success",'."\n"
                .'  "data": {'."\n"
                .'    "url": "https://maas-ai-search-center-raw.oss-ap-southeast-1.aliyuncs.com/.../sample.mp4..."'."\n"
                .'  },'."\n"
                .'  "requestId": "1a0f40da17774667074596639ec2b6"'."\n"
                .'}'."\n"
                ."\n"
                .'```.'."\n"
                ."\n"
                .'### Error codes'."\n"
                ."\n"
                .'| Error code | message | Description | Suggested solution |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| 400 | `datasetId: must not be null`  | The request parameters are incomplete or incorrectly formatted. For example, the required `datasetId` parameter is missing. | Check your request to ensure that all required parameters are provided and correctly formatted. |'."\n"
                .'| 403 | `Access denied` | Access is denied, typically because of authentication failure or insufficient permissions. | Check whether your AccessKey or other authentication credentials are correct, and verify that you have the permissions to operate on the resource. |'."\n"
                .'| 404 | `Dataset not found` | The specified dataset does not exist. | Check whether the `datasetId` in the request is correct. |'."\n"
                .'| 404 | `Resource not found` | No corresponding record exists for the specified primary key value in the target dataset. | Check whether the specified resource primaryKey in the request is correct. |'."\n"
                .'| 404 | `Resource file not found` | The specified primary key value exists, but the rawFilePath field is empty, or the OSS pre-signed URL generation returned empty (the file is abnormal or has been deleted). The specified resource file does not exist. | Check whether the specified file is correctly stored and whether the storage resource is functioning properly. |'."\n"
                .'| 500 | `Internal server error` | An unknown error occurred on the server. | Try again later. If the issue persists, contact technical support. |.',
            'changeSet' => [],
            'ramActions' => [],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"code\\": 200,\\n  \\"message\\": \\"success\\",\\n  \\"data\\": {\\n    \\"url\\": \\"https://maas-ai-search-center-raw.oss-cn-hangzhou.aliyuncs.com/.../sample.mp4...\\"\\n  },\\n  \\"requestId\\": \\"1a0f40dd17774641794394269ec0e9\\"\\n}","type":"json"}]',
        ],
        'ImportDatasetData' => [
            'summary' => 'Adds or updates data in a specific dataset in real time. The system matches records based on the primary key value of the target dataset and the primary key value of the new data record (such as "pk_id" = "2026aa01"). If a matching primary key value is found, the corresponding data record is updated. If no match is found, a new data record is added.',
            'path' => '/api/v1/dataset/open/upsert',
            'methods' => ['post'],
            'schemes' => ['https'],
            'security' => [
                [
                    'AK' => [],
                ],
                [
                    'ApiKey' => [],
                ],
            ],
            'consumes' => ['application/json'],
            'produces' => ['application/json'],
            'operationType' => 'write',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
            'parameters' => [
                [
                    'name' => 'body',
                    'in' => 'body',
                    'style' => 'json',
                    'schema' => [
                        'description' => 'The request body.',
                        'type' => 'object',
                        'properties' => [
                            'datasetId' => ['description' => 'The dataset ID. You can view this ID in the dataset list in the console.', 'type' => 'string', 'format' => 'int64', 'required' => true, 'example' => '730', 'title' => ''],
                            'records' => [
                                'description' => 'The list of data records to add or update. A maximum of 100 records can be included in a single batch operation.'."\n"
                                    ."\n"
                                    .'Note: The records must strictly follow the schema configured for the target dataset in the console. The add or update logic depends on the primary key type of the target dataset. For detailed example requests, see the Request Description section below.',
                                'type' => 'array',
                                'items' => [
                                    'description' => 'The data item.',
                                    'type' => 'object',
                                    'required' => false,
                                    'additionalProperties' => ['description' => '数据项可以是任意格式。', 'type' => 'any', 'example' => '['."\n"
                                        .'      { '."\n"
                                        .'        "pk_id": "01KQCJXXX",'."\n"
                                        .'        "video_url": "https://sample.aliyuncs.com/path/test_1.mp4",'."\n"
                                        .'        "name": "new-test.mp4"'."\n"
                                        .'      }'."\n"
                                        .']', 'title' => ''],
                                    'title' => '',
                                    'example' => '',
                                ],
                                'required' => true,
                                'title' => '',
                                'example' => '',
                            ],
                        ],
                        'required' => false,
                        'title' => '',
                        'example' => '',
                    ],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'title' => '',
                        'description' => 'Result<DatasetImportTaskVO>',
                        'type' => 'object',
                        'properties' => [
                            'code' => ['description' => 'The business status code. A value of 200 indicates a successful request. Other values indicate exceptions. For more information, see error codes.', 'type' => 'integer', 'format' => 'int32', 'example' => '200', 'title' => ''],
                            'message' => ['description' => 'The status description.', 'type' => 'string', 'example' => 'success', 'title' => ''],
                            'data' => ['description' => 'The response data body, which uses an empty placeholder.', 'type' => 'object', 'example' => '[]', 'title' => ''],
                            'requestId' => ['description' => 'The unique request ID, used for troubleshooting.', 'type' => 'string', 'example' => '1a0f40dd17774641794394269ec0e9', 'title' => ''],
                        ],
                        'example' => '',
                    ],
                ],
            ],
            'staticInfo' => ['returnType' => 'synchronous'],
            'title' => 'Import data into a dataset',
            'description' => '**Common scenarios**'."\n"
                ."\n"
                .'| Scenario | Description |'."\n"
                .'| --- | --- |'."\n"
                .'| Real-time data addition | Pushes new data to the AI search platform in real time when the business system generates new data. |'."\n"
                .'| Status update | Promptly updates data when changes occur on the business side, such as title modifications or delisting. |'."\n"
                ."\n"
                .'**Before you begin**'."\n"
                ."\n"
                .'- **Primary key handling**: The system determines whether to add or update a record based on the primary key type (user-defined or system-generated) of the target dataset.'."\n"
                .'- **Batch limit**: A maximum of 100 records can be processed per request.'."\n"
                .'- **Schema matching**: The `records` field must strictly follow the schema configured for the target dataset in the console.'."\n"
                .'- **Permission requirements**: Make sure you have sufficient permissions to write to or update the target dataset.'."\n"
                .'- **Status check**: Before sending a request, confirm that the target dataset is in a writable state and not in read-only mode.',
            'requestParamsDescription' => '#### Important: Field requirements for objects in the records array'."\n"
                ."\n"
                .'The fields must strictly follow the schema configured for the target dataset in the console. The add or update routing logic depends on the primary key type of the target dataset, which falls into the following two cases.'."\n"
                ."\n"
                .'##### Case 1: User-defined primary key'."\n"
                ."\n"
                .'Assume that when creating a dataset with datasetId 730, the user defined the primary key field as business\\_pk\\_id. Each record in records must include this **primary key field** and its corresponding value. The system matches the primary key value against existing data in the target dataset:'."\n"
                ."\n"
                .'*   If no match is found, an **add** operation is performed.'."\n"
                .'    '."\n"
                .'*   If a match is found, an **update** operation is performed.'."\n"
                .'    '."\n"
                ."\n"
                .'**Example scenario 1: Adding a new record**'."\n"
                ."\n"
                .'When calling this API, the records request parameter contains a row of data with "business_pk_id"="NEW_ID_101". Because the system **does not find** a record with business\\_pk\\_id = "NEW\\_ID\\_101" in the dataset, it **performs an add** operation.'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "datasetId": 730,'."\n"
                .'  "records": ['."\n"
                .'    {'."\n"
                .'      "business_pk_id": "NEW_ID_101",'."\n"
                .'      "name": "new-video.mp4",'."\n"
                .'      "video_url": "https://example.com/new-video.mp4"'."\n"
                .'    }'."\n"
                .'  ]'."\n"
                .'}'."\n"
                .'```'."\n"
                ."\n"
                .'**Example scenario 2: Updating an existing record**'."\n"
                ."\n"
                .'When calling this API, the records request parameter contains a row of data with "business_pk_id"="01KQCJBPM9JVDTXWV50G2AKXX". Because the system **finds** a record with business\\_pk\\_id = "01KQCJBPM9JVDTXWV50G2AKXX" in the dataset, it **performs an update** operation.'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "datasetId": 730,'."\n"
                .'  "records": ['."\n"
                .'    {'."\n"
                .'      "business_pk_id": "01KQCJBPM9JVDTXWV50G2AKXXX",'."\n"
                .'      "name": "updated-video.mp4",'."\n"
                .'      "video_url": "https://example.com/updated-video.mp4"'."\n"
                .'    }'."\n"
                .'  ]'."\n"
                .'}'."\n"
                .'```'."\n"
                ."\n"
                .'##### Case 2: System-generated primary key (pk\\_id)'."\n"
                ."\n"
                .'Assume that when creating a dataset with datasetId 750, the user chose to use the system-generated primary key field pk\\_id. The API routes records based on whether the pk\\_id field is included:'."\n"
                ."\n"
                .'*   **With** pk\\_id: The system treats the record as an update operation and searches the target dataset for data matching the pk\\_id. If a match is found, the update is performed. If no match is found, a 404 error is returned.'."\n"
                .'    '."\n"
                .'*   **Without** pk\\_id: The system treats the record as an add operation and automatically generates a new pk\\_id value for the record.'."\n"
                .'    '."\n"
                ."\n"
                .'**Example scenario 1: Updating an existing record**'."\n"
                ."\n"
                .'The pk\\_id is included. The system finds a matching record in the dataset and performs an update. If no match is found, an error is returned.'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "datasetId": 750,'."\n"
                .'  "records": ['."\n"
                .'    {'."\n"
                .'      "pk_id": "01KQCJBPM9JVDTXWV50G2AKXXX",'."\n"
                .'      "name": "updated-video.mp4",'."\n"
                .'      "video_url": "https://example.com/updated-video.mp4"'."\n"
                .'    }'."\n"
                .'  ]'."\n"
                .'}'."\n"
                .'```'."\n"
                ."\n"
                .'**Example scenario 2: Adding a new record**'."\n"
                ."\n"
                .'The pk\\_id is not included. The system treats the record as a new addition and automatically generates a pk\\_id.'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "datasetId": 750,'."\n"
                .'  "records": ['."\n"
                .'    {'."\n"
                .'      "name": "new-video.mp4",'."\n"
                .'      "video_url": "https://example.com/new-video.mp4"'."\n"
                .'    }'."\n"
                .'  ]'."\n"
                .'}'."\n"
                .'```.',
            'responseParamsDescription' => '### Response example.'."\n"
                ."\n"
                .'#### Success response'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "code": 200,'."\n"
                .'  "message": "success",'."\n"
                .'  "data": {},'."\n"
                .'  "requestId": "1a0f40dd17774641794394269ec0e9"'."\n"
                .'}'."\n"
                ."\n"
                .'```'."\n"
                .'---.'."\n"
                ."\n"
                .'## Error codes'."\n"
                ."\n"
                .'| Error code | message | Description | Recommended action |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| 400 | `datasetId: must not be null` etc. | The request parameters are incomplete or incorrectly formatted. For example, the required `datasetId` parameter is missing. | Check your request to make sure all required parameters are provided and correctly formatted. |'."\n"
                .'| 400 | `Dataset is not ready, current status: {status}` | The target dataset is not ready and cannot receive data. | Wait and retry later, or check the dataset status before performing the operation. |'."\n"
                .'| 400 | `Dataset schema is not configured` | The target dataset does not have a schema configured. | Define and configure the schema for the dataset before uploading data. |'."\n"
                .'| 400 | `Exceeds maximum batch size of 100 records per request` | The number of records in a single request exceeds the limit of 100. | Split your data into batches and make sure each request contains no more than 100 records. |'."\n"
                .'| 400 | `records[{i}] cannot be empty` | A record in the request is empty. | Check the `records` array in the request body to make sure it does not contain empty objects or null values. |'."\n"
                .'| 400 | `records[{i}]: ...` | A record in the request does not conform to the predefined schema. | Based on the error message, check and correct the field names, data types, and other information of the corresponding record. |'."\n"
                .'| 403 | `Dataset is read-only` | The target dataset is in read-only mode and does not allow write or update operations. | Confirm whether you have permissions to modify the dataset, or contact the dataset administrator. |'."\n"
                .'| 403 | `Access denied` | Access is denied, typically due to authentication failure or insufficient permissions. | Check whether your AccessKey or other authentication credentials are correct, and confirm that you have permissions to operate on the resource. |'."\n"
                .'| 404 | `Dataset not found` | The specified dataset does not exist. | Check whether the `datasetId` in the request is correct. |'."\n"
                .'| 404 | `pk_id not found` | The specified dataset exists, but the `pk_id` provided does not exist. | Check whether the corresponding `pk_id` exists in the dataset specified by `datasetId`. |'."\n"
                .'| 500 | `Internal server error` | An unknown internal server error occurred. | Retry later. If the issue persists, contact technical support. |.',
            'changeSet' => [],
            'ramActions' => [],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"code\\": 200,\\n  \\"message\\": \\"success\\",\\n  \\"data\\": [],\\n  \\"requestId\\": \\"1a0f40dd17774641794394269ec0e9\\"\\n}","type":"json"}]',
        ],
        'QaChat' => [
            'summary' => 'Powered by robust multimodal search and comprehension capabilities, build Q&A applications on the CleverSee AI Search & Ask platform to achieve in-depth understanding and precise Q&A over images, documents, and video content in datasets. The platform supports flexible customization of Q&A assistant response styles and interaction modes, enabling rapid adaptation to diverse large-scale data Q&A scenarios. Users can ask questions via text, images, or a combination of both; the platform performs deep semantic understanding across the complete dataset and delivers answers in multiple formats including text, images, and videos. For video assets, the platform also offers templated output capabilities for generating customized content summaries, information extraction, and video scripts.',
            'path' => '/api/v1/platform/app/chat',
            'methods' => ['post'],
            'schemes' => ['https', 'sse'],
            'security' => [
                [
                    'AK' => [],
                ],
                [
                    'ApiKey' => [],
                ],
            ],
            'consumes' => ['application/json'],
            'produces' => ['text/event-stream', 'application/json'],
            'operationType' => 'readAndWrite',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
            'parameters' => [
                [
                    'name' => 'body',
                    'in' => 'body',
                    'style' => 'json',
                    'schema' => [
                        'title' => '',
                        'description' => 'Request body.',
                        'type' => 'object',
                        'properties' => [
                            'appId' => ['title' => '', 'description' => 'Application ID', 'type' => 'string', 'required' => true, 'example' => '2052929167853146113'],
                            'sessionId' => ['title' => '', 'description' => 'Q&A session ID, used to track multiple Q&A interactions from the same user.', 'type' => 'string', 'required' => false, 'example' => 'req_123456789'],
                            'message' => [
                                'title' => '',
                                'description' => 'User message object containing role and multimodal content.',
                                'type' => 'object',
                                'properties' => [
                                    'role' => ['title' => '', 'description' => 'Message role. Currently only supports the `"user"` role.', 'type' => 'string', 'example' => 'user', 'required' => false],
                                    'parts' => [
                                        'title' => '',
                                        'description' => 'Individual content block, differentiated by `type`.',
                                        'type' => 'array',
                                        'items' => [
                                            'title' => '',
                                            'description' => 'Multimodal input object',
                                            'type' => 'object',
                                            'properties' => [
                                                'type' => [
                                                    'title' => '',
                                                    'description' => 'Content block type. Only supports `"text"` / `"file"` / `"data"`.',
                                                    'enumValueTitles' => ['file' => 'file', 'data' => 'data', 'text' => 'text'],
                                                    'type' => 'string',
                                                    'example' => 'text',
                                                    'required' => false,
                                                ],
                                                'text' => ['title' => '', 'description' => 'Required when `type="text"`.'."\n"
                                                    ."\n"
                                                    .'* Text content, maximum 1024 characters.', 'type' => 'string', 'example' => '请问这个视频讲了什么?', 'required' => false],
                                                'url' => ['title' => '', 'description' => 'Required when `type="file"`. Supports the following two types. Supported formats: JPG/PNG/WEBP/JPEG:'."\n"
                                                    ."\n"
                                                    .'• Media resource CDN URL. Currently supports images, up to 5.'."\n"
                                                    .'• Image encoding via base64-encoded string for uploading image files (bitmap formats supported), up to 5.', 'type' => 'string', 'example' => 'https://example.com/img.jpg', 'required' => false],
                                                'mediaType' => ['title' => '', 'description' => 'Required when `type="file"`.'."\n"
                                                    ."\n"
                                                    .'* Media type. Currently only supports image formats JPG/PNG/WEBP/JPEG, up to 5.', 'type' => 'string', 'example' => 'image/png', 'required' => false],
                                                'data' => ['title' => '', 'description' => 'Required when type = "data". The data object structure is as follows:'."\n"
                                                    ."\n"
                                                    .'- type: String type, required. Represents the data subtype. Currently supported value is "template", indicating a video template.'."\n"
                                                    .'- videoId: String type, conditionally required. Only required when type = "template", representing the video template ID. Can be ignored or set to null for other types.', 'type' => 'any', 'example' => '{'."\n"
                                                    .'  "type": "template",'."\n"
                                                    .'  "videoId": "xxxx"'."\n"
                                                    .'}', 'required' => false],
                                            ],
                                            'required' => false,
                                            'example' => '',
                                        ],
                                        'required' => false,
                                        'example' => '',
                                    ],
                                ],
                                'required' => true,
                                'example' => '',
                            ],
                            'options' => ['title' => '', 'description' => 'No input required.', 'type' => 'object', 'required' => false, 'example' => '{'."\n"
                                .'  "debug": true'."\n"
                                .'}'],
                        ],
                        'required' => false,
                        'example' => '',
                    ],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'type' => 'object',
                        'properties' => [
                            'event' => ['title' => '', 'description' => 'Event type descriptions:'."\n"
                                ."\n"
                                .'1. Lifecycle'."\n"
                                .'   - start / finish'."\n"
                                .'   - Mark the beginning and end of a message'."\n"
                                ."\n"
                                .'2. Text content'."\n"
                                .'   - text-start / text-delta / text-end'."\n"
                                .'   - Markdown text streaming output'."\n"
                                ."\n"
                                .'3. Inline media'."\n"
                                .'   - data-image-info / data-video-info'."\n"
                                .'   - Media cards in image-text mixed layout / video-text mixed layout'."\n"
                                ."\n"
                                .'4. Source references'."\n"
                                .'   - data-reference'."\n"
                                .'   - Unified source list (web / document / image / video)'."\n"
                                ."\n"
                                .'5. Inline citations'."\n"
                                .'   - data-document-ref'."\n"
                                .'   - Perplexity-style inline document citations'."\n"
                                ."\n"
                                .'6. Template video'."\n"
                                .'   - data-template-video'."\n"
                                .'   - Video cards output by AV templated agent'."\n"
                                ."\n"
                                .'7. Template analysis'."\n"
                                .'   - data-video-info / data-template-info / data-template-video-content'."\n"
                                .'   - Analysis result data from AV templated agent'."\n"
                                .'   - Table-type templates such as "Speech Transcription", "Video Outline", and "Video-to-Script" are delivered all at once via data-template-video-content'."\n"
                                ."\n"
                                .'8. Streaming JSON'."\n"
                                .'   - json-start / json-delta / json-end'."\n"
                                .'   - Incremental delta-only JSON streaming protocol'."\n"
                                .'   - Used for structured JSON template output analysis results such as "Action Expression"', 'type' => 'string', 'example' => 'start'],
                            'data' => [
                                'title' => '',
                                'description' => 'Protocol data',
                                'type' => 'object',
                                'properties' => [
                                    'errorCode' => ['title' => '', 'description' => 'See error code list', 'type' => 'string', 'example' => '400'],
                                    'errorText' => ['title' => '', 'description' => 'See error code list', 'type' => 'string', 'example' => '参数错误'],
                                    'id' => ['title' => '', 'description' => 'Unique identifier. For multi-segment text, different segments use different IDs while content within the same segment uses the same ID.', 'type' => 'string', 'example' => '2a127bc9-9474-405d-916d-8bc4475fa459'],
                                    'retryable' => ['title' => '', 'description' => 'Whether the error is retryable. Default: true.', 'type' => 'boolean', 'example' => 'true'],
                                    'type' => ['title' => '', 'description' => 'Same as event', 'type' => 'string', 'example' => 'v'],
                                    'data' => ['title' => '', 'description' => 'Structured response data', 'type' => 'string', 'example' => '{'."\n"
                                        .' "items": ['."\n"
                                        .' {'."\n"
                                        .' "title": "电脑产品评测",'."\n"
                                        .' "videoUrl": "https://video.example.com/review.mp4",'."\n"
                                        .' "coverUrl": "https://images.example",'."\n"
                                        .' "tags": ['."\n"
                                        .' "数码产品",'."\n"
                                        .' "评测",'."\n"
                                        .' "电脑",'."\n"
                                        .' "生产力"'."\n"
                                        .' ]'."\n"
                                        .' }'."\n"
                                        .' ]'."\n"
                                        .'}'],
                                    'delta' => ['title' => '', 'description' => 'Incremental text output', 'type' => 'string', 'example' => '如果你想更快看到上身效果,这 3 条短视频会更直观。\\n\\n**第一条:完整通勤 look**\\n\\n3 套通勤到周末无缝切换的浅色运动鞋穿搭。'],
                                    'finishReason' => ['title' => '', 'description' => 'Completion reason. When the value is stop, it indicates the output has ended. When an error occurs, the value indicates the error reason.', 'type' => 'string', 'example' => 'stop'],
                                    'requestId' => ['description' => 'Request ID', 'type' => 'string', 'example' => '2a127bc9-9474-405d-916d-8bc4475fa459'."\n", 'title' => ''],
                                ],
                                'example' => '',
                            ],
                            'id' => ['title' => '', 'description' => 'Request ID, same as requestId', 'type' => 'string', 'example' => '2a127bc9-9474-405d-916d-8bc4475fa459'],
                        ],
                        'description' => '',
                        'title' => '',
                        'example' => '',
                    ],
                ],
            ],
            'staticInfo' => ['returnType' => 'synchronous'],
            'title' => 'AI Q&A Engine API',
            'description' => '[CleverSee AI Search & Ask Platform](https://aisearch.aliyun.com/web-search) intelligent Q&A application streaming interface, supporting multimodal input (text, images, structured data) and streaming output (text, images, videos, source references, etc.). The interface uses the SSE (Server-Sent Events) protocol to push response data, where each data stream is a JSON object and different data types are identified through the `type` field.'."\n"
                ."\n"
                .'### Integration Guide:'."\n"
                ."\n"
                .'An intelligent Q&A streaming interface supporting multimodal input (text, images, structured data) and streaming output (text, images, videos, source references, etc.). The interface uses the SSE (Server-Sent Events) protocol to push response data, where each data stream is a JSON object and different data types are identified through the `type` field.'."\n"
                ."\n"
                .'### Data Sources:'."\n"
                ."\n"
                .'Supports Q&A over videos. Data can be uploaded and updated through the [CleverSee AI Search & Ask Platform](https://aisearch.aliyun.com/web-search) product interface or via the [Dataset Data Create/Update API](https://help.aliyun.com/zh/document_detail/3038471.html?spm=a2c4g.11186623.help-menu-3037946.d_0_2_1_0.54ed1e97NGXVV1&scm=20140722.H_3038471._.OR_help-T_cn~zh-V_1).'."\n"
                ."\n"
                .'# Authentication'."\n"
                ."\n"
                .'Call the CleverSee - Intelligent Q&A service through the Alibaba Cloud SDK. For the detailed call guide, refer to: [AI Q&A Engine API](https://api.aliyun.com/document/AiSearchEngine/2026-04-17/QaChat)',
            'requestParamsDescription' => 'Normal Request Examples'."\n"
                ."\n"
                .'`JSON` Format'."\n"
                ."\n"
                .'### Image-Text Q&A Request'."\n"
                ."\n"
                .'```json'."\n"
                .'  {'."\n"
                .'    "id": "chat-002",'."\n"
                .'    "message": {'."\n"
                .'      "role": "user",'."\n"
                .'      "parts": ['."\n"
                .'        { "type": "text", "text": "Find similar styles to these shoes" },'."\n"
                .'        {'."\n"
                .'          "type": "file",'."\n"
                .'          "url": "https://example.com/image.png",'."\n"
                .'          "mediaType": "image/png"'."\n"
                .'        }'."\n"
                .'      ]'."\n"
                .'    },'."\n"
                .'    "options": { "appId": "app_001" }'."\n"
                .'  }'."\n"
                .'```'."\n"
                ."\n"
                .'### Video Template Request'."\n"
                ."\n"
                .'```json'."\n"
                .'{'."\n"
                .'  "id": "chat-002",'."\n"
                .'  "message": {'."\n"
                .'    "role": "user",'."\n"
                .'    "parts": ['."\n"
                .'      {'."\n"
                .'        "type": "text",'."\n"
                .'        "text": "Summarize this video"'."\n"
                .'      },'."\n"
                .'      {'."\n"
                .'        "type": "data",'."\n"
                .'        "data": {'."\n"
                .'          "type": "template",'."\n"
                .'          "videoId": "vid_001"'."\n"
                .'        }'."\n"
                .'      }'."\n"
                .'    ]'."\n"
                .'  },'."\n"
                .'  "options": {'."\n"
                .'    "appId": "app_001"'."\n"
                .'  }'."\n"
                .'}'."\n"
                .'```',
            'responseParamsDescription' => 'The response is pushed frame by frame as an SSE stream. Each frame is a JSON object and must contain a `type` field to identify the current data block type.'."\n"
                ."\n"
                .'### Data Block Type Overview'."\n"
                ."\n"
                .'| **Type Category** | **Data Block Type** | **Description** |'."\n"
                .'| --- | --- | --- |'."\n"
                .'| Message start and end | `start`, `finish` | Mark the beginning and end of a message |'."\n"
                .'| Text streaming response | `text-start`, `text-delta`, `text-end` | Markdown text streaming output |'."\n"
                .'| ### Image-text-video mixed layout response | `data-image-info`, `data-video-ref` | Media cards in image-text mixed / video-text mixed layout |'."\n"
                .'| ### Video Q&A application response (template output type) | `data-template-info`, `data-template-video-content` | Video cards output by AV templated agent |'."\n"
                .'| Response source references | `data-reference` | Unified source list (document/image/video) |'."\n"
                ."\n"
                .'### Message Start and End'."\n"
                ."\n"
                .'The complete message lifecycle follows this order:'."\n"
                ."\n"
                .'```plaintext'."\n"
                .'start → content blocks (multiple allowed, can alternate) → finish'."\n"
                .'```'."\n"
                ."\n"
                .'Steps:'."\n"
                ."\n"
                .'1. `start`: Message start, carries `messageId`.'."\n"
                .'2. Content blocks (`text-*`, `data-*`, etc., multiple allowed, can alternate).'."\n"
                .'3. `finish`: Message end, carries `finishReason`.'."\n"
                ."\n"
                .'#### Message Start `**start**`'."\n"
                ."\n"
                .'Marks the beginning of a new message.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `type` | string | Yes | Fixed value `start` |'."\n"
                .'| `messageId` | string | Yes | Unique message identifier |'."\n"
                ."\n"
                .'#### Message End `**finish**`'."\n"
                ."\n"
                .'Marks the end of a message, carrying the completion reason.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `type` | string | Yes | Fixed value `finish` |'."\n"
                .'| `finishReason` | string | Yes | Completion reason, e.g., `stop` (normal completion), `error` (abnormal termination) |'."\n"
                ."\n"
                .'### Text Streaming Response'."\n"
                ."\n"
                .'Text content output uses streaming chunked delivery. A complete text paragraph consists of `text-start` → multiple `text-delta` → `text-end`. Multiple text blocks can alternate with media blocks to achieve image-text mixed layout or video-text mixed layout.'."\n"
                ."\n"
                .'1. `text-start`: Marks the beginning of a text block, carrying its unique `id`.'."\n"
                .'2. `text-delta`: Pushes incremental text content. The same `id` may appear multiple times; the client should concatenate in order.'."\n"
                .'3. `text-end`: Marks the end of a text block.'."\n"
                ."\n"
                .'#### text-start'."\n"
                ."\n"
                .'Marks the beginning of a text block.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `type` | string | Yes | Fixed value `text-start` |'."\n"
                .'| `id` | string | Yes | Unique text block identifier |'."\n"
                ."\n"
                .'#### text-delta'."\n"
                ."\n"
                .'Incremental text content, supporting Markdown format. Multiple `text-delta` events may be pushed for the same text block; the client should concatenate them in order.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `type` | string | Yes | Fixed value `text-delta` |'."\n"
                .'| `id` | string | Yes | Associated text block identifier |'."\n"
                .'| `delta` | string | Yes | Incremental Markdown text content for this event |'."\n"
                ."\n"
                .'#### text-end'."\n"
                ."\n"
                .'Marks the end of a text block.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `type` | string | Yes | Fixed value `text-end` |'."\n"
                .'| `id` | string | Yes | Associated text block identifier |'."\n"
                ."\n"
                .'### Image-Text-Video Mixed Layout Response'."\n"
                ."\n"
                .'Text blocks and media blocks can alternate in output, creating a mixed layout effect. A typical sequence is:'."\n"
                ."\n"
                .'```plaintext'."\n"
                .'text-start → text-delta → text-end → data-image-info → text-start → text-delta → text-end → data-video-info → ...'."\n"
                .'```'."\n"
                ."\n"
                .'#### Image-Text Mixed Layout Q&A Response `data-image-info`'."\n"
                ."\n"
                .'Description: Inline image cards in image-text mixed layout, interspersed between text blocks.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| type | String | Yes | Fixed value `"data-image-info"` |'."\n"
                .'| data | Object | Yes | Image data object |'."\n"
                .'| ├─ id | String | Yes | Unique image ID |'."\n"
                .'| ├─ imageUrl | String | Yes | Image URL |'."\n"
                .'| └─ name | String | Yes | Image name/title |'."\n"
                ."\n"
                .'#### Video-Text Mixed Layout Q&A Response `data-video-ref`'."\n"
                ."\n"
                .'Description: Inline video cards in video-text mixed layout, interspersed between text blocks.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| type | String | Yes | Fixed value `"data-video-ref"` |'."\n"
                .'| data | Object | Yes | Video data object |'."\n"
                .'| ├─ id | String | Yes | Unique video/segment ID |'."\n"
                .'| ├─videoId | String | Yes | Unique video ID |'."\n"
                .'| ├─videoType | String | Yes | segment - clip, raw - video |'."\n"
                .'| ├─ videoUrl | String | Yes | Video/segment URL |'."\n"
                .'| ├─ name | String | Yes | Video name/title |'."\n"
                .'| ├─fullVideoUrl | String | No | Full video URL |'."\n"
                .'| ├─start | String | No | Segment start time |'."\n"
                .'| ├─end | String | No | Segment end time |'."\n"
                .'| └─ coverUrl | String | Yes | Video cover image URL |'."\n"
                ."\n"
                .'### Video Q&A Application Response (Template Output Type)'."\n"
                ."\n"
                .'| **Template Type** | **Template Name** | **Output Format** |'."\n"
                .'| --- | --- | --- |'."\n"
                .'| Platform Template | Action Expression, Sports Highlights, Key Knowledge Points | Streaming JSON |'."\n"
                .'| | Video Outline, Video-to-Script, Speech Transcription | Structured JSON Output |'."\n"
                .'| | Plot Understanding, Meeting Minutes | Markdown |'."\n"
                .'| Custom Template | Custom Template | Default Markdown output, configurable as needed |'."\n"
                ."\n"
                .'#### Video Information `**data-video-info**`'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| type | String | Yes | Fixed value `"data-template-video"` |'."\n"
                .'| data | Object | Yes | Video information data object |'."\n"
                .'| ├─ coverUrl | string | Yes | Video cover image URL |'."\n"
                .'| ├─ keywords | string | Yes | Video keyword tags (comma-separated) |'."\n"
                .'| ├─ videoUrl | string | Yes | Original video file URL |'."\n"
                .'| ├─ sourceType | string | Yes | Content source type (fixed value "video") |'."\n"
                .'| ├─ videoType | string | Yes | Video storage type (raw indicates original video) |'."\n"
                .'| ├─ name | string | Yes | Video file name |'."\n"
                .'| └─ id | string | Yes | Unique video resource identifier (video ID) |'."\n"
                ."\n"
                .'#### Platform Template Information `**data-template-info**`'."\n"
                ."\n"
                .'Platform preset templates include:'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| type | String | Yes | Fixed value `"data-template-info"` |'."\n"
                .'| data | Object | Yes | Data object |'."\n"
                .'| └─ templateName | string | Yes | Template name, e.g., "Video-to-Script" |'."\n"
                .'| └─ templateId | string | Yes | Template ID, e.g., `"tpl-3"`. For custom templates, the template ID is `"custom"`. |'."\n"
                ."\n"
                .'#### Custom Template `**data-template-video-content**`'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| type | String | Yes | Fixed value `"data-template-video-content"` |'."\n"
                .'| data | Object | Yes | Custom structured data object |'."\n"
                .'| ├─ header | Object | Yes | Header definition, `Record<string, string>` type. Key is the column identifier, value is the column display name, e.g., `{"content_summary": "Content Summary"}` |'."\n"
                .'| └─ list | Array\\[Object\\] | Yes | Specific content. Each row is an open-ended key-value pair (`[key: string]: string \\| number`), which can be dynamically rendered according to `header`. Different templates use different field subsets. |'."\n"
                ."\n"
                .'Common list fields are as follows:'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `start` | number | No | Segment start time (seconds) |'."\n"
                .'| `end` | number | No | Segment end time (seconds) |'."\n"
                .'| `title` | string | No | Section title (Video Outline template `tpl-2`) |'."\n"
                .'| `summary` | string | No | Section summary (Video Outline template `tpl-2`) |'."\n"
                .'| `content_summary` | string | No | Content summary (Video-to-Script and similar templates) |'."\n"
                .'| `transcription` | string | No | Transcription text (Speech Transcription template) |'."\n"
                .'| `director_prompt` | string | No | Director prompt (Video-to-Script template) |'."\n"
                .'| `shot_size` | string | No | Shot size: long / medium / close-up / extreme close-up, etc. |'."\n"
                .'| `remarks` | string | No | Remarks |'."\n"
                ."\n"
                .'> Note: The keys in `header` correspond one-to-one with the keys in `list[ ]` rows (e.g., the Video Outline template\'s header is `{ start, end, title, summary }`). The specific fields are determined by the backend template; the table above only lists common fields.'."\n"
                ."\n"
                .'#### Streaming JSON'."\n"
                ."\n"
                .'In templated agent scenarios, analysis results are delivered incrementally as JSON strings via streaming (delta-only protocol). A complete JSON segment consists of three separate events: `json-start` → multiple `json-delta` → `json-end`, all sharing the same `id`. The frontend concatenates each `delta` in order to reconstruct the complete JSON string, then parses it with `JSON.parse`.'."\n"
                ."\n"
                .'##### Output Start `**json-start**`'."\n"
                ."\n"
                .'Marks the beginning of a streaming JSON segment.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `type` | string | Yes | Fixed value `json-start` |'."\n"
                .'| `id` | string | Yes | Unique JSON segment identifier |'."\n"
                ."\n"
                .'##### Output Increment `**json-delta**`'."\n"
                ."\n"
                .'Incremental JSON string fragment. Multiple events may be pushed for the same `id`; the client should concatenate them in order.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `type` | string | Yes | Fixed value `json-delta` |'."\n"
                .'| `id` | string | Yes | Associated JSON segment identifier |'."\n"
                .'| `delta` | string | Yes | Incremental JSON string fragment for this event |'."\n"
                ."\n"
                .'##### Output End `**json-end**`'."\n"
                ."\n"
                .'Marks the end of a streaming JSON segment. At this point, the frontend should parse the accumulated string as complete JSON.'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `type` | string | Yes | Fixed value `json-end` |'."\n"
                .'| `id` | string | Yes | Associated JSON segment identifier |'."\n"
                ."\n"
                .'> Note: The `id` and `type` fields are placed directly at the top level of the event (consistent with the `text-*` protocol) and are **not** nested within the `data` field.'."\n"
                ."\n"
                .'##### Video Template Applicability Assessment JSON Structure'."\n"
                ."\n"
                .'In the Q&A templated output agent scenario, the complete JSON assembled from the `json-*` stream is the structured analysis result for the corresponding template. The outermost JSON schema is determined by the matched `templateId` (see `data-template-info` above). Common structure examples are as follows:'."\n"
                ."\n"
                .'**General fields:**'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `applicable` | boolean | Yes | Whether the current video is applicable to this template. When `false`, other business fields may be empty. |'."\n"
                .'| `content_type` | string | No | Content category determined by the template, e.g., `"Movie/TV drama performance segment"` |'."\n"
                ."\n"
                .'**Example: "Action Expression" template (`templateId = tpl-8`)**'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `actions` | array | Yes | Array of action segments in chronological order |'."\n"
                ."\n"
                .'`**actions[ ]**` **elements:**'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| `start` | number | Yes | Segment start time (seconds) |'."\n"
                .'| `end` | number | Yes | Segment end time (seconds) |'."\n"
                .'| `subject` | string | Yes | Action subject, e.g., `"police officer"`, `"elderly woman"` |'."\n"
                .'| `action` | string | Yes | Action description (body movement/expression/behavior) |'."\n"
                .'| `intensity` | string | Yes | Action/emotional intensity, e.g., `"tough, serious"`, `"desperate, fearful"` |'."\n"
                .'| `context` | string | Yes | Scene context and camera/emotional description |'."\n"
                ."\n"
                .'> Note: Different templates correspond to different JSON schemas (e.g., "Key Knowledge Points", "Meeting Minutes" use other fields). The table above only demonstrates the "Action Expression" template. The parsing structure can be dynamically selected based on `data-template-info.templateId`.'."\n"
                ."\n"
                .'### Response Source References'."\n"
                ."\n"
                .'### `data-reference`'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| type | String | Yes | Fixed value `"data-reference"` |'."\n"
                .'| data | Object | Yes | Data object |'."\n"
                .'| └─ items | Array\\[Object\\] | Yes | Source item array (see subtypes below) |'."\n"
                ."\n"
                .'> ️ The structure of each element in `items[]` varies by `sourceType` as follows:'."\n"
                ."\n"
                .'---'."\n"
                ."\n"
                .'### When the referenced object is a document `sourceType = "document"`'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| sourceType | String | Yes | Fixed value `"document"` |'."\n"
                .'| fileName | String | Yes | Source file name |'."\n"
                .'| fileType | String | Yes | File format (pdf/docx/txt/md/url, etc.) |'."\n"
                .'| chunkContent | String | Yes | Retrieved segment content |'."\n"
                .'| score | Number | Yes | Retrieval score |'."\n"
                ."\n"
                .'---'."\n"
                ."\n"
                .'### When the referenced object is an image `sourceType = "image"`'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| sourceType | String | Yes | Fixed value `"image"` |'."\n"
                .'| datasetName | String | Yes | Source image dataset name |'."\n"
                .'| thumbnailUrl | String | Yes | Thumbnail URL |'."\n"
                .'| imageUrl | String | Yes | Original image URL |'."\n"
                ."\n"
                .'---'."\n"
                ."\n"
                .'### When the referenced object is a video segment `sourceType = "video"`'."\n"
                ."\n"
                .'| **Parameter** | **Type** | **Required** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| sourceType | String | Yes | Fixed value `"video"` |'."\n"
                .'| videoSource | String | Yes | Video source name |'."\n"
                .'| videoUrl | String | Yes | Video URL |'."\n"
                .'| clipTimeRange | String | Yes | Segment time range (e.g., "01:23-02:45") |'."\n"
                ."\n"
                .'## Response Examples'."\n"
                ."\n"
                .'### Normal Response Examples'."\n"
                ."\n"
                .'`JSON` Format'."\n"
                ."\n"
                .'#### Image Q&A Response'."\n"
                ."\n"
                .'The following is a streaming output example within an image Q&A application, with image-text mixed layout.'."\n"
                ."\n"
                .'```plaintext'."\n"
                .'  data: {"type":"start","messageId":"msg-001"}'."\n"
                ."\n"
                .'  data: {"type":"text-start","id":"text-1"}'."\n"
                ."\n"
                .'  data: {"type":"text-delta","id":"text-1","delta":"Choose by style: Sporty VS Casual\\n\\n"}'."\n"
                ."\n"
                .'  data: {"type":"text-delta","id":"text-1","delta":"**Sporty style** — Combining vitality and comfort"}'."\n"
                ."\n"
                .'  data: {"type":"text-end","id":"text-1"}'."\n"
                ."\n"
                .'  data: {"type":"data-image-info","data":{"id":"img-001","imageUrl":"https://cdn.example.com/i1.jpg","name":"Sporty style - Color-block sneakers"}}'."\n"
                ."\n"
                .'  data: {"type":"text-start","id":"text-2"}'."\n"
                ."\n"
                .'  data: {"type":"text-delta","id":"text-2","delta":"**Casual style** — Simple, timeless, and versatile"}'."\n"
                ."\n"
                .'  data: {"type":"text-end","id":"text-2"}'."\n"
                ."\n"
                .'  data: {"type":"data-image-info","data":{"id":"img-002","imageUrl":"https://cdn.example.com/i2.jpg","name":"Casual style - Solid-color casual shoes"}}'."\n"
                ."\n"
                .'  data: {"type":"data-reference","data":{"items":['."\n"
                .'    {"sourceType":"document","fileName":"Sneaker Comfort Evaluation Report.docx","fileType":"docx","chunkContent":"In the mid-range price segment, lightweight and breathable materials are gradually becoming mainstream...","score":0.87},'."\n"
                .'    {"sourceType":"image","datasetName":"Product Image Dataset","thumbnailUrl":"https://cdn.example.com/i2-thumb.jpg","imageUrl":"https://cdn.example.com/i2.jpg"}'."\n"
                .'  ]}}'."\n"
                ."\n"
                .'  data: {"type":"finish","finishReason":"stop"}'."\n"
                .'```'."\n"
                ."\n"
                .'#### Video Q&A Response (Video-Text Mixed Layout)'."\n"
                ."\n"
                .'The following is a streaming output example within a video Q&A application (conversational type), with video-text mixed layout.'."\n"
                ."\n"
                .'```plaintext'."\n"
                .'data:{"id":"mock-session-001","type":"start","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-start","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":"The video"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" showcases"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" hanging"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" decorative"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" ornaments"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" and presents"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" their texture"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" details"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" through"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" close-up"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":" shots"}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":""}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-delta","requestId":"mock-request-001","delta":""}'."\n"
                ."\n"
                .'data:{"id":"text-block-001","type":"text-end","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'data:{"id":"video-ref-001","type":"data-video-ref","requestId":"mock-request-001","data":{"coverUrl":"https://.../cover_frame.jpg?Expires=...","videoUrl":"https://.../demo_video.mp4?Expires=...","sourceType":"video","name":"sample_video.mp4","start":"0.00","datasetId":"DATASET_001","end":"10.00","id":"video-001"}}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-start","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":". To"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" demonstrate"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" the usage"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" effect,"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" the video"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" shows"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" the placement"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" of the"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" ornament"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" in indoor"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" and"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" desktop"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":" settings"}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":""}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-delta","requestId":"mock-request-001","delta":""}'."\n"
                ."\n"
                .'data:{"id":"text-block-002","type":"text-end","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'data:{"id":"video-ref-002","type":"data-video-ref","requestId":"mock-request-001","data":{"coverUrl":"https://.../cover_frame_02.jpg?Expires=...","videoUrl":"https://.../demo_video.mp4?Expires=...","sourceType":"video","name":"sample_video.mp4","start":"10.00","datasetId":"DATASET_001","end":"20.00","id":"video-001"}}'."\n"
                ."\n"
                .'data:{"id":"text-block-003","type":"text-start","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'data:{"id":"text-block-003","type":"text-delta","requestId":"mock-request-001","delta":"."}'."\n"
                ."\n"
                .'data:{"id":"text-block-003","type":"text-end","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'data:{"id":"reference-001","type":"data-reference","requestId":"mock-request-001","data":{"items":[{"coverUrl":"https://.../cover_frame.jpg?Expires=...","videoUrl":"https://.../demo_video.mp4?Expires=...","sourceType":"video","name":"sample_video.mp4","start":"10.00","datasetId":"DATASET_001","end":"20.00","id":"video-001"}]}}'."\n"
                ."\n"
                .'data:{"id":"mock-session-001","type":"finish","requestId":"mock-request-001","finishReason":"stop"}'."\n"
                .'```'."\n"
                ."\n"
                .'#### Video Template Response'."\n"
                ."\n"
                .'The following are output examples of different template types within a Q&A application (template output type).'."\n"
                ."\n"
                .'##### Streaming JSON (Action Expression, Sports Highlights, Key Knowledge Points)'."\n"
                ."\n"
                .'```markdown'."\n"
                .'id:mock-msg-default-001'."\n"
                .'event:start'."\n"
                .'data:{"id":"mock-msg-default-001","type":"start","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'id:mock-video-info-001'."\n"
                .'event:data-video-info'."\n"
                .'data:{"id":"mock-video-info-001","type":"data-video-info","requestId":"mock-request-001","data":{"coverUrl":"https://example.com/mock/cover.jpg","keywords":"Team collaboration,Product demo,User experience,Feature highlights","videoUrl":"https://example.com/mock/video.mp4","sourceType":"video","videoType":"raw","name":"demo-video.mp4","id":"mock-video-id-001"}}'."\n"
                ."\n"
                .'id:mock-template-info-001'."\n"
                .'event:data-template-info'."\n"
                .'data:{"id":"mock-template-info-001","type":"data-template-info","requestId":"mock-request-001","data":{"templateName":"Action Expression","templateId":"tpl-demo-001"}}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-start'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-start","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"{"}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n  \\"applicable\\": true,"}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n  \\"content_type\\": \\"Product demo segment\\","}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n  \\"actions\\": ["}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n    {"}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n      \\"start\\": 0.0,"}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n      \\"end\\": 10.0,"}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n      \\"subject\\": \\"Presenter\\","}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n      \\"action\\": \\"Walks to the display area and introduces core features\\","}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n      \\"intensity\\": \\"Natural, clear\\","}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n      \\"context\\": \\"Helps the audience understand product highlights through steady narration\\""}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n    }"}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n  ]"}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-delta'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-delta","requestId":"mock-request-001","delta":"\\n}"}'."\n"
                ."\n"
                .'id:mock-json-stream-001'."\n"
                .'event:json-end'."\n"
                .'data:{"id":"mock-json-stream-001","type":"json-end","requestId":"mock-request-001"}'."\n"
                .'```'."\n"
                ."\n"
                .'##### Structured JSON Output (Video Outline, Video-to-Script, Speech Transcription)'."\n"
                ."\n"
                .'```markdown'."\n"
                .'id:mock-start-001'."\n"
                .'event:start'."\n"
                .'data:{"id":"mock-start-001","type":"start","requestId":"mock-request-001"}'."\n"
                ."\n"
                .'id:video-info-001'."\n"
                .'event:data-video-info'."\n"
                .'data:{"id":"video-info-001","type":"data-video-info","requestId":"mock-request-001","data":{"coverUrl":"https://.../cover_frame.jpg?Expires=...","keywords":"Character interaction,Event scene,Life sharing,Casual interaction","videoUrl":"https://.../sample_video.mp4?Expires=...","sourceType":"video","videoType":"raw","name":"sample_video.mp4","id":"VIDEO_ID_001"}}'."\n"
                ."\n"
                .'id:template-info-001'."\n"
                .'event:data-template-info'."\n"
                .'data:{"id":"template-info-001","type":"data-template-info","requestId":"mock-request-001","data":{"templateName":"Video-to-Script","templateId":"tpl-demo-001"}}'."\n"
                ."\n"
                .'id:template-content-001'."\n"
                .'event:data-template-video-content'."\n"
                .'data:{"id":"template-content-001","type":"data-template-video-content","requestId":"mock-request-001","data":{"header":{"shot_size":"Shot Size","director_prompt":"Director Prompt","content_summary":"Content Summary","transcription":"Transcription","remarks":"Remarks","start":"Start Time","end":"End Time"},"list":['."\n"
                ."\n"
                .'  {"content_summary":"Several young people walk and chat at an outdoor event.","transcription":"Male voice introduces the event schedule in a relaxed and natural tone, accompanied by ambient sounds.","director_prompt":"Follow the person\'s movement then switch to a frontal shot","shot_size":"Medium shot","start":0.0,"end":10.0,"remarks":"Natural lighting in the scene, with a relaxed and cheerful atmosphere among the surrounding crowd."},'."\n"
                ."\n"
                .'  {"content_summary":"The host introduces the event flow to the audience at an indoor venue.","transcription":"Male voice explains the upcoming interactive session in a steady and rhythmic tone.","director_prompt":"Slow push-in","shot_size":"Medium shot","start":10.0,"end":20.0,"remarks":"Warm color tones in the frame, with attentive audience expressions and a clean, bright venue setup."},'."\n"
                ."\n"
                .'  {"content_summary":"An elder engages in conversation with young people indoors.","transcription":"The elder speaks in a gentle tone, sharing life experiences and advice.","director_prompt":"Slow push-in","shot_size":"Medium shot","start":20.0,"end":30.0,"remarks":"Warm scene tones with natural character interactions."},'."\n"
                ."\n"
                .']}}'."\n"
                ."\n"
                .'id:mock-start-001'."\n"
                .'event:finish'."\n"
                .'data:{"id":"mock-start-001","type":"finish","requestId":"mock-request-001","finishReason":"stop"}'."\n"
                .'```'."\n"
                ."\n"
                .'##### Markdown Format (Plot Understanding, Meeting Minutes, Custom Template)'."\n"
                ."\n"
                .'```plaintext'."\n"
                .'data: {"type":"start","messageId":"mock-msg-default-001"}'."\n"
                ."\n"
                .'data: {"type":"start-step"}'."\n"
                ."\n"
                .'data: {"type":"data-template-info","data":{"items":[{"title":"MacBook Neo In-Depth Review: Comprehensive Excellence, the Lightest Productivity","videoUrl":"https://video.example.com/macbook-neo-review.mp4","coverUrl":"https://images.unsplash.com/photo-1529139574466-a303027c1d8b?auto=format&fit=crop&w=800&q=80","tags":["Digital Products","Review","MacBook","Productivity"]}]}}'."\n"
                ."\n"
                .'data: {"id":"b43b71c8-dcf0-4597-b1e8-3b7b7599f73e","type":"data-template-info","requestId":"1e78148a17782391368705400d119a","data":{"templateName":"Video-to-Script","templateId":"tpl-3"}}'."\n"
                ."\n"
                .'data: {"type":"text-start","id":"text-video-summary-001"}'."\n"
                ."\n"
                .'data: {"type":"text-delta","id":"text-video-summary-001","delta":"## Video Content Summary\\n\\n### 1. MacBook Neo In-Depth Review\\n\\n- **Key Highlights**: New M4 Ultra chip, 32% single-core performance improvement, total weight only 1.24kg\\n- **Battery Performance**: Video playback battery life up to 22 hours, daily office use can last two full workdays\\n- **Drawbacks**: Still only 3 USB-C ports, no SD card slot\\n\\n> Target Audience: Creative professionals seeking slim and portable solutions"}'."\n"
                ."\n"
                .'data: {"type":"text-end","id":"text-video-summary-001"}'."\n"
                ."\n"
                .'data: {"type":"finish-step"}'."\n"
                ."\n"
                .'data: {"type":"finish","finishReason":"stop"}'."\n"
                ."\n"
                .'```'."\n"
                ."\n"
                .'### Rejection Response Example'."\n"
                ."\n"
                .'`JSON` Format'."\n"
                ."\n"
                .'```plaintext'."\n"
                .'data: {"type":"start","messageId":"mock-msg-default-001"}'."\n"
                ."\n"
                .'data: {"type":"text-start","id":"text-default-part1"}'."\n"
                ."\n"
                .'data: {"type":"text-delta","id":"text-default-part1","delta":"Sorry, this topic is beyond my scope of response. Please feel free to ask me other questions."}'."\n"
                ."\n"
                .'data: {"type":"text-end","id":"text-default-part1"}'."\n"
                ."\n"
                .'data: {"type":"finish","finishReason":"stop"}'."\n"
                .'```'."\n"
                ."\n"
                .'## Error Codes'."\n"
                ."\n"
                .'| **HTTP Status Code** | **Error Code** | **Error Message** | **Description** |'."\n"
                .'| --- | --- | --- | --- |'."\n"
                .'| 401 | `APP_ID_REQUIRED` | `appId is required` | Missing application ID |'."\n"
                .'| 402 | `INVALID_ROLE` | `message role must be user` | Invalid message role |'."\n"
                .'| 403 | `APP_NOT_FOUND` | `app not found` | Application not found |'."\n"
                .'| 404 | `INPUT_TOO_LONG` | `input text exceeds maximum length` | Input text is too long, exceeding the maximum length limit (1024 characters) |'."\n"
                .'| 405 | `IMAGE_LIMIT_EXCEEDED` | `image count exceeds maximum limit` | Number of uploaded images exceeds the maximum limit of 5 |'."\n"
                .'| 500 | `SYSTEM_ERROR` | `system error` | System error |'."\n"
                .'| 700 | `FORBIDDEN` | `no permission to access this app` | No permission to access this application |'."\n"
                ."\n"
                .'# Pre-signed URL API for Multimedia Resources (Images, Videos) in Search Results'."\n"
                ."\n"
                .'To obtain data URL links within datasets and download them, please refer to [Pre-signed URL API for Multimedia Resources (Images, Videos) in Search Results](https://help.aliyun.com/zh/document_detail/3039566.html?spm=a2c4g.11186623.help-menu-3037946.d_0_2_1_1.2d961e97iV5opr&scm=20140722.H_3039566._.OR_help-T_cn~zh-V_1)',
            'changeSet' => [],
            'ramActions' => [
                [
                    'operationType' => 'create',
                    'ramAction' => [
                        'action' => 'aisearchengine:QaChat',
                        'authLevel' => 'operate',
                        'actionConditions' => [],
                        'resources' => [
                            ['validationType' => 'always', 'product' => 'AiSearchEngine', 'resourceType' => 'All Resource', 'arn' => '*'],
                        ],
                    ],
                ],
            ],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"event\\": \\"start\\",\\n  \\"data\\": {\\n    \\"errorCode\\": \\"400\\",\\n    \\"errorText\\": \\"参数错误\\",\\n    \\"id\\": \\"2a127bc9-9474-405d-916d-8bc4475fa459\\",\\n    \\"retryable\\": true,\\n    \\"type\\": \\"v\\",\\n    \\"data\\": \\"{\\\\n \\\\\\"items\\\\\\": [\\\\n {\\\\n \\\\\\"title\\\\\\": \\\\\\"电脑产品评测\\\\\\",\\\\n \\\\\\"videoUrl\\\\\\": \\\\\\"https://video.example.com/review.mp4\\\\\\",\\\\n \\\\\\"coverUrl\\\\\\": \\\\\\"https://images.example\\\\\\",\\\\n \\\\\\"tags\\\\\\": [\\\\n \\\\\\"数码产品\\\\\\",\\\\n \\\\\\"评测\\\\\\",\\\\n \\\\\\"电脑\\\\\\",\\\\n \\\\\\"生产力\\\\\\"\\\\n ]\\\\n }\\\\n ]\\\\n}\\",\\n    \\"delta\\": \\"如果你想更快看到上身效果,这 3 条短视频会更直观。\\\\\\\\n\\\\\\\\n**第一条:完整通勤 look**\\\\\\\\n\\\\\\\\n3 套通勤到周末无缝切换的浅色运动鞋穿搭。\\",\\n    \\"finishReason\\": \\"stop\\",\\n    \\"requestId\\": \\"2a127bc9-9474-405d-916d-8bc4475fa459\\\\n\\"\\n  },\\n  \\"id\\": \\"2a127bc9-9474-405d-916d-8bc4475fa459\\"\\n}","type":"json"}]',
        ],
    ],
    'endpoints' => [
        ['regionId' => 'cn-hangzhou', 'regionName' => 'China (Hangzhou)', 'areaId' => 'asiaPacific', 'areaName' => 'Asia Pacific', 'public' => 'aisearchengine.aliyuncs.com', 'endpoint' => 'aisearchengine.aliyuncs.com', 'vpc' => ''],
    ],
    'errorCodes' => [],
    'changeSet' => [],
    'ram' => [
        'productCode' => 'AiSearchEngine',
        'productName' => 'AiSearchEngine',
        'ramCodes' => ['aisearchengine'],
        'ramLevel' => 'OPERATION',
        'ramConditions' => [],
        'ramActions' => [
            [
                'apiName' => 'QaChat',
                'description' => '',
                'operationType' => 'create',
                'ramAction' => [
                    'action' => 'aisearchengine:QaChat',
                    'authLevel' => 'operate',
                    'actionConditions' => [],
                    'resources' => [
                        ['validationType' => 'always', 'product' => 'AiSearchEngine', 'resourceType' => 'All Resource', 'arn' => '*'],
                    ],
                ],
            ],
            [
                'apiName' => 'EngineSearch',
                'description' => '',
                'operationType' => 'create',
                'ramAction' => [
                    'action' => 'aisearchengine:EngineSearch',
                    'authLevel' => 'operate',
                    'actionConditions' => [],
                    'resources' => [
                        ['validationType' => 'always', 'product' => 'AiSearchEngine', 'resourceType' => 'All Resource', 'arn' => '*'],
                    ],
                ],
            ],
        ],
        'resourceTypes' => [],
    ],
];