tencentcloud-sdk-nodejs-intl-en 3.0.1461 → 3.0.1463

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1432 @@
1
+ /*
2
+ * Copyright (c) 2018 Tencent. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing,
11
+ * software distributed under the License is distributed on an
12
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13
+ * KIND, either express or implied. See the License for the
14
+ * specific language governing permissions and limitations
15
+ * under the License.
16
+ */
17
+ const AbstractModel = require("../../common/abstract_model");
18
+
19
+ /**
20
+ * Result payload
21
+ * @class
22
+ */
23
+ class SearchResultPayload extends AbstractModel {
24
+ constructor(){
25
+ super();
26
+
27
+ /**
28
+ * <p>Additional information of knowledge graph (JSON string)</p>
29
+ * @type {string || null}
30
+ */
31
+ this.GraphData = null;
32
+
33
+ /**
34
+ * <p>List of hit image URLs</p>
35
+ * @type {Array.<string> || null}
36
+ */
37
+ this.ImageUrlList = null;
38
+
39
+ /**
40
+ * <p>Table additional information (JSON string)</p>
41
+ * @type {string || null}
42
+ */
43
+ this.SheetInfo = null;
44
+
45
+ }
46
+
47
+ /**
48
+ * @private
49
+ */
50
+ deserialize(params) {
51
+ if (!params) {
52
+ return;
53
+ }
54
+ this.GraphData = 'GraphData' in params ? params.GraphData : null;
55
+ this.ImageUrlList = 'ImageUrlList' in params ? params.ImageUrlList : null;
56
+ this.SheetInfo = 'SheetInfo' in params ? params.SheetInfo : null;
57
+
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Retrieval request context info
63
+ * @class
64
+ */
65
+ class SearchContext extends AbstractModel {
66
+ constructor(){
67
+ super();
68
+
69
+ /**
70
+ * <p>Request source<table><tbody><tr><td>Enumeration item</td><td>Enumeration value</td><td>Description</td></tr><tr><td>CALL_SOURCE_UNSPECIFIED</td><td>0</td><td></td></tr><tr><td>CALL_SOURCE_RAG</td><td>1</td><td>Standard mode</td></tr><tr><td>CALL_SOURCE_WORKFLOW</td><td>2</td><td>Workflow</td></tr><tr><td>CALL_SOURCE_PLUGIN</td><td>3</td><td>Plug-in</td></tr><tr><td>CALL_SOURCE_OPENCLAW</td><td>4</td><td>openclaw</td></tr><tr><td>CALL_SOURCE_RECALL_TEST</td><td>5</td><td>Recall test</td></tr><tr><td>CALL_SOURCE_RECALL_TEST_DIFF</td><td>6</td><td>Recall test in comparison scenarios also needs to trigger the retrieval interface. The difference is that in this case, the frontend does not need to update the latest configuration. Because when comparing 1, 2, and 3, the final saved one may be 2.</td></tr></tbody></table></p>
71
+ * @type {number || null}
72
+ */
73
+ this.CallSource = null;
74
+
75
+ /**
76
+ * <p>adp DOMAIN: 1=development DOMAIN, 2=production DOMAIN<table><tbody><tr><td>Enumeration item</td><td>Enumeration value</td><td>Description</td></tr><tr><td>adp_DOMAIN_UNSPECIFIED</td><td>0</td><td>not specified</td></tr><tr><td>adp_DOMAIN_DEV</td><td>1</td><td>development DOMAIN</td></tr><tr><td>adp_DOMAIN_PROD</td><td>2</td><td>production DOMAIN</td></tr></tbody></table></p>
77
+ * @type {number || null}
78
+ */
79
+ this.Domain = null;
80
+
81
+ /**
82
+ * <p>Visitor ID</p>
83
+ * @type {string || null}
84
+ */
85
+ this.VisitorId = null;
86
+
87
+ }
88
+
89
+ /**
90
+ * @private
91
+ */
92
+ deserialize(params) {
93
+ if (!params) {
94
+ return;
95
+ }
96
+ this.CallSource = 'CallSource' in params ? params.CallSource : null;
97
+ this.Domain = 'Domain' in params ? params.Domain : null;
98
+ this.VisitorId = 'VisitorId' in params ? params.VisitorId : null;
99
+
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Common key-value pair
105
+ * @class
106
+ */
107
+ class KVPair extends AbstractModel {
108
+ constructor(){
109
+ super();
110
+
111
+ /**
112
+ * Key
113
+ * @type {string || null}
114
+ */
115
+ this.Key = null;
116
+
117
+ /**
118
+ * Value
119
+ * @type {string || null}
120
+ */
121
+ this.Value = null;
122
+
123
+ }
124
+
125
+ /**
126
+ * @private
127
+ */
128
+ deserialize(params) {
129
+ if (!params) {
130
+ return;
131
+ }
132
+ this.Key = 'Key' in params ? params.Key : null;
133
+ this.Value = 'Value' in params ? params.Value : null;
134
+
135
+ }
136
+ }
137
+
138
+ /**
139
+ * A single retrieval result
140
+ * @class
141
+ */
142
+ class KnowledgeResult extends AbstractModel {
143
+ constructor(){
144
+ super();
145
+
146
+ /**
147
+ * <p>Confidence degree</p>
148
+ * @type {number || null}
149
+ */
150
+ this.Confidence = null;
151
+
152
+ /**
153
+ * <p>Hit knowledge type: 1=QA, 2=document fragment, 3=database, 4=map<table><tbody><tr><td>Enumeration item</td><td>Enumeration value</td><td>Description</td></tr><tr><td>KNOWLEDGE_SOURCE_TYPE_UNKNOWN</td><td>0</td><td></td></tr><tr><td>KNOWLEDGE_SOURCE_TYPE_QA</td><td>1</td><td>QA</td></tr><tr><td>KNOWLEDGE_SOURCE_TYPE_DOC</td><td>2</td><td>Document fragment</td></tr><tr><td>KNOWLEDGE_SOURCE_TYPE_DB</td><td>3</td><td>Database</td></tr><tr><td>KNOWLEDGE_SOURCE_TYPE_GRAPH</td><td>4</td><td>Map</td></tr></tbody></table></p>
154
+ * @type {number || null}
155
+ */
156
+ this.KnowledgeType = null;
157
+
158
+ /**
159
+ * <p>Recall type list</p>
160
+ * @type {Array.<number> || null}
161
+ */
162
+ this.RecallTypeList = null;
163
+
164
+ /**
165
+ * <p>Result payload</p>
166
+ * @type {SearchResultPayload || null}
167
+ */
168
+ this.ResultPayload = null;
169
+
170
+ /**
171
+ * <p>Result type<table><tbody><tr><td>Enumeration item</td><td>Enumeration value</td><td>Description</td></tr><tr><td>SEARCH_RESULT_TYPE_UNKNOWN</td><td>0</td><td></td></tr><tr><td>SEARCH_RESULT_TYPE_RETRIEVAL</td><td>1</td><td>Standard search result</td></tr><tr><td>SEARCH_RESULT_TYPE_TEXT_TO_SQL</td><td>2</td><td>text2sql result</td></tr><tr><td>SEARCH_RESULT_TYPE_IMAGE_SEARCH_IMAGE</td><td>3</td><td></td></tr><tr><td>SEARCH_RESULT_TYPE_TEXT_SEARCH_IMAGE</td><td>4</td><td></td></tr></tbody></table></p>
172
+ * @type {number || null}
173
+ */
174
+ this.ResultType = null;
175
+
176
+ /**
177
+ * <p>Additional information for similar questions.</p>
178
+ * @type {SimilarQuestionExtra || null}
179
+ */
180
+ this.SimilarQuestionExtra = null;
181
+
182
+ /**
183
+ * <p>Basic information of knowledge fragment</p>
184
+ * @type {KnowledgeSnippetProfile || null}
185
+ */
186
+ this.SnippetProfile = null;
187
+
188
+ /**
189
+ * <p>Knowledge source information</p>
190
+ * @type {KnowledgeSource || null}
191
+ */
192
+ this.SourceInfo = null;
193
+
194
+ }
195
+
196
+ /**
197
+ * @private
198
+ */
199
+ deserialize(params) {
200
+ if (!params) {
201
+ return;
202
+ }
203
+ this.Confidence = 'Confidence' in params ? params.Confidence : null;
204
+ this.KnowledgeType = 'KnowledgeType' in params ? params.KnowledgeType : null;
205
+ this.RecallTypeList = 'RecallTypeList' in params ? params.RecallTypeList : null;
206
+
207
+ if (params.ResultPayload) {
208
+ let obj = new SearchResultPayload();
209
+ obj.deserialize(params.ResultPayload)
210
+ this.ResultPayload = obj;
211
+ }
212
+ this.ResultType = 'ResultType' in params ? params.ResultType : null;
213
+
214
+ if (params.SimilarQuestionExtra) {
215
+ let obj = new SimilarQuestionExtra();
216
+ obj.deserialize(params.SimilarQuestionExtra)
217
+ this.SimilarQuestionExtra = obj;
218
+ }
219
+
220
+ if (params.SnippetProfile) {
221
+ let obj = new KnowledgeSnippetProfile();
222
+ obj.deserialize(params.SnippetProfile)
223
+ this.SnippetProfile = obj;
224
+ }
225
+
226
+ if (params.SourceInfo) {
227
+ let obj = new KnowledgeSource();
228
+ obj.deserialize(params.SourceInfo)
229
+ this.SourceInfo = obj;
230
+ }
231
+
232
+ }
233
+ }
234
+
235
+ /**
236
+ * Retrieval input
237
+ * @class
238
+ */
239
+ class SearchInput extends AbstractModel {
240
+ constructor(){
241
+ super();
242
+
243
+ /**
244
+ * <p>List of image URLs</p>
245
+ * @type {Array.<string> || null}
246
+ */
247
+ this.ImageUrlList = null;
248
+
249
+ /**
250
+ * <p>Query</p>
251
+ * @type {string || null}
252
+ */
253
+ this.Question = null;
254
+
255
+ /**
256
+ * <p>Deconstructed sub-problem list</p>
257
+ * @type {Array.<string> || null}
258
+ */
259
+ this.SubQuestionList = null;
260
+
261
+ }
262
+
263
+ /**
264
+ * @private
265
+ */
266
+ deserialize(params) {
267
+ if (!params) {
268
+ return;
269
+ }
270
+ this.ImageUrlList = 'ImageUrlList' in params ? params.ImageUrlList : null;
271
+ this.Question = 'Question' in params ? params.Question : null;
272
+ this.SubQuestionList = 'SubQuestionList' in params ? params.SubQuestionList : null;
273
+
274
+ }
275
+ }
276
+
277
+ /**
278
+ * Final rerank configuration
279
+ * @class
280
+ */
281
+ class FinalRerankConfig extends AbstractModel {
282
+ constructor(){
283
+ super();
284
+
285
+ /**
286
+ * <p>Model name</p>
287
+ * @type {string || null}
288
+ */
289
+ this.ModelName = null;
290
+
291
+ }
292
+
293
+ /**
294
+ * @private
295
+ */
296
+ deserialize(params) {
297
+ if (!params) {
298
+ return;
299
+ }
300
+ this.ModelName = 'ModelName' in params ? params.ModelName : null;
301
+
302
+ }
303
+ }
304
+
305
+ /**
306
+ * Additional information of the similar question
307
+ * @class
308
+ */
309
+ class SimilarQuestionExtra extends AbstractModel {
310
+ constructor(){
311
+ super();
312
+
313
+ /**
314
+ * <p>Text content of the similar question</p>
315
+ * @type {string || null}
316
+ */
317
+ this.Content = null;
318
+
319
+ /**
320
+ * <p>Similar question ID</p>
321
+ * @type {string || null}
322
+ */
323
+ this.SimilarQuestionId = null;
324
+
325
+ }
326
+
327
+ /**
328
+ * @private
329
+ */
330
+ deserialize(params) {
331
+ if (!params) {
332
+ return;
333
+ }
334
+ this.Content = 'Content' in params ? params.Content : null;
335
+ this.SimilarQuestionId = 'SimilarQuestionId' in params ? params.SimilarQuestionId : null;
336
+
337
+ }
338
+ }
339
+
340
+ /**
341
+ * SearchKnowledge request structure.
342
+ * @class
343
+ */
344
+ class SearchKnowledgeRequest extends AbstractModel {
345
+ constructor(){
346
+ super();
347
+
348
+ /**
349
+ * <p>Advanced search configuration</p>
350
+ * @type {SearchAdvancedConfig || null}
351
+ */
352
+ this.AdvancedConfig = null;
353
+
354
+ /**
355
+ * <p>Retrieval input</p>
356
+ * @type {SearchInput || null}
357
+ */
358
+ this.Input = null;
359
+
360
+ /**
361
+ * <p>Retrieval context</p>
362
+ * @type {SearchContext || null}
363
+ */
364
+ this.Context = null;
365
+
366
+ /**
367
+ * <p>Billing information</p>
368
+ * @type {SearchBilling || null}
369
+ */
370
+ this.SearchBilling = null;
371
+
372
+ }
373
+
374
+ /**
375
+ * @private
376
+ */
377
+ deserialize(params) {
378
+ if (!params) {
379
+ return;
380
+ }
381
+
382
+ if (params.AdvancedConfig) {
383
+ let obj = new SearchAdvancedConfig();
384
+ obj.deserialize(params.AdvancedConfig)
385
+ this.AdvancedConfig = obj;
386
+ }
387
+
388
+ if (params.Input) {
389
+ let obj = new SearchInput();
390
+ obj.deserialize(params.Input)
391
+ this.Input = obj;
392
+ }
393
+
394
+ if (params.Context) {
395
+ let obj = new SearchContext();
396
+ obj.deserialize(params.Context)
397
+ this.Context = obj;
398
+ }
399
+
400
+ if (params.SearchBilling) {
401
+ let obj = new SearchBilling();
402
+ obj.deserialize(params.SearchBilling)
403
+ this.SearchBilling = obj;
404
+ }
405
+
406
+ }
407
+ }
408
+
409
+ /**
410
+ * Database search configuration
411
+ * @class
412
+ */
413
+ class DBRetrievalConfig extends AbstractModel {
414
+ constructor(){
415
+ super();
416
+
417
+ /**
418
+ * <p>Whether to enable</p>
419
+ * @type {boolean || null}
420
+ */
421
+ this.Enabled = null;
422
+
423
+ }
424
+
425
+ /**
426
+ * @private
427
+ */
428
+ deserialize(params) {
429
+ if (!params) {
430
+ return;
431
+ }
432
+ this.Enabled = 'Enabled' in params ? params.Enabled : null;
433
+
434
+ }
435
+ }
436
+
437
+ /**
438
+ * Search filter configuration
439
+ * @class
440
+ */
441
+ class SearchFilterConfig extends AbstractModel {
442
+ constructor(){
443
+ super();
444
+
445
+ /**
446
+ * <p>Whether to retrieve only selected tags. true: retrieve only knowledge with selected tags; false: simultaneous retrieval of knowledge with selected tags and knowledge without any tags</p>
447
+ * @type {boolean || null}
448
+ */
449
+ this.OnlyRetrievalSelectedLabel = null;
450
+
451
+ /**
452
+ * <p>Search filter</p>
453
+ * @type {SearchFilter || null}
454
+ */
455
+ this.SearchFilter = null;
456
+
457
+ }
458
+
459
+ /**
460
+ * @private
461
+ */
462
+ deserialize(params) {
463
+ if (!params) {
464
+ return;
465
+ }
466
+ this.OnlyRetrievalSelectedLabel = 'OnlyRetrievalSelectedLabel' in params ? params.OnlyRetrievalSelectedLabel : null;
467
+
468
+ if (params.SearchFilter) {
469
+ let obj = new SearchFilter();
470
+ obj.deserialize(params.SearchFilter)
471
+ this.SearchFilter = obj;
472
+ }
473
+
474
+ }
475
+ }
476
+
477
+ /**
478
+ * Token usage statistics
479
+ * @class
480
+ */
481
+ class TokenUsage extends AbstractModel {
482
+ constructor(){
483
+ super();
484
+
485
+ /**
486
+ * <p>Number of completion tokens</p>
487
+ * @type {number || null}
488
+ */
489
+ this.CompletionTokens = null;
490
+
491
+ /**
492
+ * <p>Model name</p>
493
+ * @type {string || null}
494
+ */
495
+ this.ModelName = null;
496
+
497
+ /**
498
+ * <p>prompt token count</p>
499
+ * @type {number || null}
500
+ */
501
+ this.PromptTokens = null;
502
+
503
+ /**
504
+ * <p>Total token count</p>
505
+ * @type {number || null}
506
+ */
507
+ this.TotalTokens = null;
508
+
509
+ }
510
+
511
+ /**
512
+ * @private
513
+ */
514
+ deserialize(params) {
515
+ if (!params) {
516
+ return;
517
+ }
518
+ this.CompletionTokens = 'CompletionTokens' in params ? params.CompletionTokens : null;
519
+ this.ModelName = 'ModelName' in params ? params.ModelName : null;
520
+ this.PromptTokens = 'PromptTokens' in params ? params.PromptTokens : null;
521
+ this.TotalTokens = 'TotalTokens' in params ? params.TotalTokens : null;
522
+
523
+ }
524
+ }
525
+
526
+ /**
527
+ * Search configuration of each knowledge base
528
+ * @class
529
+ */
530
+ class KBRetrievalConfig extends AbstractModel {
531
+ constructor(){
532
+ super();
533
+
534
+ /**
535
+ * <p>Database search configuration</p>
536
+ * @type {DBRetrievalConfig || null}
537
+ */
538
+ this.DbRetrievalConfig = null;
539
+
540
+ /**
541
+ * <p>Document retrieval configuration.</p>
542
+ * @type {DocRetrievalConfig || null}
543
+ */
544
+ this.DocRetrievalConfig = null;
545
+
546
+ /**
547
+ * <p>Knowledge base ID</p>
548
+ * @type {string || null}
549
+ */
550
+ this.KbId = null;
551
+
552
+ /**
553
+ * <p>Retrieval optional configuration</p>
554
+ * @type {RetrievalOption || null}
555
+ */
556
+ this.OptionConfig = null;
557
+
558
+ /**
559
+ * <p>QA search configuration</p>
560
+ * @type {QARetrievalConfig || null}
561
+ */
562
+ this.QaRetrievalConfig = null;
563
+
564
+ /**
565
+ * <p>ReRank configuration</p>
566
+ * @type {RerankConfig || null}
567
+ */
568
+ this.RerankConfig = null;
569
+
570
+ /**
571
+ * <p>Search filter configuration</p>
572
+ * @type {SearchFilterConfig || null}
573
+ */
574
+ this.SearchFilterConfig = null;
575
+
576
+ /**
577
+ * <p>Retrieval strategy: 1=hybrid, 2=semantic, 3=keyword, 4=none<table><tbody><tr><td>Enumeration item</td><td>Enumeration value</td><td>Description</td></tr><tr><td>SEARCH_STRATEGY_TYPE_UNKNOWN</td><td>0</td><td></td></tr><tr><td>SEARCH_STRATEGY_TYPE_MIXING</td><td>1</td><td>Hybrid retrieval</td></tr><tr><td>SEARCH_STRATEGY_TYPE_SEMANTIC</td><td>2</td><td>Semantic retrieval</td></tr><tr><td>SEARCH_STRATEGY_TYPE_KEYWORD</td><td>3</td><td>Keyword retrieval</td></tr><tr><td>SEARCH_STRATEGY_TYPE_NONE</td><td>4</td><td>No semantic/vector retrieval</td></tr></tbody></table></p>
578
+ * @type {number || null}
579
+ */
580
+ this.StrategyType = null;
581
+
582
+ /**
583
+ * <p>Text2SQL model</p>
584
+ * @type {ModelDetailInfo || null}
585
+ */
586
+ this.TextToSqlModel = null;
587
+
588
+ }
589
+
590
+ /**
591
+ * @private
592
+ */
593
+ deserialize(params) {
594
+ if (!params) {
595
+ return;
596
+ }
597
+
598
+ if (params.DbRetrievalConfig) {
599
+ let obj = new DBRetrievalConfig();
600
+ obj.deserialize(params.DbRetrievalConfig)
601
+ this.DbRetrievalConfig = obj;
602
+ }
603
+
604
+ if (params.DocRetrievalConfig) {
605
+ let obj = new DocRetrievalConfig();
606
+ obj.deserialize(params.DocRetrievalConfig)
607
+ this.DocRetrievalConfig = obj;
608
+ }
609
+ this.KbId = 'KbId' in params ? params.KbId : null;
610
+
611
+ if (params.OptionConfig) {
612
+ let obj = new RetrievalOption();
613
+ obj.deserialize(params.OptionConfig)
614
+ this.OptionConfig = obj;
615
+ }
616
+
617
+ if (params.QaRetrievalConfig) {
618
+ let obj = new QARetrievalConfig();
619
+ obj.deserialize(params.QaRetrievalConfig)
620
+ this.QaRetrievalConfig = obj;
621
+ }
622
+
623
+ if (params.RerankConfig) {
624
+ let obj = new RerankConfig();
625
+ obj.deserialize(params.RerankConfig)
626
+ this.RerankConfig = obj;
627
+ }
628
+
629
+ if (params.SearchFilterConfig) {
630
+ let obj = new SearchFilterConfig();
631
+ obj.deserialize(params.SearchFilterConfig)
632
+ this.SearchFilterConfig = obj;
633
+ }
634
+ this.StrategyType = 'StrategyType' in params ? params.StrategyType : null;
635
+
636
+ if (params.TextToSqlModel) {
637
+ let obj = new ModelDetailInfo();
638
+ obj.deserialize(params.TextToSqlModel)
639
+ this.TextToSqlModel = obj;
640
+ }
641
+
642
+ }
643
+ }
644
+
645
+ /**
646
+ * Model parameters
647
+ * @class
648
+ */
649
+ class ModelParams extends AbstractModel {
650
+ constructor(){
651
+ super();
652
+
653
+ /**
654
+ * <p>Whether deep thinking is enabled</p>
655
+ * @type {string || null}
656
+ */
657
+ this.DeepThinking = null;
658
+
659
+ /**
660
+ * <p>Frequency penalty</p>
661
+ * @type {number || null}
662
+ */
663
+ this.FrequencyPenalty = null;
664
+
665
+ /**
666
+ * <p>Maximum output length</p>
667
+ * @type {number || null}
668
+ */
669
+ this.MaxTokens = null;
670
+
671
+ /**
672
+ * <p>Existence penalty</p>
673
+ * @type {number || null}
674
+ */
675
+ this.PresencePenalty = null;
676
+
677
+ /**
678
+ * <p>Deep thinking effect</p>
679
+ * @type {string || null}
680
+ */
681
+ this.ReasoningEffort = null;
682
+
683
+ /**
684
+ * <p>Repetition penalty</p>
685
+ * @type {number || null}
686
+ */
687
+ this.RepetitionPenalty = null;
688
+
689
+ /**
690
+ * <p>Output format (text, json_object)</p>
691
+ * @type {string || null}
692
+ */
693
+ this.ReplyFormat = null;
694
+
695
+ /**
696
+ * <p>Random seed</p>
697
+ * @type {number || null}
698
+ */
699
+ this.Seed = null;
700
+
701
+ /**
702
+ * <p>Stop sequence</p>
703
+ * @type {Array.<string> || null}
704
+ */
705
+ this.StopSequenceList = null;
706
+
707
+ /**
708
+ * <p>Temperature</p>
709
+ * @type {number || null}
710
+ */
711
+ this.Temperature = null;
712
+
713
+ /**
714
+ * <p>top_p</p>
715
+ * @type {number || null}
716
+ */
717
+ this.TopP = null;
718
+
719
+ /**
720
+ * <p>top_k</p>
721
+ * @type {number || null}
722
+ */
723
+ this.TopK = null;
724
+
725
+ }
726
+
727
+ /**
728
+ * @private
729
+ */
730
+ deserialize(params) {
731
+ if (!params) {
732
+ return;
733
+ }
734
+ this.DeepThinking = 'DeepThinking' in params ? params.DeepThinking : null;
735
+ this.FrequencyPenalty = 'FrequencyPenalty' in params ? params.FrequencyPenalty : null;
736
+ this.MaxTokens = 'MaxTokens' in params ? params.MaxTokens : null;
737
+ this.PresencePenalty = 'PresencePenalty' in params ? params.PresencePenalty : null;
738
+ this.ReasoningEffort = 'ReasoningEffort' in params ? params.ReasoningEffort : null;
739
+ this.RepetitionPenalty = 'RepetitionPenalty' in params ? params.RepetitionPenalty : null;
740
+ this.ReplyFormat = 'ReplyFormat' in params ? params.ReplyFormat : null;
741
+ this.Seed = 'Seed' in params ? params.Seed : null;
742
+ this.StopSequenceList = 'StopSequenceList' in params ? params.StopSequenceList : null;
743
+ this.Temperature = 'Temperature' in params ? params.Temperature : null;
744
+ this.TopP = 'TopP' in params ? params.TopP : null;
745
+ this.TopK = 'TopK' in params ? params.TopK : null;
746
+
747
+ }
748
+ }
749
+
750
+ /**
751
+ * Retrieve advanced configuration
752
+ * @class
753
+ */
754
+ class SearchAdvancedConfig extends AbstractModel {
755
+ constructor(){
756
+ super();
757
+
758
+ /**
759
+ * <p>Final ReRank Configuration</p>
760
+ * @type {FinalRerankConfig || null}
761
+ */
762
+ this.FinalRerankConfig = null;
763
+
764
+ /**
765
+ * <p>Search configuration of each knowledge base</p>
766
+ * @type {Array.<KBRetrievalConfig> || null}
767
+ */
768
+ this.KbRetrievalList = null;
769
+
770
+ /**
771
+ * <p>Retrieve knowledge type: 1=document and QA, 2=rejected question<table><tbody><tr><td>Enumeration item</td><td>Enumeration value</td><td>Description</td></tr><tr><td>SEARCH_KNOWLEDGE_TYPE_UNKNOWN</td><td>0</td><td></td></tr><tr><td>SEARCH_KNOWLEDGE_TYPE_DOC_QA</td><td>1</td><td>Document and QA</td></tr><tr><td>SEARCH_KNOWLEDGE_TYPE_REJECTED_QUESTION</td><td>2</td><td>Rejected question</td></tr></tbody></table></p>
772
+ * @type {number || null}
773
+ */
774
+ this.KnowledgeType = null;
775
+
776
+ /**
777
+ * <p>Number of final returned results</p>
778
+ * @type {number || null}
779
+ */
780
+ this.RecallCount = null;
781
+
782
+ }
783
+
784
+ /**
785
+ * @private
786
+ */
787
+ deserialize(params) {
788
+ if (!params) {
789
+ return;
790
+ }
791
+
792
+ if (params.FinalRerankConfig) {
793
+ let obj = new FinalRerankConfig();
794
+ obj.deserialize(params.FinalRerankConfig)
795
+ this.FinalRerankConfig = obj;
796
+ }
797
+
798
+ if (params.KbRetrievalList) {
799
+ this.KbRetrievalList = new Array();
800
+ for (let z in params.KbRetrievalList) {
801
+ let obj = new KBRetrievalConfig();
802
+ obj.deserialize(params.KbRetrievalList[z]);
803
+ this.KbRetrievalList.push(obj);
804
+ }
805
+ }
806
+ this.KnowledgeType = 'KnowledgeType' in params ? params.KnowledgeType : null;
807
+ this.RecallCount = 'RecallCount' in params ? params.RecallCount : null;
808
+
809
+ }
810
+ }
811
+
812
+ /**
813
+ * QA search configuration
814
+ * @class
815
+ */
816
+ class QARetrievalConfig extends AbstractModel {
817
+ constructor(){
818
+ super();
819
+
820
+ /**
821
+ * <p>Confidence threshold</p>
822
+ * @type {number || null}
823
+ */
824
+ this.Confidence = null;
825
+
826
+ /**
827
+ * <p>Whether to enable</p>
828
+ * @type {boolean || null}
829
+ */
830
+ this.Enabled = null;
831
+
832
+ /**
833
+ * <p>Return the top N entries</p>
834
+ * @type {number || null}
835
+ */
836
+ this.TopN = null;
837
+
838
+ }
839
+
840
+ /**
841
+ * @private
842
+ */
843
+ deserialize(params) {
844
+ if (!params) {
845
+ return;
846
+ }
847
+ this.Confidence = 'Confidence' in params ? params.Confidence : null;
848
+ this.Enabled = 'Enabled' in params ? params.Enabled : null;
849
+ this.TopN = 'TopN' in params ? params.TopN : null;
850
+
851
+ }
852
+ }
853
+
854
+ /**
855
+ * Retrieval billing information
856
+ * @class
857
+ */
858
+ class SearchBilling extends AbstractModel {
859
+ constructor(){
860
+ super();
861
+
862
+ /**
863
+ * <p>Billing tag list</p>
864
+ * @type {Array.<KVPair> || null}
865
+ */
866
+ this.BillingTagList = null;
867
+
868
+ /**
869
+ * <p>Billing sub-business type</p>
870
+ * @type {string || null}
871
+ */
872
+ this.FinanceSubBusinessType = null;
873
+
874
+ }
875
+
876
+ /**
877
+ * @private
878
+ */
879
+ deserialize(params) {
880
+ if (!params) {
881
+ return;
882
+ }
883
+
884
+ if (params.BillingTagList) {
885
+ this.BillingTagList = new Array();
886
+ for (let z in params.BillingTagList) {
887
+ let obj = new KVPair();
888
+ obj.deserialize(params.BillingTagList[z]);
889
+ this.BillingTagList.push(obj);
890
+ }
891
+ }
892
+ this.FinanceSubBusinessType = 'FinanceSubBusinessType' in params ? params.FinanceSubBusinessType : null;
893
+
894
+ }
895
+ }
896
+
897
+ /**
898
+ * Table enhancement configuration
899
+ * @class
900
+ */
901
+ class TableEnhancement extends AbstractModel {
902
+ constructor(){
903
+ super();
904
+
905
+ /**
906
+ * <p>Whether to enable</p>
907
+ * @type {boolean || null}
908
+ */
909
+ this.Enabled = null;
910
+
911
+ }
912
+
913
+ /**
914
+ * @private
915
+ */
916
+ deserialize(params) {
917
+ if (!params) {
918
+ return;
919
+ }
920
+ this.Enabled = 'Enabled' in params ? params.Enabled : null;
921
+
922
+ }
923
+ }
924
+
925
+ /**
926
+ * Knowledge source information
927
+ * @class
928
+ */
929
+ class KnowledgeSource extends AbstractModel {
930
+ constructor(){
931
+ super();
932
+
933
+ /**
934
+ * <p>Whether it is big data</p>
935
+ * @type {boolean || null}
936
+ */
937
+ this.IsBigData = null;
938
+
939
+ /**
940
+ * <p>Whether it is a shared knowledge base</p>
941
+ * @type {boolean || null}
942
+ */
943
+ this.IsShared = null;
944
+
945
+ /**
946
+ * <p>Knowledge base name</p>
947
+ * @type {string || null}
948
+ */
949
+ this.KbName = null;
950
+
951
+ }
952
+
953
+ /**
954
+ * @private
955
+ */
956
+ deserialize(params) {
957
+ if (!params) {
958
+ return;
959
+ }
960
+ this.IsBigData = 'IsBigData' in params ? params.IsBigData : null;
961
+ this.IsShared = 'IsShared' in params ? params.IsShared : null;
962
+ this.KbName = 'KbName' in params ? params.KbName : null;
963
+
964
+ }
965
+ }
966
+
967
+ /**
968
+ * Search filter
969
+ * @class
970
+ */
971
+ class SearchFilter extends AbstractModel {
972
+ constructor(){
973
+ super();
974
+
975
+ /**
976
+ * <p>Search filter type<table><tbody><tr><td>Enumeration item</td><td>Enumeration value</td><td>Description</td></tr><tr><td>SEARCH_FILTER_TYPE_UNKNOWN</td><td>0</td><td></td></tr><tr><td>SEARCH_FILTER_TYPE_CUSTOMER_LABEL_VALUE</td><td>1</td><td>User-customized tag value</td></tr><tr><td>SEARCH_FILTER_TYPE_CUSTOMER_LABEL_VALUE_ID</td><td>2</td><td>User-customized tag value ID</td></tr><tr><td>SEARCH_FILTER_TYPE_DOC_ID</td><td>3</td><td>Retrieve by specified document ID</td></tr><tr><td>SEARCH_FILTER_TYPE_DOC_CATEGORY_ID</td><td>4</td><td>Retrieve by specified document classification ID</td></tr><tr><td>SEARCH_FILTER_TYPE_DB_TABLE_ID</td><td>5</td><td>Retrieve by specified database table ID</td></tr><tr><td>SEARCH_FILTER_TYPE_KB_SCHEMA_ID</td><td>6</td><td>Specified knowledge base schema ID</td></tr></tbody></table></p>
977
+ * @type {number || null}
978
+ */
979
+ this.FilterType = null;
980
+
981
+ /**
982
+ * <p>Filter value list. According to SearchFilterType, take value 1: pass a custom tag value; 2: pass a custom tag value ID; 3: pass a document ID; 4: pass a category ID</p>
983
+ * @type {Array.<string> || null}
984
+ */
985
+ this.FilterValueList = null;
986
+
987
+ /**
988
+ * <p>User-customized tag ID</p>
989
+ * @type {string || null}
990
+ */
991
+ this.LabelId = null;
992
+
993
+ /**
994
+ * <p>Logical operator: AND or OR<table><tbody><tr><td>Enumeration item</td><td>Enumeration value</td><td>Description</td></tr><tr><td>LOGIC_OPR_NOOP</td><td>0</td><td></td></tr><tr><td>LOGIC_OPR_AND</td><td>1</td><td></td></tr><tr><td>LOGIC_OPR_OR</td><td>2</td><td></td></tr></tbody></table></p>
995
+ * @type {number || null}
996
+ */
997
+ this.LogicOp = null;
998
+
999
+ /**
1000
+ * <p>Nested search filter</p>
1001
+ * @type {Array.<SearchFilter> || null}
1002
+ */
1003
+ this.SearchFilterList = null;
1004
+
1005
+ }
1006
+
1007
+ /**
1008
+ * @private
1009
+ */
1010
+ deserialize(params) {
1011
+ if (!params) {
1012
+ return;
1013
+ }
1014
+ this.FilterType = 'FilterType' in params ? params.FilterType : null;
1015
+ this.FilterValueList = 'FilterValueList' in params ? params.FilterValueList : null;
1016
+ this.LabelId = 'LabelId' in params ? params.LabelId : null;
1017
+ this.LogicOp = 'LogicOp' in params ? params.LogicOp : null;
1018
+
1019
+ if (params.SearchFilterList) {
1020
+ this.SearchFilterList = new Array();
1021
+ for (let z in params.SearchFilterList) {
1022
+ let obj = new SearchFilter();
1023
+ obj.deserialize(params.SearchFilterList[z]);
1024
+ this.SearchFilterList.push(obj);
1025
+ }
1026
+ }
1027
+
1028
+ }
1029
+ }
1030
+
1031
+ /**
1032
+ * Rearrange the configuration
1033
+ * @class
1034
+ */
1035
+ class RerankConfig extends AbstractModel {
1036
+ constructor(){
1037
+ super();
1038
+
1039
+ /**
1040
+ * <p>Whether to enable</p>
1041
+ * @type {boolean || null}
1042
+ */
1043
+ this.Enabled = null;
1044
+
1045
+ /**
1046
+ * <p>Model name</p>
1047
+ * @type {string || null}
1048
+ */
1049
+ this.ModelName = null;
1050
+
1051
+ }
1052
+
1053
+ /**
1054
+ * @private
1055
+ */
1056
+ deserialize(params) {
1057
+ if (!params) {
1058
+ return;
1059
+ }
1060
+ this.Enabled = 'Enabled' in params ? params.Enabled : null;
1061
+ this.ModelName = 'ModelName' in params ? params.ModelName : null;
1062
+
1063
+ }
1064
+ }
1065
+
1066
+ /**
1067
+ * Optional retrieval configuration
1068
+ * @class
1069
+ */
1070
+ class RetrievalOption extends AbstractModel {
1071
+ constructor(){
1072
+ super();
1073
+
1074
+ /**
1075
+ * <p>Timeliness retrieval enhancement configuration</p>
1076
+ * @type {ExpirationAwareness || null}
1077
+ */
1078
+ this.ExpirationAwareness = null;
1079
+
1080
+ /**
1081
+ * <p>GraphRAG Configuration</p>
1082
+ * @type {GraphRAG || null}
1083
+ */
1084
+ this.GraphRag = null;
1085
+
1086
+ /**
1087
+ * <p>Spreadsheet enhancement configuration</p>
1088
+ * @type {TableEnhancement || null}
1089
+ */
1090
+ this.TableEnhancement = null;
1091
+
1092
+ }
1093
+
1094
+ /**
1095
+ * @private
1096
+ */
1097
+ deserialize(params) {
1098
+ if (!params) {
1099
+ return;
1100
+ }
1101
+
1102
+ if (params.ExpirationAwareness) {
1103
+ let obj = new ExpirationAwareness();
1104
+ obj.deserialize(params.ExpirationAwareness)
1105
+ this.ExpirationAwareness = obj;
1106
+ }
1107
+
1108
+ if (params.GraphRag) {
1109
+ let obj = new GraphRAG();
1110
+ obj.deserialize(params.GraphRag)
1111
+ this.GraphRag = obj;
1112
+ }
1113
+
1114
+ if (params.TableEnhancement) {
1115
+ let obj = new TableEnhancement();
1116
+ obj.deserialize(params.TableEnhancement)
1117
+ this.TableEnhancement = obj;
1118
+ }
1119
+
1120
+ }
1121
+ }
1122
+
1123
+ /**
1124
+ * Basic information of knowledge fragment
1125
+ * @class
1126
+ */
1127
+ class KnowledgeSnippetProfile extends AbstractModel {
1128
+ constructor(){
1129
+ super();
1130
+
1131
+ /**
1132
+ * <p>Content</p>
1133
+ * @type {string || null}
1134
+ */
1135
+ this.Content = null;
1136
+
1137
+ /**
1138
+ * <p>Associated document ID</p>
1139
+ * @type {string || null}
1140
+ */
1141
+ this.DocId = null;
1142
+
1143
+ /**
1144
+ * <p>Document name</p>
1145
+ * @type {string || null}
1146
+ */
1147
+ this.DocName = null;
1148
+
1149
+ /**
1150
+ * <p>Knowledge base ID</p>
1151
+ * @type {string || null}
1152
+ */
1153
+ this.KbId = null;
1154
+
1155
+ /**
1156
+ * <p>Knowledge ID</p>
1157
+ * @type {string || null}
1158
+ */
1159
+ this.KnowledgeId = null;
1160
+
1161
+ /**
1162
+ * <p>Query</p>
1163
+ * @type {string || null}
1164
+ */
1165
+ this.Question = null;
1166
+
1167
+ /**
1168
+ * <p>Document title</p>
1169
+ * @type {string || null}
1170
+ */
1171
+ this.Title = null;
1172
+
1173
+ }
1174
+
1175
+ /**
1176
+ * @private
1177
+ */
1178
+ deserialize(params) {
1179
+ if (!params) {
1180
+ return;
1181
+ }
1182
+ this.Content = 'Content' in params ? params.Content : null;
1183
+ this.DocId = 'DocId' in params ? params.DocId : null;
1184
+ this.DocName = 'DocName' in params ? params.DocName : null;
1185
+ this.KbId = 'KbId' in params ? params.KbId : null;
1186
+ this.KnowledgeId = 'KnowledgeId' in params ? params.KnowledgeId : null;
1187
+ this.Question = 'Question' in params ? params.Question : null;
1188
+ this.Title = 'Title' in params ? params.Title : null;
1189
+
1190
+ }
1191
+ }
1192
+
1193
+ /**
1194
+ * Timeliness retrieval enhancement configuration
1195
+ * @class
1196
+ */
1197
+ class ExpirationAwareness extends AbstractModel {
1198
+ constructor(){
1199
+ super();
1200
+
1201
+ /**
1202
+ * <p>Whether to enable timeliness retrieval. Once enabled, retrieval results will be sorted based on the validity time of the knowledge</p>
1203
+ * @type {boolean || null}
1204
+ */
1205
+ this.Enabled = null;
1206
+
1207
+ }
1208
+
1209
+ /**
1210
+ * @private
1211
+ */
1212
+ deserialize(params) {
1213
+ if (!params) {
1214
+ return;
1215
+ }
1216
+ this.Enabled = 'Enabled' in params ? params.Enabled : null;
1217
+
1218
+ }
1219
+ }
1220
+
1221
+ /**
1222
+ * GraphRAG configuration
1223
+ * @class
1224
+ */
1225
+ class GraphRAG extends AbstractModel {
1226
+ constructor(){
1227
+ super();
1228
+
1229
+ /**
1230
+ * <p>Whether to enable</p>
1231
+ * @type {boolean || null}
1232
+ */
1233
+ this.Enabled = null;
1234
+
1235
+ }
1236
+
1237
+ /**
1238
+ * @private
1239
+ */
1240
+ deserialize(params) {
1241
+ if (!params) {
1242
+ return;
1243
+ }
1244
+ this.Enabled = 'Enabled' in params ? params.Enabled : null;
1245
+
1246
+ }
1247
+ }
1248
+
1249
+ /**
1250
+ * Model details
1251
+ * @class
1252
+ */
1253
+ class ModelDetailInfo extends AbstractModel {
1254
+ constructor(){
1255
+ super();
1256
+
1257
+ /**
1258
+ * Model alias.
1259
+ * @type {string || null}
1260
+ */
1261
+ this.Alias = null;
1262
+
1263
+ /**
1264
+ * Limit on number of historical conversations
1265
+ * @type {number || null}
1266
+ */
1267
+ this.HistoryLimit = null;
1268
+
1269
+ /**
1270
+ * Unique model ID
1271
+ * @type {string || null}
1272
+ */
1273
+ this.ModelId = null;
1274
+
1275
+ /**
1276
+ * Model parameters
1277
+ * @type {ModelParams || null}
1278
+ */
1279
+ this.ModelParams = null;
1280
+
1281
+ }
1282
+
1283
+ /**
1284
+ * @private
1285
+ */
1286
+ deserialize(params) {
1287
+ if (!params) {
1288
+ return;
1289
+ }
1290
+ this.Alias = 'Alias' in params ? params.Alias : null;
1291
+ this.HistoryLimit = 'HistoryLimit' in params ? params.HistoryLimit : null;
1292
+ this.ModelId = 'ModelId' in params ? params.ModelId : null;
1293
+
1294
+ if (params.ModelParams) {
1295
+ let obj = new ModelParams();
1296
+ obj.deserialize(params.ModelParams)
1297
+ this.ModelParams = obj;
1298
+ }
1299
+
1300
+ }
1301
+ }
1302
+
1303
+ /**
1304
+ * Document search configuration
1305
+ * @class
1306
+ */
1307
+ class DocRetrievalConfig extends AbstractModel {
1308
+ constructor(){
1309
+ super();
1310
+
1311
+ /**
1312
+ * <p>Confidence threshold</p>
1313
+ * @type {number || null}
1314
+ */
1315
+ this.Confidence = null;
1316
+
1317
+ /**
1318
+ * <p>Whether to enable</p>
1319
+ * @type {boolean || null}
1320
+ */
1321
+ this.Enabled = null;
1322
+
1323
+ /**
1324
+ * <p>Return the top N entries</p>
1325
+ * @type {number || null}
1326
+ */
1327
+ this.TopN = null;
1328
+
1329
+ }
1330
+
1331
+ /**
1332
+ * @private
1333
+ */
1334
+ deserialize(params) {
1335
+ if (!params) {
1336
+ return;
1337
+ }
1338
+ this.Confidence = 'Confidence' in params ? params.Confidence : null;
1339
+ this.Enabled = 'Enabled' in params ? params.Enabled : null;
1340
+ this.TopN = 'TopN' in params ? params.TopN : null;
1341
+
1342
+ }
1343
+ }
1344
+
1345
+ /**
1346
+ * SearchKnowledge response structure.
1347
+ * @class
1348
+ */
1349
+ class SearchKnowledgeResponse extends AbstractModel {
1350
+ constructor(){
1351
+ super();
1352
+
1353
+ /**
1354
+ * <p>Search results list</p>
1355
+ * @type {Array.<KnowledgeResult> || null}
1356
+ */
1357
+ this.KnowledgeList = null;
1358
+
1359
+ /**
1360
+ * <p>token consumption statistics</p>
1361
+ * @type {Array.<TokenUsage> || null}
1362
+ */
1363
+ this.TokenUsageList = null;
1364
+
1365
+ /**
1366
+ * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
1367
+ * @type {string || null}
1368
+ */
1369
+ this.RequestId = null;
1370
+
1371
+ }
1372
+
1373
+ /**
1374
+ * @private
1375
+ */
1376
+ deserialize(params) {
1377
+ if (!params) {
1378
+ return;
1379
+ }
1380
+
1381
+ if (params.KnowledgeList) {
1382
+ this.KnowledgeList = new Array();
1383
+ for (let z in params.KnowledgeList) {
1384
+ let obj = new KnowledgeResult();
1385
+ obj.deserialize(params.KnowledgeList[z]);
1386
+ this.KnowledgeList.push(obj);
1387
+ }
1388
+ }
1389
+
1390
+ if (params.TokenUsageList) {
1391
+ this.TokenUsageList = new Array();
1392
+ for (let z in params.TokenUsageList) {
1393
+ let obj = new TokenUsage();
1394
+ obj.deserialize(params.TokenUsageList[z]);
1395
+ this.TokenUsageList.push(obj);
1396
+ }
1397
+ }
1398
+ this.RequestId = 'RequestId' in params ? params.RequestId : null;
1399
+
1400
+ }
1401
+ }
1402
+
1403
+ module.exports = {
1404
+ SearchResultPayload: SearchResultPayload,
1405
+ SearchContext: SearchContext,
1406
+ KVPair: KVPair,
1407
+ KnowledgeResult: KnowledgeResult,
1408
+ SearchInput: SearchInput,
1409
+ FinalRerankConfig: FinalRerankConfig,
1410
+ SimilarQuestionExtra: SimilarQuestionExtra,
1411
+ SearchKnowledgeRequest: SearchKnowledgeRequest,
1412
+ DBRetrievalConfig: DBRetrievalConfig,
1413
+ SearchFilterConfig: SearchFilterConfig,
1414
+ TokenUsage: TokenUsage,
1415
+ KBRetrievalConfig: KBRetrievalConfig,
1416
+ ModelParams: ModelParams,
1417
+ SearchAdvancedConfig: SearchAdvancedConfig,
1418
+ QARetrievalConfig: QARetrievalConfig,
1419
+ SearchBilling: SearchBilling,
1420
+ TableEnhancement: TableEnhancement,
1421
+ KnowledgeSource: KnowledgeSource,
1422
+ SearchFilter: SearchFilter,
1423
+ RerankConfig: RerankConfig,
1424
+ RetrievalOption: RetrievalOption,
1425
+ KnowledgeSnippetProfile: KnowledgeSnippetProfile,
1426
+ ExpirationAwareness: ExpirationAwareness,
1427
+ GraphRAG: GraphRAG,
1428
+ ModelDetailInfo: ModelDetailInfo,
1429
+ DocRetrievalConfig: DocRetrievalConfig,
1430
+ SearchKnowledgeResponse: SearchKnowledgeResponse,
1431
+
1432
+ }