@alicloud/bailian20231229 1.0.0 → 1.2.0

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.
package/dist/client.js CHANGED
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.DescribeFileResponseBodyData = exports.ApplyFileUploadLeaseResponseBodyData = exports.ApplyFileUploadLeaseResponseBodyDataParam = exports.AddFileResponseBodyData = exports.DescribeFileResponse = exports.DescribeFileResponseBody = exports.ApplyFileUploadLeaseResponse = exports.ApplyFileUploadLeaseResponseBody = exports.ApplyFileUploadLeaseRequest = exports.AddFileResponse = exports.AddFileResponseBody = exports.AddFileRequest = void 0;
29
+ exports.SubmitIndexJobResponseBodyData = exports.SubmitIndexAddDocumentsJobResponseBodyData = exports.RetrieveResponseBodyData = exports.RetrieveResponseBodyDataNodes = exports.RetrieveRequestRewrite = exports.RetrieveRequestRerank = exports.GetIndexJobStatusResponseBodyData = exports.GetIndexJobStatusResponseBodyDataDocuments = exports.DescribeFileResponseBodyData = exports.CreateIndexResponseBodyData = exports.CreateIndexRequestColumns = exports.ApplyFileUploadLeaseResponseBodyData = exports.ApplyFileUploadLeaseResponseBodyDataParam = exports.AddFileResponseBodyData = exports.SubmitIndexJobResponse = exports.SubmitIndexJobResponseBody = exports.SubmitIndexJobRequest = exports.SubmitIndexAddDocumentsJobResponse = exports.SubmitIndexAddDocumentsJobResponseBody = exports.SubmitIndexAddDocumentsJobShrinkRequest = exports.SubmitIndexAddDocumentsJobRequest = exports.RetrieveResponse = exports.RetrieveResponseBody = exports.RetrieveShrinkRequest = exports.RetrieveRequest = exports.GetIndexJobStatusResponse = exports.GetIndexJobStatusResponseBody = exports.GetIndexJobStatusRequest = exports.DescribeFileResponse = exports.DescribeFileResponseBody = exports.CreateIndexResponse = exports.CreateIndexResponseBody = exports.CreateIndexShrinkRequest = exports.CreateIndexRequest = exports.ApplyFileUploadLeaseResponse = exports.ApplyFileUploadLeaseResponseBody = exports.ApplyFileUploadLeaseRequest = exports.AddFileResponse = exports.AddFileResponseBody = exports.AddFileRequest = void 0;
30
30
  // This file is auto-generated, don't edit it
