@wildix/wim-knowledge-base-client 0.0.10 → 0.0.13

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.
Files changed (32) hide show
  1. package/dist-cjs/KnowledgeBase.js +4 -0
  2. package/dist-cjs/commands/CleanDataSourceCommand.js +21 -0
  3. package/dist-cjs/commands/CloneDataSourceCommand.js +21 -0
  4. package/dist-cjs/commands/index.js +2 -0
  5. package/dist-cjs/models/models_0.js +37 -36
  6. package/dist-cjs/protocols/Aws_restJson1.js +70 -3
  7. package/dist-es/KnowledgeBase.js +4 -0
  8. package/dist-es/commands/CleanDataSourceCommand.js +17 -0
  9. package/dist-es/commands/CloneDataSourceCommand.js +17 -0
  10. package/dist-es/commands/index.js +2 -0
  11. package/dist-es/models/models_0.js +36 -35
  12. package/dist-es/protocols/Aws_restJson1.js +64 -2
  13. package/dist-types/KnowledgeBase.d.ts +14 -0
  14. package/dist-types/KnowledgeBaseClient.d.ts +4 -2
  15. package/dist-types/commands/CleanDataSourceCommand.d.ts +83 -0
  16. package/dist-types/commands/CloneDataSourceCommand.d.ts +85 -0
  17. package/dist-types/commands/CreateDataSourceCommand.d.ts +4 -4
  18. package/dist-types/commands/CreateDocumentCommand.d.ts +1 -1
  19. package/dist-types/commands/GetDataSourceCommand.d.ts +2 -2
  20. package/dist-types/commands/GetDocumentCommand.d.ts +1 -1
  21. package/dist-types/commands/GetSyncLogsCommand.d.ts +2 -0
  22. package/dist-types/commands/GetSyncStatusCommand.d.ts +7 -0
  23. package/dist-types/commands/ListDataSourcesCommand.d.ts +2 -2
  24. package/dist-types/commands/ListDocumentsCommand.d.ts +1 -1
  25. package/dist-types/commands/QueryKnowledgeBaseCommand.d.ts +2 -1
  26. package/dist-types/commands/SearchKnowledgeBaseCommand.d.ts +3 -1
  27. package/dist-types/commands/UpdateDataSourceCommand.d.ts +4 -4
  28. package/dist-types/commands/UpdateDocumentCommand.d.ts +1 -1
  29. package/dist-types/commands/index.d.ts +2 -0
  30. package/dist-types/models/models_0.d.ts +243 -35
  31. package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
  32. package/package.json +1 -1
@@ -34,6 +34,84 @@ export declare class UnauthorizedException extends __BaseException {
34
34
  */
35
35
  constructor(opts: __ExceptionOptionType<UnauthorizedException, __BaseException>);
36
36
  }
37
+ /**
38
+ * @public
39
+ */
40
+ export interface CleanDataSourceInput {
41
+ /**
42
+ * The unique identifier of the tenant when a service token is used.
43
+ * @public
44
+ */
45
+ companyId?: string | undefined;
46
+ /**
47
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
48
+ * @public
49
+ */
50
+ dataSourceId: string;
51
+ }
52
+ /**
53
+ * @public
54
+ */
55
+ export interface CleanDataSourceOutput {
56
+ }
57
+ /**
58
+ * @public
59
+ */
60
+ export declare class DataSourceNotFoundException extends __BaseException {
61
+ readonly name: "DataSourceNotFoundException";
62
+ readonly $fault: "client";
63
+ /**
64
+ * @internal
65
+ */
66
+ constructor(opts: __ExceptionOptionType<DataSourceNotFoundException, __BaseException>);
67
+ }
68
+ /**
69
+ * @public
70
+ */
71
+ export declare class DocumentNotFoundException extends __BaseException {
72
+ readonly name: "DocumentNotFoundException";
73
+ readonly $fault: "client";
74
+ /**
75
+ * @internal
76
+ */
77
+ constructor(opts: __ExceptionOptionType<DocumentNotFoundException, __BaseException>);
78
+ }
79
+ /**
80
+ * @public
81
+ */
82
+ export declare class KnowledgeBaseNotFoundException extends __BaseException {
83
+ readonly name: "KnowledgeBaseNotFoundException";
84
+ readonly $fault: "client";
85
+ /**
86
+ * @internal
87
+ */
88
+ constructor(opts: __ExceptionOptionType<KnowledgeBaseNotFoundException, __BaseException>);
89
+ }
90
+ /**
91
+ * @public
92
+ */
93
+ export interface CloneDataSourceInput {
94
+ /**
95
+ * The unique identifier of the tenant when a service token is used.
96
+ * @public
97
+ */
98
+ companyId?: string | undefined;
99
+ /**
100
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
101
+ * @public
102
+ */
103
+ dataSourceId: string;
104
+ }
105
+ /**
106
+ * @public
107
+ */
108
+ export interface CloneDataSourceOutput {
109
+ /**
110
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
111
+ * @public
112
+ */
113
+ dataSourceId: string;
114
+ }
37
115
  /**
38
116
  * @public
39
117
  */
@@ -315,6 +393,10 @@ export interface DataSourceItem {
315
393
  * @public
316
394
  */
317
395
  syncSchedule?: string | undefined;
396
+ /**
397
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
398
+ * @public
399
+ */
318
400
  id: string;
319
401
  companyId: string;
320
402
  createdAt: string;
@@ -342,39 +424,6 @@ export interface DataSourceItem {
342
424
  export interface CreateDataSourceOutput {
343
425
  dataSource: DataSourceItem;
344
426
  }
345
- /**
346
- * @public
347
- */
348
- export declare class DataSourceNotFoundException extends __BaseException {
349
- readonly name: "DataSourceNotFoundException";
350
- readonly $fault: "client";
351
- /**
352
- * @internal
353
- */
354
- constructor(opts: __ExceptionOptionType<DataSourceNotFoundException, __BaseException>);
355
- }
356
- /**
357
- * @public
358
- */
359
- export declare class DocumentNotFoundException extends __BaseException {
360
- readonly name: "DocumentNotFoundException";
361
- readonly $fault: "client";
362
- /**
363
- * @internal
364
- */
365
- constructor(opts: __ExceptionOptionType<DocumentNotFoundException, __BaseException>);
366
- }
367
- /**
368
- * @public
369
- */
370
- export declare class KnowledgeBaseNotFoundException extends __BaseException {
371
- readonly name: "KnowledgeBaseNotFoundException";
372
- readonly $fault: "client";
373
- /**
374
- * @internal
375
- */
376
- constructor(opts: __ExceptionOptionType<KnowledgeBaseNotFoundException, __BaseException>);
377
- }
378
427
  /**
379
428
  * @public
380
429
  */
@@ -414,6 +463,10 @@ export interface CreateDocumentInput {
414
463
  * @public
415
464
  */
416
465
  companyId?: string | undefined;
466
+ /**
467
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
468
+ * @public
469
+ */
417
470
  dataSourceId: string;
418
471
  }
419
472
  /**
@@ -422,6 +475,7 @@ export interface CreateDocumentInput {
422
475
  */
423
476
  export declare const DocumentStatus: {
424
477
  readonly COMPLETED: "completed";
478
+ readonly DRAFT: "draft";
425
479
  readonly FAILED: "failed";
426
480
  readonly PENDING: "pending";
427
481
  readonly PROCESSING: "processing";
@@ -464,8 +518,16 @@ export interface DocumentItem {
464
518
  * @public
465
519
  */
466
520
  originalId?: string | undefined;
521
+ /**
522
+ * The ID of the document. Example: 123e4567-e89b-12d3-a456-426614174000
523
+ * @public
524
+ */
467
525
  id: string;
468
526
  companyId: string;
527
+ /**
528
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
529
+ * @public
530
+ */
469
531
  dataSourceId: string;
470
532
  s3OriginalKey?: string | undefined;
471
533
  s3MarkdownKey?: string | undefined;
@@ -516,6 +578,10 @@ export interface KnowledgeBaseItem {
516
578
  */
517
579
  description?: string | undefined;
518
580
  dataSources: (string)[];
581
+ /**
582
+ * The ID of the knowledge base. Example: 123e4567-e89b-12d3-a456-426614174000
583
+ * @public
584
+ */
519
585
  id: string;
520
586
  companyId: string;
521
587
  createdAt: string;
@@ -536,6 +602,10 @@ export interface DeleteDataSourceInput {
536
602
  * @public
537
603
  */
538
604
  companyId?: string | undefined;
605
+ /**
606
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
607
+ * @public
608
+ */
539
609
  dataSourceId: string;
540
610
  }
541
611
  /**
@@ -552,7 +622,15 @@ export interface DeleteDocumentInput {
552
622
  * @public
553
623
  */
554
624
  companyId?: string | undefined;
625
+ /**
626
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
627
+ * @public
628
+ */
555
629
  dataSourceId: string;
630
+ /**
631
+ * The ID of the document. Example: 123e4567-e89b-12d3-a456-426614174000
632
+ * @public
633
+ */
556
634
  documentId: string;
557
635
  }
558
636
  /**
@@ -569,6 +647,10 @@ export interface DeleteKnowledgeBaseInput {
569
647
  * @public
570
648
  */
571
649
  companyId?: string | undefined;
650
+ /**
651
+ * The ID of the knowledge base. Example: 123e4567-e89b-12d3-a456-426614174000
652
+ * @public
653
+ */
572
654
  knowledgeBaseId: string;
573
655
  }
574
656
  /**
@@ -597,6 +679,10 @@ export interface GetDataSourceInput {
597
679
  * @public
598
680
  */
599
681
  companyId?: string | undefined;
682
+ /**
683
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
684
+ * @public
685
+ */
600
686
  dataSourceId: string;
601
687
  }
602
688
  /**
@@ -614,7 +700,15 @@ export interface GetDocumentInput {
614
700
  * @public
615
701
  */
616
702
  companyId?: string | undefined;
703
+ /**
704
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
705
+ * @public
706
+ */
617
707
  dataSourceId: string;
708
+ /**
709
+ * The ID of the document. Example: 123e4567-e89b-12d3-a456-426614174000
710
+ * @public
711
+ */
618
712
  documentId: string;
619
713
  }
620
714
  /**
@@ -632,7 +726,15 @@ export interface GetDocumentPresignedDownloadUrlInput {
632
726
  * @public
633
727
  */
634
728
  companyId?: string | undefined;
729
+ /**
730
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
731
+ * @public
732
+ */
635
733
  dataSourceId: string;
734
+ /**
735
+ * The ID of the document. Example: 123e4567-e89b-12d3-a456-426614174000
736
+ * @public
737
+ */
636
738
  documentId: string;
637
739
  documentType?: DownloadDocumentType | undefined;
638
740
  }