31
31
  /**
32
32
  *
@@ -168,140 +168,798 @@ class ApplyFileUploadLeaseResponse extends $tea.Model {
168
168
  }
169
169
  }
170
170
  exports.ApplyFileUploadLeaseResponse = ApplyFileUploadLeaseResponse;
171
+ class CreateIndexRequest extends $tea.Model {
172
+ static names() {
173
+ return {
174
+ categoryIds: 'CategoryIds',
175
+ chunkSize: 'ChunkSize',
176
+ columns: 'Columns',
177
+ description: 'Description',
178
+ documentIds: 'DocumentIds',
179
+ embeddingModelName: 'EmbeddingModelName',
180
+ name: 'Name',
181
+ overlapSize: 'OverlapSize',
182
+ rerankMinScore: 'RerankMinScore',
183
+ rerankModelName: 'RerankModelName',
184
+ separator: 'Separator',
185
+ sinkInstanceId: 'SinkInstanceId',
186
+ sinkRegion: 'SinkRegion',
187
+ sinkType: 'SinkType',
188
+ sourceType: 'SourceType',
189
+ structureType: 'StructureType',
190
+ };
191
+ }
192
+ static types() {
193
+ return {
194
+ categoryIds: { 'type': 'array', 'itemType': 'string' },
195
+ chunkSize: 'number',
196
+ columns: { 'type': 'array', 'itemType': CreateIndexRequestColumns },
197
+ description: 'string',
198
+ documentIds: { 'type': 'array', 'itemType': 'string' },
199
+ embeddingModelName: 'string',
200
+ name: 'string',
201
+ overlapSize: 'number',
202
+ rerankMinScore: 'number',
203
+ rerankModelName: 'string',
204
+ separator: 'string',
205
+ sinkInstanceId: 'string',
206
+ sinkRegion: 'string',
207
+ sinkType: 'string',
208
+ sourceType: 'string',
209
+ structureType: 'string',
210
+ };
211
+ }
212
+ constructor(map) {
213
+ super(map);
214
+ }
215
+ }
216
+ exports.CreateIndexRequest = CreateIndexRequest;
217
+ class CreateIndexShrinkRequest extends $tea.Model {
218
+ static names() {
219
+ return {
220
+ categoryIdsShrink: 'CategoryIds',
221
+ chunkSize: 'ChunkSize',
222
+ columnsShrink: 'Columns',
223
+ description: 'Description',
224
+ documentIdsShrink: 'DocumentIds',
225
+ embeddingModelName: 'EmbeddingModelName',
226
+ name: 'Name',
227
+ overlapSize: 'OverlapSize',
228
+ rerankMinScore: 'RerankMinScore',
229
+ rerankModelName: 'RerankModelName',
230
+ separator: 'Separator',
231
+ sinkInstanceId: 'SinkInstanceId',
232
+ sinkRegion: 'SinkRegion',
233
+ sinkType: 'SinkType',
234
+ sourceType: 'SourceType',
235
+ structureType: 'StructureType',
236
+ };
237
+ }
238
+ static types() {
239
+ return {
240
+ categoryIdsShrink: 'string',
241
+ chunkSize: 'number',
242
+ columnsShrink: 'string',
243
+ description: 'string',
244
+ documentIdsShrink: 'string',
245
+ embeddingModelName: 'string',
246
+ name: 'string',
247
+ overlapSize: 'number',
248
+ rerankMinScore: 'number',
249
+ rerankModelName: 'string',
250
+ separator: 'string',
251
+ sinkInstanceId: 'string',
252
+ sinkRegion: 'string',
253
+ sinkType: 'string',
254
+ sourceType: 'string',
255
+ structureType: 'string',
256
+ };
257
+ }
258
+ constructor(map) {
259
+ super(map);
260
+ }
261
+ }
262
+ exports.CreateIndexShrinkRequest = CreateIndexShrinkRequest;
263
+ class CreateIndexResponseBody extends $tea.Model {
264
+ static names() {
265
+ return {
266
+ code: 'Code',
267
+ data: 'Data',
268
+ message: 'Message',
269
+ requestId: 'RequestId',
270
+ status: 'Status',
271
+ success: 'Success',
272
+ };
273
+ }
274
+ static types() {
275
+ return {
276
+ code: 'string',
277
+ data: CreateIndexResponseBodyData,
278
+ message: 'string',
279
+ requestId: 'string',
280
+ status: 'string',
281
+ success: 'boolean',
282
+ };
283
+ }
284
+ constructor(map) {
285
+ super(map);
286
+ }
287
+ }
288
+ exports.CreateIndexResponseBody = CreateIndexResponseBody;
289
+ class CreateIndexResponse extends $tea.Model {
290
+ static names() {
291
+ return {
292
+ headers: 'headers',
293
+ statusCode: 'statusCode',
294
+ body: 'body',
295
+ };
296
+ }
297
+ static types() {
298
+ return {
299
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
300
+ statusCode: 'number',
301
+ body: CreateIndexResponseBody,
302
+ };
303
+ }
304
+ constructor(map) {
305
+ super(map);
306
+ }
307
+ }
308
+ exports.CreateIndexResponse = CreateIndexResponse;
171
309
  class DescribeFileResponseBody extends $tea.Model {
172
310
  static names() {
173
311
  return {
174
312
  code: 'Code',
175
- data: 'Data',
313
+ data: 'Data',
314
+ message: 'Message',
315
+ requestId: 'RequestId',
316
+ status: 'Status',
317
+ success: 'Success',
318
+ };
319
+ }
320
+ static types() {
321
+ return {
322
+ code: 'string',
323
+ data: DescribeFileResponseBodyData,
324
+ message: 'string',
325
+ requestId: 'string',
326
+ status: 'string',
327
+ success: 'boolean',
328
+ };
329
+ }
330
+ constructor(map) {
331
+ super(map);
332
+ }
333
+ }
334
+ exports.DescribeFileResponseBody = DescribeFileResponseBody;
335
+ class DescribeFileResponse extends $tea.Model {
336
+ static names() {
337
+ return {
338
+ headers: 'headers',
339
+ statusCode: 'statusCode',
340
+ body: 'body',
341
+ };
342
+ }
343
+ static types() {
344
+ return {
345
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
346
+ statusCode: 'number',
347
+ body: DescribeFileResponseBody,
348
+ };
349
+ }
350
+ constructor(map) {
351
+ super(map);
352
+ }
353
+ }
354
+ exports.DescribeFileResponse = DescribeFileResponse;
355
+ class GetIndexJobStatusRequest extends $tea.Model {
356
+ static names() {
357
+ return {
358
+ indexId: 'IndexId',
359
+ jobId: 'JobId',
360
+ };
361
+ }
362
+ static types() {
363
+ return {
364
+ indexId: 'string',
365
+ jobId: 'string',
366
+ };
367
+ }
368
+ constructor(map) {
369
+ super(map);
370
+ }
371
+ }
372
+ exports.GetIndexJobStatusRequest = GetIndexJobStatusRequest;
373
+ class GetIndexJobStatusResponseBody extends $tea.Model {
374
+ static names() {
375
+ return {
376
+ code: 'Code',
377
+ data: 'Data',
378
+ message: 'Message',
379
+ requestId: 'RequestId',
380
+ status: 'Status',
381
+ success: 'Success',
382
+ };
383
+ }
384
+ static types() {
385
+ return {
386
+ code: 'string',
387
+ data: GetIndexJobStatusResponseBodyData,
388
+ message: 'string',
389
+ requestId: 'string',
390
+ status: 'string',
391
+ success: 'boolean',
392
+ };
393
+ }
394
+ constructor(map) {
395
+ super(map);
396
+ }
397
+ }
398
+ exports.GetIndexJobStatusResponseBody = GetIndexJobStatusResponseBody;
399
+ class GetIndexJobStatusResponse extends $tea.Model {
400
+ static names() {
401
+ return {
402
+ headers: 'headers',
403
+ statusCode: 'statusCode',
404
+ body: 'body',
405
+ };
406
+ }
407
+ static types() {
408
+ return {
409
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
410
+ statusCode: 'number',
411
+ body: GetIndexJobStatusResponseBody,
412
+ };
413
+ }
414
+ constructor(map) {
415
+ super(map);
416
+ }
417
+ }
418
+ exports.GetIndexJobStatusResponse = GetIndexJobStatusResponse;
419
+ class RetrieveRequest extends $tea.Model {
420
+ static names() {
421
+ return {
422
+ denseSimilarityTopK: 'DenseSimilarityTopK',
423
+ enableReranking: 'EnableReranking',
424
+ enableRewrite: 'EnableRewrite',
425
+ indexId: 'IndexId',
426
+ query: 'Query',
427
+ rerank: 'Rerank',
428
+ rerankMinScore: 'RerankMinScore',
429
+ rerankTopN: 'RerankTopN',
430
+ rewrite: 'Rewrite',
431
+ saveRetrieverHistory: 'SaveRetrieverHistory',
432
+ sparseSimilarityTopK: 'SparseSimilarityTopK',
433
+ };
434
+ }
435
+ static types() {
436
+ return {
437
+ denseSimilarityTopK: 'number',
438
+ enableReranking: 'boolean',
439
+ enableRewrite: 'boolean',
440
+ indexId: 'string',
441
+ query: 'string',
442
+ rerank: { 'type': 'array', 'itemType': RetrieveRequestRerank },
443
+ rerankMinScore: 'number',
444
+ rerankTopN: 'number',
445
+ rewrite: { 'type': 'array', 'itemType': RetrieveRequestRewrite },
446
+ saveRetrieverHistory: 'boolean',
447
+ sparseSimilarityTopK: 'number',
448
+ };
449
+ }
450
+ constructor(map) {
451
+ super(map);
452
+ }
453
+ }
454
+ exports.RetrieveRequest = RetrieveRequest;
455
+ class RetrieveShrinkRequest extends $tea.Model {
456
+ static names() {
457
+ return {
458
+ denseSimilarityTopK: 'DenseSimilarityTopK',
459
+ enableReranking: 'EnableReranking',
460
+ enableRewrite: 'EnableRewrite',
461
+ indexId: 'IndexId',
462
+ query: 'Query',
463
+ rerankShrink: 'Rerank',
464
+ rerankMinScore: 'RerankMinScore',
465
+ rerankTopN: 'RerankTopN',
466
+ rewriteShrink: 'Rewrite',
467
+ saveRetrieverHistory: 'SaveRetrieverHistory',
468
+ sparseSimilarityTopK: 'SparseSimilarityTopK',
469
+ };
470
+ }
471
+ static types() {
472
+ return {
473
+ denseSimilarityTopK: 'number',
474
+ enableReranking: 'boolean',
475
+ enableRewrite: 'boolean',
476
+ indexId: 'string',
477
+ query: 'string',
478
+ rerankShrink: 'string',
479
+ rerankMinScore: 'number',
480
+ rerankTopN: 'number',
481
+ rewriteShrink: 'string',
482
+ saveRetrieverHistory: 'boolean',
483
+ sparseSimilarityTopK: 'number',
484
+ };
485
+ }
486
+ constructor(map) {
487
+ super(map);
488
+ }
489
+ }
490
+ exports.RetrieveShrinkRequest = RetrieveShrinkRequest;
491
+ class RetrieveResponseBody extends $tea.Model {
492
+ static names() {
493
+ return {
494
+ code: 'Code',
495
+ data: 'Data',
496
+ message: 'Message',
497
+ requestId: 'RequestId',
498
+ status: 'Status',
499
+ success: 'Success',
500
+ };
501
+ }
502
+ static types() {
503
+ return {
504
+ code: 'string',
505
+ data: RetrieveResponseBodyData,
506
+ message: 'string',
507
+ requestId: 'string',
508
+ status: 'string',
509
+ success: 'boolean',
510
+ };
511
+ }
512
+ constructor(map) {
513
+ super(map);
514
+ }
515
+ }
516
+ exports.RetrieveResponseBody = RetrieveResponseBody;
517
+ class RetrieveResponse extends $tea.Model {
518
+ static names() {
519
+ return {
520
+ headers: 'headers',
521
+ statusCode: 'statusCode',
522
+ body: 'body',
523
+ };
524
+ }
525
+ static types() {
526
+ return {
527
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
528
+ statusCode: 'number',
529
+ body: RetrieveResponseBody,
530
+ };
531
+ }
532
+ constructor(map) {
533
+ super(map);
534
+ }
535
+ }
536
+ exports.RetrieveResponse = RetrieveResponse;
537
+ class SubmitIndexAddDocumentsJobRequest extends $tea.Model {
538
+ static names() {
539
+ return {
540
+ categoryIds: 'CategoryIds',
541
+ documentIds: 'DocumentIds',
542
+ indexId: 'IndexId',
543
+ sourceType: 'SourceType',
544
+ };
545
+ }
546
+ static types() {
547
+ return {
548
+ categoryIds: { 'type': 'array', 'itemType': 'string' },
549
+ documentIds: { 'type': 'array', 'itemType': 'string' },
550
+ indexId: 'string',
551
+ sourceType: 'string',
552
+ };
553
+ }
554
+ constructor(map) {
555
+ super(map);
556
+ }
557
+ }
558
+ exports.SubmitIndexAddDocumentsJobRequest = SubmitIndexAddDocumentsJobRequest;
559
+ class SubmitIndexAddDocumentsJobShrinkRequest extends $tea.Model {
560
+ static names() {
561
+ return {
562
+ categoryIdsShrink: 'CategoryIds',
563
+ documentIdsShrink: 'DocumentIds',
564
+ indexId: 'IndexId',
565
+ sourceType: 'SourceType',
566
+ };
567
+ }
568
+ static types() {
569
+ return {
570
+ categoryIdsShrink: 'string',
571
+ documentIdsShrink: 'string',
572
+ indexId: 'string',
573
+ sourceType: 'string',
574
+ };
575
+ }
576
+ constructor(map) {
577
+ super(map);
578
+ }
579
+ }
580
+ exports.SubmitIndexAddDocumentsJobShrinkRequest = SubmitIndexAddDocumentsJobShrinkRequest;
581
+ class SubmitIndexAddDocumentsJobResponseBody extends $tea.Model {
582
+ static names() {
583
+ return {
584
+ code: 'Code',
585
+ data: 'Data',
586
+ message: 'Message',
587
+ requestId: 'RequestId',
588
+ status: 'Status',
589
+ success: 'Success',
590
+ };
591
+ }
592
+ static types() {
593
+ return {
594
+ code: 'string',
595
+ data: SubmitIndexAddDocumentsJobResponseBodyData,
596
+ message: 'string',
597
+ requestId: 'string',
598
+ status: 'string',
599
+ success: 'boolean',
600
+ };
601
+ }
602
+ constructor(map) {
603
+ super(map);
604
+ }
605
+ }
606
+ exports.SubmitIndexAddDocumentsJobResponseBody = SubmitIndexAddDocumentsJobResponseBody;
607
+ class SubmitIndexAddDocumentsJobResponse extends $tea.Model {
608
+ static names() {
609
+ return {
610
+ headers: 'headers',
611
+ statusCode: 'statusCode',
612
+ body: 'body',
613
+ };
614
+ }
615
+ static types() {
616
+ return {
617
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
618
+ statusCode: 'number',
619
+ body: SubmitIndexAddDocumentsJobResponseBody,
620
+ };
621
+ }
622
+ constructor(map) {
623
+ super(map);
624
+ }
625
+ }
626
+ exports.SubmitIndexAddDocumentsJobResponse = SubmitIndexAddDocumentsJobResponse;
627
+ class SubmitIndexJobRequest extends $tea.Model {
628
+ static names() {
629
+ return {
630
+ indexId: 'IndexId',
631
+ };
632
+ }
633
+ static types() {
634
+ return {
635
+ indexId: 'string',
636
+ };
637
+ }
638
+ constructor(map) {
639
+ super(map);
640
+ }
641
+ }
642
+ exports.SubmitIndexJobRequest = SubmitIndexJobRequest;
643
+ class SubmitIndexJobResponseBody extends $tea.Model {
644
+ static names() {
645
+ return {
646
+ code: 'Code',
647
+ data: 'Data',
648
+ message: 'Message',
649
+ requestId: 'RequestId',
650
+ status: 'Status',
651
+ success: 'Success',
652
+ };
653
+ }
654
+ static types() {
655
+ return {
656
+ code: 'string',
657
+ data: SubmitIndexJobResponseBodyData,
658
+ message: 'string',
659
+ requestId: 'string',
660
+ status: 'string',
661
+ success: 'boolean',
662
+ };
663
+ }
664
+ constructor(map) {
665
+ super(map);
666
+ }
667
+ }
668
+ exports.SubmitIndexJobResponseBody = SubmitIndexJobResponseBody;
669
+ class SubmitIndexJobResponse extends $tea.Model {
670
+ static names() {
671
+ return {
672
+ headers: 'headers',
673
+ statusCode: 'statusCode',
674
+ body: 'body',
675
+ };
676
+ }
677
+ static types() {
678
+ return {
679
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
680
+ statusCode: 'number',
681
+ body: SubmitIndexJobResponseBody,
682
+ };
683
+ }
684
+ constructor(map) {
685
+ super(map);
686
+ }
687
+ }
688
+ exports.SubmitIndexJobResponse = SubmitIndexJobResponse;
689
+ class AddFileResponseBodyData extends $tea.Model {
690
+ static names() {
691
+ return {
692
+ fileId: 'FileId',
693
+ parser: 'Parser',
694
+ };
695
+ }
696
+ static types() {
697
+ return {
698
+ fileId: 'string',
699
+ parser: 'string',
700
+ };
701
+ }
702
+ constructor(map) {
703
+ super(map);
704
+ }
705
+ }
706
+ exports.AddFileResponseBodyData = AddFileResponseBodyData;
707
+ class ApplyFileUploadLeaseResponseBodyDataParam extends $tea.Model {
708
+ static names() {
709
+ return {
710
+ headers: 'Headers',
711
+ method: 'Method',
712
+ url: 'Url',
713
+ };
714
+ }
715
+ static types() {
716
+ return {
717
+ headers: 'any',
718
+ method: 'string',
719
+ url: 'string',
720
+ };
721
+ }
722
+ constructor(map) {
723
+ super(map);
724
+ }
725
+ }
726
+ exports.ApplyFileUploadLeaseResponseBodyDataParam = ApplyFileUploadLeaseResponseBodyDataParam;
727
+ class ApplyFileUploadLeaseResponseBodyData extends $tea.Model {
728
+ static names() {
729
+ return {
730
+ fileUploadLeaseId: 'FileUploadLeaseId',
731
+ param: 'Param',
732
+ type: 'Type',
733
+ };
734
+ }
735
+ static types() {
736
+ return {
737
+ fileUploadLeaseId: 'string',
738
+ param: ApplyFileUploadLeaseResponseBodyDataParam,
739
+ type: 'string',
740
+ };
741
+ }
742
+ constructor(map) {
743
+ super(map);
744
+ }
745
+ }
746
+ exports.ApplyFileUploadLeaseResponseBodyData = ApplyFileUploadLeaseResponseBodyData;
747
+ class CreateIndexRequestColumns extends $tea.Model {
748
+ static names() {
749
+ return {
750
+ column: 'Column',
751
+ isRecall: 'IsRecall',
752
+ isSearch: 'IsSearch',
753
+ name: 'Name',
754
+ type: 'Type',
755
+ };
756
+ }
757
+ static types() {
758
+ return {
759
+ column: 'string',
760
+ isRecall: 'boolean',
761
+ isSearch: 'boolean',
762
+ name: 'string',
763
+ type: 'string',
764
+ };
765
+ }
766
+ constructor(map) {
767
+ super(map);
768
+ }
769
+ }
770
+ exports.CreateIndexRequestColumns = CreateIndexRequestColumns;
771
+ class CreateIndexResponseBodyData extends $tea.Model {
772
+ static names() {
773
+ return {
774
+ id: 'Id',
775
+ };
776
+ }
777
+ static types() {
778
+ return {
779
+ id: 'string',
780
+ };
781
+ }
782
+ constructor(map) {
783
+ super(map);
784
+ }
785
+ }
786
+ exports.CreateIndexResponseBodyData = CreateIndexResponseBodyData;
787
+ class DescribeFileResponseBodyData extends $tea.Model {
788
+ static names() {
789
+ return {
790
+ categoryId: 'CategoryId',
791
+ createTime: 'CreateTime',
792
+ fileId: 'FileId',
793
+ fileName: 'FileName',
794
+ fileType: 'FileType',
795
+ parser: 'Parser',
796
+ sizeInBytes: 'SizeInBytes',
797
+ status: 'Status',
798
+ };
799
+ }
800
+ static types() {
801
+ return {
802
+ categoryId: 'string',
803
+ createTime: 'string',
804
+ fileId: 'string',
805
+ fileName: 'string',
806
+ fileType: 'string',
807
+ parser: 'string',
808
+ sizeInBytes: 'number',
809
+ status: 'string',
810
+ };
811
+ }
812
+ constructor(map) {
813
+ super(map);
814
+ }
815
+ }
816
+ exports.DescribeFileResponseBodyData = DescribeFileResponseBodyData;
817
+ class GetIndexJobStatusResponseBodyDataDocuments extends $tea.Model {
818
+ static names() {
819
+ return {
820
+ code: 'Code',
821
+ docId: 'DocId',
822
+ docName: 'DocName',
176
823
  message: 'Message',
177
- requestId: 'RequestId',
178
824
  status: 'Status',
179
- success: 'Success',
180
825
  };
181
826
  }
182
827
  static types() {
183
828
  return {
184
829
  code: 'string',
185
- data: DescribeFileResponseBodyData,
830
+ docId: 'string',
831
+ docName: 'string',
186
832
  message: 'string',
187
- requestId: 'string',
188
833
  status: 'string',
189
- success: 'boolean',
190
834
  };
191
835
  }
192
836
  constructor(map) {
193
837
  super(map);
194
838
  }
195
839
  }
196
- exports.DescribeFileResponseBody = DescribeFileResponseBody;
197
- class DescribeFileResponse extends $tea.Model {
840
+ exports.GetIndexJobStatusResponseBodyDataDocuments = GetIndexJobStatusResponseBodyDataDocuments;
841
+ class GetIndexJobStatusResponseBodyData extends $tea.Model {
198
842
  static names() {
199
843
  return {
200
- headers: 'headers',
201
- statusCode: 'statusCode',
202
- body: 'body',
844
+ documents: 'Documents',
845
+ jobId: 'JobId',
846
+ status: 'Status',
203
847
  };
204
848
  }
205
849
  static types() {
206
850
  return {
207
- headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
208
- statusCode: 'number',
209
- body: DescribeFileResponseBody,
851
+ documents: { 'type': 'array', 'itemType': GetIndexJobStatusResponseBodyDataDocuments },
852
+ jobId: 'string',
853
+ status: 'string',
210
854
  };
211
855
  }
212
856
  constructor(map) {
213
857
  super(map);
214
858
  }
215
859
  }
216
- exports.DescribeFileResponse = DescribeFileResponse;
217
- class AddFileResponseBodyData extends $tea.Model {
860
+ exports.GetIndexJobStatusResponseBodyData = GetIndexJobStatusResponseBodyData;
861
+ class RetrieveRequestRerank extends $tea.Model {
218
862
  static names() {
219
863
  return {
220
- fileId: 'FileId',
221
- parser: 'Parser',
864
+ modelName: 'ModelName',
222
865
  };
223
866
  }
224
867
  static types() {
225
868
  return {
226
- fileId: 'string',
227
- parser: 'string',
869
+ modelName: 'string',
228
870
  };
229
871
  }
230
872
  constructor(map) {
231
873
  super(map);
232
874
  }
233
875
  }
234
- exports.AddFileResponseBodyData = AddFileResponseBodyData;
235
- class ApplyFileUploadLeaseResponseBodyDataParam extends $tea.Model {
876
+ exports.RetrieveRequestRerank = RetrieveRequestRerank;
877
+ class RetrieveRequestRewrite extends $tea.Model {
236
878
  static names() {
237
879
  return {
238
- headers: 'Headers',
239
- method: 'Method',
240
- url: 'Url',
880
+ modelName: 'ModelName',
241
881
  };
242
882
  }
243
883
  static types() {
244
884
  return {
245
- headers: 'any',
246
- method: 'string',
247
- url: 'string',
885
+ modelName: 'string',
248
886
  };
249
887
  }
250
888
  constructor(map) {
251
889
  super(map);
252
890
  }
253
891
  }
254
- exports.ApplyFileUploadLeaseResponseBodyDataParam = ApplyFileUploadLeaseResponseBodyDataParam;
255
- class ApplyFileUploadLeaseResponseBodyData extends $tea.Model {
892
+ exports.RetrieveRequestRewrite = RetrieveRequestRewrite;
893
+ class RetrieveResponseBodyDataNodes extends $tea.Model {
256
894
  static names() {
257
895
  return {
258
- fileUploadLeaseId: 'FileUploadLeaseId',
259
- param: 'Param',
260
- type: 'Type',
896
+ metadata: 'Metadata',
897
+ score: 'Score',
898
+ text: 'Text',
261
899
  };
262
900
  }
263
901
  static types() {
264
902
  return {
265
- fileUploadLeaseId: 'string',
266
- param: ApplyFileUploadLeaseResponseBodyDataParam,
267
- type: 'string',
903
+ metadata: 'any',
904
+ score: 'number',
905
+ text: 'string',
268
906
  };
269
907
  }
270
908
  constructor(map) {
271
909
  super(map);
272
910
  }
273
911
  }
274
- exports.ApplyFileUploadLeaseResponseBodyData = ApplyFileUploadLeaseResponseBodyData;
275
- class DescribeFileResponseBodyData extends $tea.Model {
912
+ exports.RetrieveResponseBodyDataNodes = RetrieveResponseBodyDataNodes;
913
+ class RetrieveResponseBodyData extends $tea.Model {
276
914
  static names() {
277
915
  return {
278
- categoryId: 'CategoryId',
279
- createTime: 'CreateTime',
280
- fileId: 'FileId',
281
- fileName: 'FileName',
282
- fileType: 'FileType',
283
- parser: 'Parser',
284
- sizeInBytes: 'SizeInBytes',
285
- status: 'Status',
916
+ nodes: 'Nodes',
286
917
  };
287
918
  }
288
919
  static types() {
289
920
  return {
290
- categoryId: 'string',
291
- createTime: 'string',
292
- fileId: 'string',
293
- fileName: 'string',
294
- fileType: 'string',
295
- parser: 'string',
296
- sizeInBytes: 'number',
297
- status: 'string',
921
+ nodes: { 'type': 'array', 'itemType': RetrieveResponseBodyDataNodes },
298
922
  };
299
923
  }
300
924
  constructor(map) {
301
925
  super(map);
302
926
  }
303
927
  }
304
- exports.DescribeFileResponseBodyData = DescribeFileResponseBodyData;
928
+ exports.RetrieveResponseBodyData = RetrieveResponseBodyData;
929
+ class SubmitIndexAddDocumentsJobResponseBodyData extends $tea.Model {
930
+ static names() {
931
+ return {
932
+ id: 'Id',
933
+ };
934
+ }
935
+ static types() {
936
+ return {
937
+ id: 'string',
938
+ };
939
+ }
940
+ constructor(map) {
941
+ super(map);
942
+ }
943
+ }
944
+ exports.SubmitIndexAddDocumentsJobResponseBodyData = SubmitIndexAddDocumentsJobResponseBodyData;
945
+ class SubmitIndexJobResponseBodyData extends $tea.Model {
946
+ static names() {
947
+ return {
948
+ id: 'Id',
949
+ indexId: 'IndexId',
950
+ };
951
+ }
952
+ static types() {
953
+ return {
954
+ id: 'string',
955
+ indexId: 'string',
956
+ };
957
+ }
958
+ constructor(map) {
959
+ super(map);
960
+ }
961
+ }
962
+ exports.SubmitIndexJobResponseBodyData = SubmitIndexJobResponseBodyData;
305
963
  class Client extends openapi_client_1.default {
306
964
  constructor(config) {
307
965
  super(config);
@@ -414,6 +1072,104 @@ class Client extends openapi_client_1.default {
414
1072
  let headers = {};
415
1073
  return await this.applyFileUploadLeaseWithOptions(CategoryId, WorkspaceId, request, headers, runtime);
416
1074
  }
1075
+ /**
1076
+ * @summary 创建并运行pipeline
1077
+ *
1078
+ * @param tmpReq CreateIndexRequest
1079
+ * @param headers map
1080
+ * @param runtime runtime options for this request RuntimeOptions
1081
+ * @return CreateIndexResponse
1082
+ */
1083
+ async createIndexWithOptions(WorkspaceId, tmpReq, headers, runtime) {
1084
+ tea_util_1.default.validateModel(tmpReq);
1085
+ let request = new CreateIndexShrinkRequest({});
1086
+ openapi_util_1.default.convert(tmpReq, request);
1087
+ if (!tea_util_1.default.isUnset(tmpReq.categoryIds)) {
1088
+ request.categoryIdsShrink = openapi_util_1.default.arrayToStringWithSpecifiedStyle(tmpReq.categoryIds, "CategoryIds", "json");
1089
+ }
1090
+ if (!tea_util_1.default.isUnset(tmpReq.columns)) {
1091
+ request.columnsShrink = openapi_util_1.default.arrayToStringWithSpecifiedStyle(tmpReq.columns, "Columns", "json");
1092
+ }
1093
+ if (!tea_util_1.default.isUnset(tmpReq.documentIds)) {
1094
+ request.documentIdsShrink = openapi_util_1.default.arrayToStringWithSpecifiedStyle(tmpReq.documentIds, "DocumentIds", "json");
1095
+ }
1096
+ let query = {};
1097
+ if (!tea_util_1.default.isUnset(request.categoryIdsShrink)) {
1098
+ query["CategoryIds"] = request.categoryIdsShrink;
1099
+ }
1100
+ if (!tea_util_1.default.isUnset(request.chunkSize)) {
1101
+ query["ChunkSize"] = request.chunkSize;
1102
+ }
1103
+ if (!tea_util_1.default.isUnset(request.columnsShrink)) {
1104
+ query["Columns"] = request.columnsShrink;
1105
+ }
1106
+ if (!tea_util_1.default.isUnset(request.description)) {
1107
+ query["Description"] = request.description;
1108
+ }
1109
+ if (!tea_util_1.default.isUnset(request.documentIdsShrink)) {
1110
+ query["DocumentIds"] = request.documentIdsShrink;
1111
+ }
1112
+ if (!tea_util_1.default.isUnset(request.embeddingModelName)) {
1113
+ query["EmbeddingModelName"] = request.embeddingModelName;
1114
+ }
1115
+ if (!tea_util_1.default.isUnset(request.name)) {
1116
+ query["Name"] = request.name;
1117
+ }
1118
+ if (!tea_util_1.default.isUnset(request.overlapSize)) {
1119
+ query["OverlapSize"] = request.overlapSize;
1120
+ }
1121
+ if (!tea_util_1.default.isUnset(request.rerankMinScore)) {
1122
+ query["RerankMinScore"] = request.rerankMinScore;
1123
+ }
1124
+ if (!tea_util_1.default.isUnset(request.rerankModelName)) {
1125
+ query["RerankModelName"] = request.rerankModelName;
1126
+ }
1127
+ if (!tea_util_1.default.isUnset(request.separator)) {
1128
+ query["Separator"] = request.separator;
1129
+ }
1130
+ if (!tea_util_1.default.isUnset(request.sinkInstanceId)) {
1131
+ query["SinkInstanceId"] = request.sinkInstanceId;
1132
+ }
1133
+ if (!tea_util_1.default.isUnset(request.sinkRegion)) {
1134
+ query["SinkRegion"] = request.sinkRegion;
1135
+ }
1136
+ if (!tea_util_1.default.isUnset(request.sinkType)) {
1137
+ query["SinkType"] = request.sinkType;
1138
+ }
1139
+ if (!tea_util_1.default.isUnset(request.sourceType)) {
1140
+ query["SourceType"] = request.sourceType;
1141
+ }
1142
+ if (!tea_util_1.default.isUnset(request.structureType)) {
1143
+ query["StructureType"] = request.structureType;
1144
+ }
1145
+ let req = new $OpenApi.OpenApiRequest({
1146
+ headers: headers,
1147
+ query: openapi_util_1.default.query(query),
1148
+ });
1149
+ let params = new $OpenApi.Params({
1150
+ action: "CreateIndex",
1151
+ version: "2023-12-29",
1152
+ protocol: "HTTPS",
1153
+ pathname: `/${openapi_util_1.default.getEncodeParam(WorkspaceId)}/index/create`,
1154
+ method: "POST",
1155
+ authType: "AK",
1156
+ style: "ROA",
1157
+ reqBodyType: "json",
1158
+ bodyType: "json",
1159
+ });
1160
+ return $tea.cast(await this.callApi(params, req, runtime), new CreateIndexResponse({}));
1161
+ }
1162
+ /**
1163
+ * @summary 创建并运行pipeline
1164
+ *
1165
+ * @param request CreateIndexRequest
1166
+ * @return CreateIndexResponse
1167
+ */
1168
+ async createIndex(WorkspaceId, request) {
1169
+ let runtime = new $Util.RuntimeOptions({});
1170
+ let headers = {};
1171
+ return await this.createIndexWithOptions(WorkspaceId, request, headers, runtime);
1172
+ }
417
1173
  /**
418
1174
  * @summary 获取文档基本信息,包括文档名称、类型、状态等。
419
1175
  *
@@ -448,6 +1204,232 @@ class Client extends openapi_client_1.default {
448
1204
  let headers = {};
449
1205
  return await this.describeFileWithOptions(WorkspaceId, FileId, headers, runtime);
450
1206
  }
1207
+ /**
1208
+ * @summary 获取Index运行状态
1209
+ *
1210
+ * @param request GetIndexJobStatusRequest
1211
+ * @param headers map
1212
+ * @param runtime runtime options for this request RuntimeOptions
1213
+ * @return GetIndexJobStatusResponse
1214
+ */
1215
+ async getIndexJobStatusWithOptions(WorkspaceId, request, headers, runtime) {
1216
+ tea_util_1.default.validateModel(request);
1217
+ let query = {};
1218
+ if (!tea_util_1.default.isUnset(request.indexId)) {
1219
+ query["IndexId"] = request.indexId;
1220
+ }
1221
+ if (!tea_util_1.default.isUnset(request.jobId)) {
1222
+ query["JobId"] = request.jobId;
1223
+ }
1224
+ let req = new $OpenApi.OpenApiRequest({
1225
+ headers: headers,
1226
+ query: openapi_util_1.default.query(query),
1227
+ });
1228
+ let params = new $OpenApi.Params({
1229
+ action: "GetIndexJobStatus",
1230
+ version: "2023-12-29",
1231
+ protocol: "HTTPS",
1232
+ pathname: `/${openapi_util_1.default.getEncodeParam(WorkspaceId)}/index/job/status`,
1233
+ method: "GET",
1234
+ authType: "AK",
1235
+ style: "ROA",
1236
+ reqBodyType: "json",
1237
+ bodyType: "json",
1238
+ });
1239
+ return $tea.cast(await this.callApi(params, req, runtime), new GetIndexJobStatusResponse({}));
1240
+ }
1241
+ /**
1242
+ * @summary 获取Index运行状态
1243
+ *
1244
+ * @param request GetIndexJobStatusRequest
1245
+ * @return GetIndexJobStatusResponse
1246
+ */
1247
+ async getIndexJobStatus(WorkspaceId, request) {
1248
+ let runtime = new $Util.RuntimeOptions({});
1249
+ let headers = {};
1250
+ return await this.getIndexJobStatusWithOptions(WorkspaceId, request, headers, runtime);
1251
+ }
1252
+ /**
1253
+ * @summary 召回测试
1254
+ *
1255
+ * @param tmpReq RetrieveRequest
1256
+ * @param headers map
1257
+ * @param runtime runtime options for this request RuntimeOptions
1258
+ * @return RetrieveResponse
1259
+ */
1260
+ async retrieveWithOptions(WorkspaceId, tmpReq, headers, runtime) {
1261
+ tea_util_1.default.validateModel(tmpReq);
1262
+ let request = new RetrieveShrinkRequest({});
1263
+ openapi_util_1.default.convert(tmpReq, request);
1264
+ if (!tea_util_1.default.isUnset(tmpReq.rerank)) {
1265
+ request.rerankShrink = openapi_util_1.default.arrayToStringWithSpecifiedStyle(tmpReq.rerank, "Rerank", "json");
1266
+ }
1267
+ if (!tea_util_1.default.isUnset(tmpReq.rewrite)) {
1268
+ request.rewriteShrink = openapi_util_1.default.arrayToStringWithSpecifiedStyle(tmpReq.rewrite, "Rewrite", "json");
1269
+ }
1270
+ let query = {};
1271
+ if (!tea_util_1.default.isUnset(request.denseSimilarityTopK)) {
1272
+ query["DenseSimilarityTopK"] = request.denseSimilarityTopK;
1273
+ }
1274
+ if (!tea_util_1.default.isUnset(request.enableReranking)) {
1275
+ query["EnableReranking"] = request.enableReranking;
1276
+ }
1277
+ if (!tea_util_1.default.isUnset(request.enableRewrite)) {
1278
+ query["EnableRewrite"] = request.enableRewrite;
1279
+ }
1280
+ if (!tea_util_1.default.isUnset(request.indexId)) {
1281
+ query["IndexId"] = request.indexId;
1282
+ }
1283
+ if (!tea_util_1.default.isUnset(request.query)) {
1284
+ query["Query"] = request.query;
1285
+ }
1286
+ if (!tea_util_1.default.isUnset(request.rerankShrink)) {
1287
+ query["Rerank"] = request.rerankShrink;
1288
+ }
1289
+ if (!tea_util_1.default.isUnset(request.rerankMinScore)) {
1290
+ query["RerankMinScore"] = request.rerankMinScore;
1291
+ }
1292
+ if (!tea_util_1.default.isUnset(request.rerankTopN)) {
1293
+ query["RerankTopN"] = request.rerankTopN;
1294
+ }
1295
+ if (!tea_util_1.default.isUnset(request.rewriteShrink)) {
1296
+ query["Rewrite"] = request.rewriteShrink;
1297
+ }
1298
+ if (!tea_util_1.default.isUnset(request.saveRetrieverHistory)) {
1299
+ query["SaveRetrieverHistory"] = request.saveRetrieverHistory;
1300
+ }
1301
+ if (!tea_util_1.default.isUnset(request.sparseSimilarityTopK)) {
1302
+ query["SparseSimilarityTopK"] = request.sparseSimilarityTopK;
1303
+ }
1304
+ let req = new $OpenApi.OpenApiRequest({
1305
+ headers: headers,
1306
+ query: openapi_util_1.default.query(query),
1307
+ });
1308
+ let params = new $OpenApi.Params({
1309
+ action: "Retrieve",
1310
+ version: "2023-12-29",
1311
+ protocol: "HTTPS",
1312
+ pathname: `/${openapi_util_1.default.getEncodeParam(WorkspaceId)}/index/retrieve`,
1313
+ method: "POST",
1314
+ authType: "AK",
1315
+ style: "ROA",
1316
+ reqBodyType: "json",
1317
+ bodyType: "json",
1318
+ });
1319
+ return $tea.cast(await this.callApi(params, req, runtime), new RetrieveResponse({}));
1320
+ }
1321
+ /**
1322
+ * @summary 召回测试
1323
+ *
1324
+ * @param request RetrieveRequest
1325
+ * @return RetrieveResponse
1326
+ */
1327
+ async retrieve(WorkspaceId, request) {
1328
+ let runtime = new $Util.RuntimeOptions({});
1329
+ let headers = {};
1330
+ return await this.retrieveWithOptions(WorkspaceId, request, headers, runtime);
1331
+ }
1332
+ /**
1333
+ * @summary 知识索引
1334
+ *
1335
+ * @param tmpReq SubmitIndexAddDocumentsJobRequest
1336
+ * @param headers map
1337
+ * @param runtime runtime options for this request RuntimeOptions
1338
+ * @return SubmitIndexAddDocumentsJobResponse
1339
+ */
1340
+ async submitIndexAddDocumentsJobWithOptions(WorkspaceId, tmpReq, headers, runtime) {
1341
+ tea_util_1.default.validateModel(tmpReq);
1342
+ let request = new SubmitIndexAddDocumentsJobShrinkRequest({});
1343
+ openapi_util_1.default.convert(tmpReq, request);
1344
+ if (!tea_util_1.default.isUnset(tmpReq.categoryIds)) {
1345
+ request.categoryIdsShrink = openapi_util_1.default.arrayToStringWithSpecifiedStyle(tmpReq.categoryIds, "CategoryIds", "json");
1346
+ }
1347
+ if (!tea_util_1.default.isUnset(tmpReq.documentIds)) {
1348
+ request.documentIdsShrink = openapi_util_1.default.arrayToStringWithSpecifiedStyle(tmpReq.documentIds, "DocumentIds", "json");
1349
+ }
1350
+ let query = {};
1351
+ if (!tea_util_1.default.isUnset(request.categoryIdsShrink)) {
1352
+ query["CategoryIds"] = request.categoryIdsShrink;
1353
+ }
1354
+ if (!tea_util_1.default.isUnset(request.documentIdsShrink)) {
1355
+ query["DocumentIds"] = request.documentIdsShrink;
1356
+ }
1357
+ if (!tea_util_1.default.isUnset(request.indexId)) {
1358
+ query["IndexId"] = request.indexId;
1359
+ }
1360
+ if (!tea_util_1.default.isUnset(request.sourceType)) {
1361
+ query["SourceType"] = request.sourceType;
1362
+ }
1363
+ let req = new $OpenApi.OpenApiRequest({
1364
+ headers: headers,
1365
+ query: openapi_util_1.default.query(query),
1366
+ });
1367
+ let params = new $OpenApi.Params({
1368
+ action: "SubmitIndexAddDocumentsJob",
1369
+ version: "2023-12-29",
1370
+ protocol: "HTTPS",
1371
+ pathname: `/${openapi_util_1.default.getEncodeParam(WorkspaceId)}/index/add_documents_to_index`,
1372
+ method: "POST",
1373
+ authType: "AK",
1374
+ style: "ROA",
1375
+ reqBodyType: "json",
1376
+ bodyType: "json",
1377
+ });
1378
+ return $tea.cast(await this.callApi(params, req, runtime), new SubmitIndexAddDocumentsJobResponse({}));
1379
+ }
1380
+ /**
1381
+ * @summary 知识索引
1382
+ *
1383
+ * @param request SubmitIndexAddDocumentsJobRequest
1384
+ * @return SubmitIndexAddDocumentsJobResponse
1385
+ */
1386
+ async submitIndexAddDocumentsJob(WorkspaceId, request) {
1387
+ let runtime = new $Util.RuntimeOptions({});
1388
+ let headers = {};
1389
+ return await this.submitIndexAddDocumentsJobWithOptions(WorkspaceId, request, headers, runtime);
1390
+ }
1391
+ /**
1392
+ * @summary 提交索引任务
1393
+ *
1394
+ * @param request SubmitIndexJobRequest
1395
+ * @param headers map
1396
+ * @param runtime runtime options for this request RuntimeOptions
1397
+ * @return SubmitIndexJobResponse
1398
+ */
1399
+ async submitIndexJobWithOptions(WorkspaceId, request, headers, runtime) {
1400
+ tea_util_1.default.validateModel(request);
1401
+ let query = {};
1402
+ if (!tea_util_1.default.isUnset(request.indexId)) {
1403
+ query["IndexId"] = request.indexId;
1404
+ }
1405
+ let req = new $OpenApi.OpenApiRequest({
1406
+ headers: headers,
1407
+ query: openapi_util_1.default.query(query),
1408
+ });
1409
+ let params = new $OpenApi.Params({
1410
+ action: "SubmitIndexJob",
1411
+ version: "2023-12-29",
1412
+ protocol: "HTTPS",
1413
+ pathname: `/${openapi_util_1.default.getEncodeParam(WorkspaceId)}/index/submit_index_job`,
1414
+ method: "POST",
1415
+ authType: "AK",
1416
+ style: "ROA",
1417
+ reqBodyType: "json",
1418
+ bodyType: "json",
1419
+ });
1420
+ return $tea.cast(await this.callApi(params, req, runtime), new SubmitIndexJobResponse({}));
1421
+ }
1422
+ /**
1423
+ * @summary 提交索引任务
1424
+ *
1425
+ * @param request SubmitIndexJobRequest
1426
+ * @return SubmitIndexJobResponse
1427
+ */
1428
+ async submitIndexJob(WorkspaceId, request) {
1429
+ let runtime = new $Util.RuntimeOptions({});
1430
+ let headers = {};
1431
+ return await this.submitIndexJobWithOptions(WorkspaceId, request, headers, runtime);
1432
+ }
451
1433
  }
452
1434
  exports.default = Client;
453
1435
  //# sourceMappingURL=client.js.map