@@ -651,7 +753,15 @@ export interface GetDocumentPresignedUploadUrlInput {
651
753
  * @public
652
754
  */
653
755
  companyId?: string | undefined;
756
+ /**
757
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
758
+ * @public
759
+ */
654
760
  dataSourceId: string;
761
+ /**
762
+ * The ID of the document. Example: 123e4567-e89b-12d3-a456-426614174000
763
+ * @public
764
+ */
655
765
  documentId: string;
656
766
  }
657
767
  /**
@@ -669,6 +779,10 @@ export interface GetExtraInfoForDataSourceInput {
669
779
  * @public
670
780
  */
671
781
  companyId?: string | undefined;
782
+ /**
783
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
784
+ * @public
785
+ */
672
786
  dataSourceId: string;
673
787
  parameters: __DocumentType;
674
788
  }
@@ -687,6 +801,10 @@ export interface GetKnowledgeBaseInput {
687
801
  * @public
688
802
  */
689
803
  companyId?: string | undefined;
804
+ /**
805
+ * The ID of the knowledge base. Example: 123e4567-e89b-12d3-a456-426614174000
806
+ * @public
807
+ */
690
808
  knowledgeBaseId: string;
691
809
  }
692
810
  /**
@@ -704,7 +822,21 @@ export interface GetSyncLogsInput {
704
822
  * @public
705
823
  */
706
824
  companyId?: string | undefined;
825
+ /**
826
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
827
+ * @public
828
+ */
707
829
  dataSourceId: string;
830
+ /**
831
+ * The number of logs to return. Example: 50
832
+ * @public
833
+ */
834
+ limit?: number | undefined;
835
+ /**
836
+ * The offset of the logs to return. Example: 0
837
+ * @public
838
+ */
839
+ offset?: number | undefined;
708
840
  }
709
841
  /**
710
842
  * @public
@@ -743,6 +875,10 @@ export interface GetSyncStatusInput {
743
875
  * @public
744
876
  */
745
877
  companyId?: string | undefined;
878
+ /**
879
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
880
+ * @public
881
+ */
746
882
  dataSourceId: string;
747
883
  }
748
884
  /**
@@ -760,6 +896,11 @@ export interface GetSyncStatusOutput {
760
896
  * @public
761
897
  */
762
898
  syncErrorMessage?: string | undefined;
899
+ /**
900
+ * The last logs of the sync.
901
+ * @public
902
+ */
903
+ lastSyncLogs?: (SyncLogItem)[] | undefined;
763
904
  }
764
905
  /**
765
906
  * @public
@@ -786,6 +927,10 @@ export interface ListDocumentsInput {
786
927
  * @public
787
928
  */
788
929
  companyId?: string | undefined;
930
+ /**
931
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
932
+ * @public
933
+ */
789
934
  dataSourceId: string;
790
935
  }
791
936
  /**
@@ -877,17 +1022,34 @@ export interface QueryKnowledgeBaseInput {
877
1022
  * @public
878
1023
  */
879
1024
  companyId?: string | undefined;
1025
+ /**
1026
+ * The ID of the knowledge base. Example: 123e4567-e89b-12d3-a456-426614174000
1027
+ * @public
1028
+ */
880
1029
  knowledgeBaseId: string;
1030
+ /**
1031
+ * The query to search the knowledge base. Example: What is the product knowledge base?
1032
+ * @public
1033
+ */
881
1034
  query: string;
1035
+ /**
1036
+ * The search configuration to use for the query. Example: \{topK: 10, threshold: 0.5, searchStrategy: 'hybrid'\}
1037
+ * @public
1038
+ */
882
1039
  searchConfig?: SearchConfig | undefined;
1040
+ /**
1041
+ * The LLM configuration to use for the query. Example: \{provider: 'openai', model: 'gpt-4o', temperature: 0.5\}
1042
+ * @public
1043
+ */
883
1044
  llmConfig?: LlmConfig | undefined;
884
1045
  }
885
1046
  /**
886
1047
  * @public
887
1048
  */
888
1049
  export interface QueryKnowledgeBaseOutput {
889
- result: string;
1050
+ answer: string;
890
1051
  metadata: __DocumentType;
1052
+ sources: __DocumentType;
891
1053
  }
892
1054
  /**
893
1055
  * @public
@@ -898,19 +1060,41 @@ export interface SearchKnowledgeBaseInput {
898
1060
  * @public
899
1061
  */
900
1062
  companyId?: string | undefined;
1063
+ /**
1064
+ * The ID of the knowledge base. Example: 123e4567-e89b-12d3-a456-426614174000
1065
+ * @public
1066
+ */
901
1067
  knowledgeBaseId: string;
1068
+ /**
1069
+ * The query to search the knowledge base. Example: What is the product knowledge base?
1070
+ * @public
1071
+ */
902
1072
  query: string;
1073
+ /**
1074
+ * The search configuration to use for the search. Example: \{topK: 10, threshold: 0.5, searchStrategy: 'hybrid'\}
1075
+ * @public
1076
+ */
903
1077
  searchConfig?: SearchConfig | undefined;
904
1078
  }
905
1079
  /**
906
1080
  * @public
907
1081
  */
908
1082
  export interface SearchKnowledgeBaseResult {
1083
+ /**
1084
+ * The ID of the document. Example: 123e4567-e89b-12d3-a456-426614174000
1085
+ * @public
1086
+ */
909
1087
  documentId: string;
1088
+ documentTitle: string;
910
1089
  score: number;
1090
+ /**
1091
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
1092
+ * @public
1093
+ */
911
1094
  source: string;
912
1095
  content: string;
913
- url: string;
1096
+ documentUrl: string;
1097
+ dataSourceType: DataSourceType;
914
1098
  }
915
1099
  /**
916
1100
  * @public
@@ -927,6 +1111,10 @@ export interface StartSyncDataSourceInput {
927
1111
  * @public
928
1112
  */
929
1113
  companyId?: string | undefined;
1114
+ /**
1115
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
1116
+ * @public
1117
+ */
930
1118
  dataSourceId: string;
931
1119
  syncType: SyncDataSourceMode;
932
1120
  }
@@ -944,6 +1132,10 @@ export interface StopSyncDataSourceInput {
944
1132
  * @public
945
1133
  */
946
1134
  companyId?: string | undefined;
1135
+ /**
1136
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
1137
+ * @public
1138
+ */
947
1139
  dataSourceId: string;
948
1140
  }
949
1141
  /**
@@ -986,6 +1178,10 @@ export interface UpdateDataSourceInput {
986
1178
  * @public
987
1179
  */
988
1180
  companyId?: string | undefined;
1181
+ /**
1182
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
1183
+ * @public
1184
+ */
989
1185
  dataSourceId: string;
990
1186
  }
991
1187
  /**
@@ -1033,7 +1229,15 @@ export interface UpdateDocumentInput {
1033
1229
  * @public
1034
1230
  */
1035
1231
  companyId?: string | undefined;
1232
+ /**
1233
+ * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
1234
+ * @public
1235
+ */
1036
1236
  dataSourceId: string;
1237
+ /**
1238
+ * The ID of the document. Example: 123e4567-e89b-12d3-a456-426614174000
1239
+ * @public
1240
+ */
1037
1241
  documentId: string;
1038
1242
  }
1039
1243
  /**
@@ -1062,6 +1266,10 @@ export interface UpdateKnowledgeBaseInput {
1062
1266
  * @public
1063
1267
  */
1064
1268
  companyId?: string | undefined;
1269
+ /**
1270
+ * The ID of the knowledge base. Example: 123e4567-e89b-12d3-a456-426614174000
1271
+ * @public
1272
+ */
1065
1273
  knowledgeBaseId: string;
1066
1274
  }
1067
1275
  /**
@@ -1,3 +1,5 @@
1
+ import { CleanDataSourceCommandInput, CleanDataSourceCommandOutput } from "../commands/CleanDataSourceCommand";
2
+ import { CloneDataSourceCommandInput, CloneDataSourceCommandOutput } from "../commands/CloneDataSourceCommand";
1
3
  import { CreateDataSourceCommandInput, CreateDataSourceCommandOutput } from "../commands/CreateDataSourceCommand";
2
4
  import { CreateDocumentCommandInput, CreateDocumentCommandOutput } from "../commands/CreateDocumentCommand";
3
5
  import { CreateKnowledgeBaseCommandInput, CreateKnowledgeBaseCommandOutput } from "../commands/CreateKnowledgeBaseCommand";
@@ -24,6 +26,14 @@ import { UpdateDocumentCommandInput, UpdateDocumentCommandOutput } from "../comm
24
26
  import { UpdateKnowledgeBaseCommandInput, UpdateKnowledgeBaseCommandOutput } from "../commands/UpdateKnowledgeBaseCommand";
25
27
  import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
26
28
  import { SerdeContext as __SerdeContext } from "@smithy/types";
29
+ /**
30
+ * serializeAws_restJson1CleanDataSourceCommand
31
+ */
32
+ export declare const se_CleanDataSourceCommand: (input: CleanDataSourceCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
33
+ /**
34
+ * serializeAws_restJson1CloneDataSourceCommand
35
+ */
36
+ export declare const se_CloneDataSourceCommand: (input: CloneDataSourceCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
27
37
  /**
28
38
  * serializeAws_restJson1CreateDataSourceCommand
29
39
  */
@@ -120,6 +130,14 @@ export declare const se_UpdateDocumentCommand: (input: UpdateDocumentCommandInpu
120
130
  * serializeAws_restJson1UpdateKnowledgeBaseCommand
121
131
  */
122
132
  export declare const se_UpdateKnowledgeBaseCommand: (input: UpdateKnowledgeBaseCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
133
+ /**
134
+ * deserializeAws_restJson1CleanDataSourceCommand
135
+ */
136
+ export declare const de_CleanDataSourceCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<CleanDataSourceCommandOutput>;
137
+ /**
138
+ * deserializeAws_restJson1CloneDataSourceCommand
139
+ */
140
+ export declare const de_CloneDataSourceCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<CloneDataSourceCommandOutput>;
123
141
  /**
124
142
  * deserializeAws_restJson1CreateDataSourceCommand
125
143
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wim-knowledge-base-client",
3
3
  "description": "@wildix/wim-knowledge-base-client client",
4
- "version": "0.0.10",
4
+ "version": "0.0.13",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",