@petercatai/whisker-client 0.1.202504211903-dev → 0.1.202504281028

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 (3) hide show
  1. package/dist/api.d.ts +450 -70
  2. package/dist/api.js +126 -2
  3. package/package.json +5 -5
package/dist/api.d.ts CHANGED
@@ -20,9 +20,14 @@ export declare enum IKnowledgeTypeEnum {
20
20
  Docx = "docx",
21
21
  Pdf = "pdf",
22
22
  Qa = "qa",
23
+ Yuquedoc = "yuquedoc",
24
+ OpenapiApp = "openapi_app",
23
25
  Folder = "folder"
24
26
  }
25
- /** KnowledgeSourceEnum */
27
+ /**
28
+ * KnowledgeSourceEnum
29
+ * Specifies the source of knowledge, which influences the behavior of the resource loader
30
+ */
26
31
  export declare enum IKnowledgeSourceEnum {
27
32
  GithubRepo = "github_repo",
28
33
  GithubFile = "github_file",
@@ -44,17 +49,28 @@ export declare enum IEmbeddingModelEnum {
44
49
  export interface IBaseCharSplitConfig {
45
50
  /**
46
51
  * Chunk Size
52
+ * chunk max size
47
53
  * @min 1
48
- * @exclusiveMax 5000
49
54
  * @default 1500
50
55
  */
51
56
  chunk_size?: number;
52
57
  /**
53
58
  * Chunk Overlap
59
+ * chunk overlap size, must be less than chunk_size
54
60
  * @min 0
55
61
  * @default 150
56
62
  */
57
63
  chunk_overlap?: number;
64
+ /**
65
+ * Separators
66
+ * separator list, if None, use default separators
67
+ */
68
+ separators?: string[] | null;
69
+ /**
70
+ * Split Regex
71
+ * split_regex,if set, use it instead of separators
72
+ */
73
+ split_regex?: string | null;
58
74
  }
59
75
  /** Chunk */
60
76
  export interface IChunk {
@@ -97,7 +113,7 @@ export interface IChunk {
97
113
  * Metadata
98
114
  * Arbitrary metadata associated with the content.
99
115
  */
100
- metadata?: object | null;
116
+ metadata?: Record<string, any> | null;
101
117
  /**
102
118
  * Gmt Create
103
119
  * creation time
@@ -109,6 +125,38 @@ export interface IChunk {
109
125
  */
110
126
  gmt_modified?: string;
111
127
  }
128
+ /** ChunkSave */
129
+ export interface IChunkSave {
130
+ /** Chunk Id */
131
+ chunk_id?: string | null;
132
+ /** Space Id */
133
+ space_id: string;
134
+ /** Context */
135
+ context: string;
136
+ /** Knowledge Id */
137
+ knowledge_id: string;
138
+ /** Embedding Model Name */
139
+ embedding_model_name: string;
140
+ /** Metadata */
141
+ metadata?: Record<string, any> | null;
142
+ }
143
+ /**
144
+ * GeaGraphSplitConfig
145
+ * JSON document split configuration
146
+ * @link {https://python.langchain.com/api_reference/text_splitters/json/langchain_text_splitters.json.RecursiveJsonSplitter.html}
147
+ */
148
+ export interface IGeaGraphSplitConfig {
149
+ /**
150
+ * Type
151
+ * @default "geagraph"
152
+ */
153
+ type?: "geagraph";
154
+ /**
155
+ * Schema Id
156
+ * The maximum size for each chunk. Defaults to 2000
157
+ */
158
+ schema_id?: string | null;
159
+ }
112
160
  /** GithubFileSourceConfig */
113
161
  export interface IGithubFileSourceConfig {
114
162
  /**
@@ -161,7 +209,7 @@ export interface IGithubRepoCreate {
161
209
  * additional metadata, user can update it
162
210
  * @default {}
163
211
  */
164
- metadata?: object;
212
+ metadata?: Record<string, any>;
165
213
  /** source type */
166
214
  source_type: IKnowledgeSourceEnum;
167
215
  /**
@@ -237,7 +285,7 @@ export interface IImageCreate {
237
285
  * additional metadata, user can update it
238
286
  * @default {}
239
287
  */
240
- metadata?: object;
288
+ metadata?: Record<string, any>;
241
289
  /** source type */
242
290
  source_type: IKnowledgeSourceEnum;
243
291
  /**
@@ -286,7 +334,7 @@ export interface IJSONCreate {
286
334
  * additional metadata, user can update it
287
335
  * @default {}
288
336
  */
289
- metadata?: object;
337
+ metadata?: Record<string, any>;
290
338
  /** source type */
291
339
  source_type: IKnowledgeSourceEnum;
292
340
  /**
@@ -316,45 +364,27 @@ export interface IJSONCreate {
316
364
  /**
317
365
  * JSONSplitConfig
318
366
  * JSON document split configuration
367
+ * @link {https://python.langchain.com/api_reference/text_splitters/json/langchain_text_splitters.json.RecursiveJsonSplitter.html}
319
368
  */
320
369
  export interface IJSONSplitConfig {
321
370
  /**
322
- * Chunk Size
323
- * @min 1
324
- * @exclusiveMax 5000
325
- * @default 1500
326
- */
327
- chunk_size?: number;
328
- /**
329
- * Chunk Overlap
330
- * @min 0
331
- * @default 150
332
- */
333
- chunk_overlap?: number;
334
- /**
335
- * Split Level
336
- * Depth level for JSON splitting
337
- * @min 1
338
- * @default 1
339
- */
340
- split_level?: number;
341
- /**
342
- * Preserve Structure
343
- * Whether to preserve JSON structure
344
- * @default true
371
+ * Type
372
+ * @default "json"
345
373
  */
346
- preserve_structure?: boolean;
374
+ type?: "json";
347
375
  /**
348
- * Array Handling
349
- * Array handling mode: 'split' or 'merge'
350
- * @default "split"
376
+ * Max Chunk Size
377
+ * The maximum size for each chunk. Defaults to 2000
378
+ * @default 2000
351
379
  */
352
- array_handling?: string;
380
+ max_chunk_size?: number;
353
381
  /**
354
- * Key Filters
355
- * List of keys to process; processes all keys if None
382
+ * Min Chunk Size
383
+ * The minimum size for a chunk. If None,
384
+ * defaults to the maximum chunk size minus 200, with a lower bound of 50.
385
+ * @default 200
356
386
  */
357
- key_filters?: string[] | null;
387
+ min_chunk_size?: number | null;
358
388
  }
359
389
  /** Knowledge */
360
390
  export interface IKnowledgeInput {
@@ -404,7 +434,7 @@ export interface IKnowledgeInput {
404
434
  * Split Config
405
435
  * configuration for splitting the knowledge
406
436
  */
407
- split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | IPDFSplitConfig | ITextSplitConfig | IJSONSplitConfig;
437
+ split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IGeaGraphSplitConfig;
408
438
  /**
409
439
  * File Sha
410
440
  * SHA of the file
@@ -420,7 +450,7 @@ export interface IKnowledgeInput {
420
450
  * additional metadata, user can update it
421
451
  * @default {}
422
452
  */
423
- metadata?: object;
453
+ metadata?: Record<string, any>;
424
454
  /**
425
455
  * Retrieval Count
426
456
  * count of the retrieval
@@ -490,7 +520,7 @@ export interface IKnowledgeOutput {
490
520
  * Split Config
491
521
  * configuration for splitting the knowledge
492
522
  */
493
- split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | IPDFSplitConfig | ITextSplitConfig | IJSONSplitConfig;
523
+ split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IGeaGraphSplitConfig;
494
524
  /**
495
525
  * File Sha
496
526
  * SHA of the file
@@ -505,7 +535,7 @@ export interface IKnowledgeOutput {
505
535
  * Metadata
506
536
  * additional metadata, user can update it
507
537
  */
508
- metadata?: object | null;
538
+ metadata?: Record<string, any> | null;
509
539
  /**
510
540
  * Retrieval Count
511
541
  * count of the retrieval
@@ -586,7 +616,7 @@ export interface IKnowledgeCreate {
586
616
  * Split Config
587
617
  * configuration for splitting the knowledge
588
618
  */
589
- split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | IPDFSplitConfig | ITextSplitConfig | IJSONSplitConfig;
619
+ split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IGeaGraphSplitConfig;
590
620
  /**
591
621
  * File Sha
592
622
  * SHA of the file
@@ -602,7 +632,7 @@ export interface IKnowledgeCreate {
602
632
  * additional metadata, user can update it
603
633
  * @default {}
604
634
  */
605
- metadata?: object;
635
+ metadata?: Record<string, any>;
606
636
  /**
607
637
  * Parent Id
608
638
  * parent knowledge id
@@ -639,7 +669,7 @@ export interface IMarkdownCreate {
639
669
  * additional metadata, user can update it
640
670
  * @default {}
641
671
  */
642
- metadata?: object;
672
+ metadata?: Record<string, any>;
643
673
  /** source type */
644
674
  source_type: IKnowledgeSourceEnum;
645
675
  /**
@@ -666,34 +696,38 @@ export interface IMarkdownCreate {
666
696
  /** split config of the knowledge */
667
697
  split_config: IMarkdownSplitConfig;
668
698
  }
669
- /**
670
- * MarkdownSplitConfig
671
- * Markdown document split configuration
672
- */
699
+ /** MarkdownSplitConfig */
673
700
  export interface IMarkdownSplitConfig {
674
701
  /**
675
702
  * Chunk Size
703
+ * chunk max size
676
704
  * @min 1
677
- * @exclusiveMax 5000
678
705
  * @default 1500
679
706
  */
680
707
  chunk_size?: number;
681
708
  /**
682
709
  * Chunk Overlap
710
+ * chunk overlap size, must be less than chunk_size
683
711
  * @min 0
684
712
  * @default 150
685
713
  */
686
714
  chunk_overlap?: number;
687
715
  /**
688
716
  * Separators
689
- * separator list
717
+ * List of separators to split the text. If None, uses default separators
718
+ * @default ["\n\n"]
690
719
  */
691
- separators: string[] | null;
720
+ separators?: string[];
692
721
  /**
693
722
  * Split Regex
694
- * split_regex
723
+ * split_regex,if set, use it instead of separators
695
724
  */
696
- split_regex: string | null;
725
+ split_regex?: string | null;
726
+ /**
727
+ * Type
728
+ * @default "markdown"
729
+ */
730
+ type?: "markdown";
697
731
  }
698
732
  /** OpenIdSourceConfig */
699
733
  export interface IOpenIdSourceConfig {
@@ -735,7 +769,7 @@ export interface IPDFCreate {
735
769
  * additional metadata, user can update it
736
770
  * @default {}
737
771
  */
738
- metadata?: object;
772
+ metadata?: Record<string, any>;
739
773
  /** source type */
740
774
  source_type: IKnowledgeSourceEnum;
741
775
  /**
@@ -769,17 +803,33 @@ export interface IPDFCreate {
769
803
  export interface IPDFSplitConfig {
770
804
  /**
771
805
  * Chunk Size
806
+ * chunk max size
772
807
  * @min 1
773
- * @exclusiveMax 5000
774
808
  * @default 1500
775
809
  */
776
810
  chunk_size?: number;
777
811
  /**
778
812
  * Chunk Overlap
813
+ * chunk overlap size, must be less than chunk_size
779
814
  * @min 0
780
815
  * @default 150
781
816
  */
782
817
  chunk_overlap?: number;
818
+ /**
819
+ * Separators
820
+ * separator list, if None, use default separators
821
+ */
822
+ separators?: string[] | null;
823
+ /**
824
+ * Split Regex
825
+ * split_regex,if set, use it instead of separators
826
+ */
827
+ split_regex?: string | null;
828
+ /**
829
+ * Type
830
+ * @default "pdf"
831
+ */
832
+ type?: "pdf";
783
833
  /**
784
834
  * Split By Page
785
835
  * Whether to split by pages
@@ -837,7 +887,7 @@ export interface IPageParamsChunk {
837
887
  * Eq Conditions
838
888
  * list of equality conditions, each as a dict with key and value
839
889
  */
840
- eq_conditions?: object | null;
890
+ eq_conditions?: Record<string, any> | null;
841
891
  }
842
892
  /** PageParams[Knowledge] */
843
893
  export interface IPageParamsKnowledge {
@@ -871,7 +921,41 @@ export interface IPageParamsKnowledge {
871
921
  * Eq Conditions
872
922
  * list of equality conditions, each as a dict with key and value
873
923
  */
874
- eq_conditions?: object | null;
924
+ eq_conditions?: Record<string, any> | null;
925
+ }
926
+ /** PageParams[Space] */
927
+ export interface IPageParamsSpace {
928
+ /**
929
+ * Page
930
+ * page number
931
+ * @min 1
932
+ * @default 1
933
+ */
934
+ page?: number;
935
+ /**
936
+ * Page Size
937
+ * page size
938
+ * @min 1
939
+ * @max 1000
940
+ * @default 10
941
+ */
942
+ page_size?: number;
943
+ /**
944
+ * Order By
945
+ * order by field
946
+ */
947
+ order_by?: string | null;
948
+ /**
949
+ * Order Direction
950
+ * asc or desc
951
+ * @default "asc"
952
+ */
953
+ order_direction?: string | null;
954
+ /**
955
+ * Eq Conditions
956
+ * list of equality conditions, each as a dict with key and value
957
+ */
958
+ eq_conditions?: Record<string, any> | null;
875
959
  }
876
960
  /** PageParams[Task] */
877
961
  export interface IPageParamsTask {
@@ -905,7 +989,7 @@ export interface IPageParamsTask {
905
989
  * Eq Conditions
906
990
  * list of equality conditions, each as a dict with key and value
907
991
  */
908
- eq_conditions?: object | null;
992
+ eq_conditions?: Record<string, any> | null;
909
993
  }
910
994
  /** PageResponse[Chunk] */
911
995
  export interface IPageResponseChunk {
@@ -933,6 +1017,32 @@ export interface IPageResponseKnowledge {
933
1017
  /** Total Pages */
934
1018
  total_pages: number;
935
1019
  }
1020
+ /** PageResponse[SpaceResponse] */
1021
+ export interface IPageResponseSpaceResponse {
1022
+ /** Items */
1023
+ items: ISpaceResponse[];
1024
+ /** Total */
1025
+ total: number;
1026
+ /** Page */
1027
+ page: number;
1028
+ /** Page Size */
1029
+ page_size: number;
1030
+ /** Total Pages */
1031
+ total_pages: number;
1032
+ }
1033
+ /** PageResponse[Tenant] */
1034
+ export interface IPageResponseTenant {
1035
+ /** Items */
1036
+ items: ITenant[];
1037
+ /** Total */
1038
+ total: number;
1039
+ /** Page */
1040
+ page: number;
1041
+ /** Page Size */
1042
+ page_size: number;
1043
+ /** Total Pages */
1044
+ total_pages: number;
1045
+ }
936
1046
  /** QACreate */
937
1047
  export interface IQACreate {
938
1048
  /**
@@ -957,7 +1067,7 @@ export interface IQACreate {
957
1067
  * additional metadata, user can update it
958
1068
  * @default {}
959
1069
  */
960
- metadata?: object;
1070
+ metadata?: Record<string, any>;
961
1071
  /** source type */
962
1072
  source_type: IKnowledgeSourceEnum;
963
1073
  /**
@@ -986,7 +1096,7 @@ export interface IQACreate {
986
1096
  * answer of the knowledge resource
987
1097
  */
988
1098
  answer: string;
989
- /** split config of the knowledge */
1099
+ /** split config of the knowledge, used to split the question into chunks */
990
1100
  split_config: ITextSplitConfig;
991
1101
  /** source config of the knowledge */
992
1102
  source_config?: ITextSourceConfig | null;
@@ -1000,6 +1110,14 @@ export interface IResponseModel {
1000
1110
  /** Message */
1001
1111
  message?: string | null;
1002
1112
  }
1113
+ /** ResponseModel[Chunk] */
1114
+ export interface IResponseModelChunk {
1115
+ /** Success */
1116
+ success: boolean;
1117
+ data?: IChunk | null;
1118
+ /** Message */
1119
+ message?: string | null;
1120
+ }
1003
1121
  /** ResponseModel[Knowledge] */
1004
1122
  export interface IResponseModelKnowledge {
1005
1123
  /** Success */
@@ -1060,6 +1178,30 @@ export interface IResponseModelPageResponseKnowledge {
1060
1178
  /** Message */
1061
1179
  message?: string | null;
1062
1180
  }
1181
+ /** ResponseModel[PageResponse[SpaceResponse]] */
1182
+ export interface IResponseModelPageResponseSpaceResponse {
1183
+ /** Success */
1184
+ success: boolean;
1185
+ data?: IPageResponseSpaceResponse | null;
1186
+ /** Message */
1187
+ message?: string | null;
1188
+ }
1189
+ /** ResponseModel[PageResponse[Tenant]] */
1190
+ export interface IResponseModelPageResponseTenant {
1191
+ /** Success */
1192
+ success: boolean;
1193
+ data?: IPageResponseTenant | null;
1194
+ /** Message */
1195
+ message?: string | null;
1196
+ }
1197
+ /** ResponseModel[SpaceResponse] */
1198
+ export interface IResponseModelSpaceResponse {
1199
+ /** Success */
1200
+ success: boolean;
1201
+ data?: ISpaceResponse | null;
1202
+ /** Message */
1203
+ message?: string | null;
1204
+ }
1063
1205
  /** ResponseModel[StatusStatisticsPageResponse[Task]] */
1064
1206
  export interface IResponseModelStatusStatisticsPageResponseTask {
1065
1207
  /** Success */
@@ -1084,6 +1226,15 @@ export interface IResponseModelTenant {
1084
1226
  /** Message */
1085
1227
  message?: string | null;
1086
1228
  }
1229
+ /** ResponseModel[object] */
1230
+ export interface IResponseModelObject {
1231
+ /** Success */
1232
+ success: boolean;
1233
+ /** Data */
1234
+ data?: null;
1235
+ /** Message */
1236
+ message?: string | null;
1237
+ }
1087
1238
  /** RetrievalByKnowledgeRequest */
1088
1239
  export interface IRetrievalByKnowledgeRequest {
1089
1240
  /**
@@ -1113,7 +1264,7 @@ export interface IRetrievalByKnowledgeRequest {
1113
1264
  * metadata filter
1114
1265
  * @default {}
1115
1266
  */
1116
- metadata_filter?: object;
1267
+ metadata_filter?: Record<string, any>;
1117
1268
  /**
1118
1269
  * Knowledge Id List
1119
1270
  * knowledge id list
@@ -1149,7 +1300,7 @@ export interface IRetrievalBySpaceRequest {
1149
1300
  * metadata filter
1150
1301
  * @default {}
1151
1302
  */
1152
- metadata_filter?: object;
1303
+ metadata_filter?: Record<string, any>;
1153
1304
  /**
1154
1305
  * Space Id List
1155
1306
  * space id list
@@ -1197,7 +1348,7 @@ export interface IRetrievalChunk {
1197
1348
  * Metadata
1198
1349
  * Arbitrary metadata associated with the content.
1199
1350
  */
1200
- metadata?: object | null;
1351
+ metadata?: Record<string, any> | null;
1201
1352
  /**
1202
1353
  * Gmt Create
1203
1354
  * creation time
@@ -1252,6 +1403,81 @@ export interface IS3SourceConfig {
1252
1403
  */
1253
1404
  session_token?: string | null;
1254
1405
  }
1406
+ /**
1407
+ * SpaceCreate
1408
+ * SpaceCreate model for creating space resources.
1409
+ * Attributes:
1410
+ * space_name (str): Space name, example: petercat bot group.
1411
+ * description (str): descrition of the space resource.
1412
+ */
1413
+ export interface ISpaceCreate {
1414
+ /**
1415
+ * Space Name
1416
+ * name of the space resource
1417
+ * @maxLength 64
1418
+ */
1419
+ space_name: string;
1420
+ /**
1421
+ * Description
1422
+ * descrition of the space
1423
+ * @maxLength 255
1424
+ */
1425
+ description: string;
1426
+ }
1427
+ /**
1428
+ * SpaceResponse
1429
+ * SpaceResponse model class that extends Space.
1430
+ * Attributes:
1431
+ * (str): Space ID.
1432
+ * total_size Optional[int]: size of the all kowledge in this space.
1433
+ * knowledge_size Optional[int]: count of the knowledge in this space.
1434
+ */
1435
+ export interface ISpaceResponse {
1436
+ /**
1437
+ * Space Name
1438
+ * name of the space resource
1439
+ * @maxLength 64
1440
+ */
1441
+ space_name: string;
1442
+ /**
1443
+ * Description
1444
+ * descrition of the space
1445
+ * @maxLength 255
1446
+ */
1447
+ description: string;
1448
+ /**
1449
+ * Space Id
1450
+ * space id
1451
+ */
1452
+ space_id?: string;
1453
+ /**
1454
+ * Gmt Create
1455
+ * creation time
1456
+ */
1457
+ gmt_create?: string;
1458
+ /**
1459
+ * Gmt Modified
1460
+ * update time
1461
+ */
1462
+ gmt_modified?: string;
1463
+ /**
1464
+ * Tenant Id
1465
+ * tenant id
1466
+ */
1467
+ tenant_id: string;
1468
+ /**
1469
+ * Storage Size
1470
+ * size of the all kowledge in this space
1471
+ * @default 0
1472
+ */
1473
+ storage_size?: number | null;
1474
+ /**
1475
+ * Knowledge Count
1476
+ * count of the knowledge in this space
1477
+ * @default 0
1478
+ */
1479
+ knowledge_count?: number | null;
1480
+ }
1255
1481
  /** StatusStatisticsPageResponse[Task] */
1256
1482
  export interface IStatusStatisticsPageResponseTask {
1257
1483
  /** Items */
@@ -1291,7 +1517,7 @@ export interface ITask {
1291
1517
  * Metadata
1292
1518
  * Metadata for the task
1293
1519
  */
1294
- metadata?: object | null;
1520
+ metadata?: Record<string, any> | null;
1295
1521
  /**
1296
1522
  * Error Message
1297
1523
  * Error message (only present if the task failed)
@@ -1365,7 +1591,7 @@ export interface ITenant {
1365
1591
  * Metadata
1366
1592
  * Metadata for the tenant
1367
1593
  */
1368
- metadata?: object | null;
1594
+ metadata?: Record<string, any> | null;
1369
1595
  /**
1370
1596
  * Gmt Create
1371
1597
  * tenant created time
@@ -1382,7 +1608,20 @@ export interface ITenantCreate {
1382
1608
  /** Tenant Name */
1383
1609
  tenant_name: string;
1384
1610
  /** Email */
1611
+ email: string;
1612
+ /** Metadata */
1613
+ metadata?: Record<string, any> | null;
1614
+ }
1615
+ /** TenantUpdate */
1616
+ export interface ITenantUpdate {
1617
+ /** Tenant Id */
1618
+ tenant_id: string;
1619
+ /** Tenant Name */
1620
+ tenant_name?: string | null;
1621
+ /** Email */
1385
1622
  email?: string | null;
1623
+ /** Metadata */
1624
+ metadata?: Record<string, any> | null;
1386
1625
  }
1387
1626
  /** TextCreate */
1388
1627
  export interface ITextCreate {
@@ -1408,7 +1647,7 @@ export interface ITextCreate {
1408
1647
  * additional metadata, user can update it
1409
1648
  * @default {}
1410
1649
  */
1411
- metadata?: object;
1650
+ metadata?: Record<string, any>;
1412
1651
  /** source type */
1413
1652
  source_type: IKnowledgeSourceEnum;
1414
1653
  /**
@@ -1453,13 +1692,14 @@ export interface ITextSourceConfig {
1453
1692
  export interface ITextSplitConfig {
1454
1693
  /**
1455
1694
  * Chunk Size
1695
+ * chunk max size
1456
1696
  * @min 1
1457
- * @exclusiveMax 5000
1458
1697
  * @default 1500
1459
1698
  */
1460
1699
  chunk_size?: number;
1461
1700
  /**
1462
1701
  * Chunk Overlap
1702
+ * chunk overlap size, must be less than chunk_size
1463
1703
  * @min 0
1464
1704
  * @default 150
1465
1705
  */
@@ -1469,7 +1709,17 @@ export interface ITextSplitConfig {
1469
1709
  * List of separators to split the text. If None, uses default separators
1470
1710
  * @default ["\n\n"]
1471
1711
  */
1472
- separators?: string[];
1712
+ separators?: string[] | null;
1713
+ /**
1714
+ * Split Regex
1715
+ * split_regex,if set, use it instead of separators
1716
+ */
1717
+ split_regex?: string | null;
1718
+ /**
1719
+ * Type
1720
+ * @default "text"
1721
+ */
1722
+ type?: "text";
1473
1723
  /**
1474
1724
  * Keep Separator
1475
1725
  * Whether to keep the separator and where to place it in each corresponding chunk (True='start')
@@ -1574,14 +1824,14 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1574
1824
  */
1575
1825
  addKnowledge: (data: (IKnowledgeCreate | ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IGithubRepoCreate | IQACreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
1576
1826
  /**
1577
- * @description Only makes modifications to the enabled field.
1827
+ * No description
1578
1828
  *
1579
1829
  * @tags knowledge
1580
1830
  * @name UpdateKnowledge
1581
1831
  * @summary Update Knowledge
1582
1832
  * @request POST:/api/knowledge/update
1583
1833
  */
1584
- updateKnowledge: (data: IKnowledgeInput[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
1834
+ updateKnowledge: (data: IKnowledgeInput, params?: RequestParams) => Promise<HttpResponse<IResponseModelKnowledge, void | IHTTPValidationError>>;
1585
1835
  /**
1586
1836
  * No description
1587
1837
  *
@@ -1615,6 +1865,15 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1615
1865
  /** Knowledge Id */
1616
1866
  knowledge_id: string;
1617
1867
  }, params?: RequestParams) => Promise<HttpResponse<IResponseModelNoneType, void | IHTTPValidationError>>;
1868
+ /**
1869
+ * No description
1870
+ *
1871
+ * @tags knowledge
1872
+ * @name GetEmbeddingModelsList
1873
+ * @summary Get Embedding Models List
1874
+ * @request GET:/api/knowledge/embedding/models
1875
+ */
1876
+ getEmbeddingModelsList: (params?: RequestParams) => Promise<HttpResponse<any, void | IHTTPValidationError>>;
1618
1877
  };
1619
1878
  retrieval: {
1620
1879
  /**
@@ -1699,6 +1958,33 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1699
1958
  * @request POST:/api/chunk/list
1700
1959
  */
1701
1960
  getChunkList: (data: IPageParamsChunk, params?: RequestParams) => Promise<HttpResponse<IResponseModelPageResponseChunk, void | IHTTPValidationError>>;
1961
+ /**
1962
+ * No description
1963
+ *
1964
+ * @tags chunk
1965
+ * @name DeleteChunkById
1966
+ * @summary Delete Chunk By Id
1967
+ * @request DELETE:/api/chunk/id/{id}/model_name/{model_name}
1968
+ */
1969
+ deleteChunkById: (id: string, modelName: string, params?: RequestParams) => Promise<HttpResponse<IResponseModelObject, void | IHTTPValidationError>>;
1970
+ /**
1971
+ * No description
1972
+ *
1973
+ * @tags chunk
1974
+ * @name GetChunkById
1975
+ * @summary Get Chunk By Id
1976
+ * @request GET:/api/chunk/id/{id}/model_name/{model_name}
1977
+ */
1978
+ getChunkById: (id: string, modelName: string, params?: RequestParams) => Promise<HttpResponse<IResponseModelChunk, void | IHTTPValidationError>>;
1979
+ /**
1980
+ * No description
1981
+ *
1982
+ * @tags chunk
1983
+ * @name SaveChunk
1984
+ * @summary Save Chunk
1985
+ * @request POST:/api/chunk/save
1986
+ */
1987
+ saveChunk: (data: IChunkSave, params?: RequestParams) => Promise<HttpResponse<IResponseModelChunk, void | IHTTPValidationError>>;
1702
1988
  };
1703
1989
  tenant: {
1704
1990
  /**
@@ -1710,6 +1996,53 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1710
1996
  * @request POST:/api/tenant/create
1711
1997
  */
1712
1998
  createTenant: (data: ITenantCreate, params?: RequestParams) => Promise<HttpResponse<IResponseModelTenant, void | IHTTPValidationError>>;
1999
+ /**
2000
+ * No description
2001
+ *
2002
+ * @tags tenant
2003
+ * @name GetTenantById
2004
+ * @summary Query Tenant
2005
+ * @request GET:/api/tenant/id/{id}
2006
+ */
2007
+ getTenantById: (id: string, params?: RequestParams) => Promise<HttpResponse<IResponseModelTenant, void | IHTTPValidationError>>;
2008
+ /**
2009
+ * No description
2010
+ *
2011
+ * @tags tenant
2012
+ * @name DeleteTenantById
2013
+ * @summary Delete Tenant
2014
+ * @request DELETE:/api/tenant/{id}
2015
+ */
2016
+ deleteTenantById: (id: string, params?: RequestParams) => Promise<HttpResponse<IResponseModelObject, void | IHTTPValidationError>>;
2017
+ /**
2018
+ * No description
2019
+ *
2020
+ * @tags tenant
2021
+ * @name UpdateTenant
2022
+ * @summary Update Tenant
2023
+ * @request POST:/api/tenant/update
2024
+ */
2025
+ updateTenant: (data: ITenantUpdate, params?: RequestParams) => Promise<HttpResponse<IResponseModelTenant, void | IHTTPValidationError>>;
2026
+ /**
2027
+ * No description
2028
+ *
2029
+ * @tags tenant
2030
+ * @name GetTenantList
2031
+ * @summary Get Tenant List
2032
+ * @request GET:/api/tenant/list
2033
+ */
2034
+ getTenantList: (query?: {
2035
+ /**
2036
+ * Page
2037
+ * @default 1
2038
+ */
2039
+ page?: number;
2040
+ /**
2041
+ * Page Size
2042
+ * @default 10
2043
+ */
2044
+ page_size?: number;
2045
+ }, params?: RequestParams) => Promise<HttpResponse<IResponseModelPageResponseTenant, void | IHTTPValidationError>>;
1713
2046
  /**
1714
2047
  * No description
1715
2048
  *
@@ -1720,6 +2053,53 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1720
2053
  */
1721
2054
  getTenant: (params?: RequestParams) => Promise<HttpResponse<any, void | IHTTPValidationError>>;
1722
2055
  };
2056
+ space: {
2057
+ /**
2058
+ * @description 获取知识库分页列表
2059
+ *
2060
+ * @tags space
2061
+ * @name GetSpaceList
2062
+ * @summary Get Space List
2063
+ * @request POST:/api/space/list
2064
+ */
2065
+ getSpaceList: (data: IPageParamsSpace, params?: RequestParams) => Promise<HttpResponse<IResponseModelPageResponseSpaceResponse, void | IHTTPValidationError>>;
2066
+ /**
2067
+ * @description 创建知识库
2068
+ *
2069
+ * @tags space
2070
+ * @name AddSpace
2071
+ * @summary Add Space
2072
+ * @request POST:/api/space/add
2073
+ */
2074
+ addSpace: (data: ISpaceCreate, params?: RequestParams) => Promise<HttpResponse<IResponseModelSpaceResponse, void | IHTTPValidationError>>;
2075
+ /**
2076
+ * @description 删除知识库
2077
+ *
2078
+ * @tags space
2079
+ * @name DeleteSpace
2080
+ * @summary Delete Space
2081
+ * @request DELETE:/api/space/{space_id}
2082
+ */
2083
+ deleteSpace: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<IResponseModelNoneType, void | IHTTPValidationError>>;
2084
+ /**
2085
+ * @description 修改知识库信息,注意:tenant_id 和 space_id 字段不可修改
2086
+ *
2087
+ * @tags space
2088
+ * @name UpdateSpace
2089
+ * @summary Update Space
2090
+ * @request PUT:/api/space/{space_id}
2091
+ */
2092
+ updateSpace: (spaceId: string, data: ISpaceCreate, params?: RequestParams) => Promise<HttpResponse<IResponseModelSpaceResponse, void | IHTTPValidationError>>;
2093
+ /**
2094
+ * @description 获取知识库详情
2095
+ *
2096
+ * @tags space
2097
+ * @name GetSpaceById
2098
+ * @summary Get Space By Id
2099
+ * @request GET:/api/space/{space_id}
2100
+ */
2101
+ getSpaceById: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<IResponseModelSpaceResponse, void | IHTTPValidationError>>;
2102
+ };
1723
2103
  healthChecker: {
1724
2104
  /**
1725
2105
  * No description
package/dist/api.js CHANGED
@@ -47,9 +47,14 @@ var IKnowledgeTypeEnum;
47
47
  IKnowledgeTypeEnum["Docx"] = "docx";
48
48
  IKnowledgeTypeEnum["Pdf"] = "pdf";
49
49
  IKnowledgeTypeEnum["Qa"] = "qa";
50
+ IKnowledgeTypeEnum["Yuquedoc"] = "yuquedoc";
51
+ IKnowledgeTypeEnum["OpenapiApp"] = "openapi_app";
50
52
  IKnowledgeTypeEnum["Folder"] = "folder";
51
53
  })(IKnowledgeTypeEnum || (exports.IKnowledgeTypeEnum = IKnowledgeTypeEnum = {}));
52
- /** KnowledgeSourceEnum */
54
+ /**
55
+ * KnowledgeSourceEnum
56
+ * Specifies the source of knowledge, which influences the behavior of the resource loader
57
+ */
53
58
  var IKnowledgeSourceEnum;
54
59
  (function (IKnowledgeSourceEnum) {
55
60
  IKnowledgeSourceEnum["GithubRepo"] = "github_repo";
@@ -226,7 +231,7 @@ class Api extends HttpClient {
226
231
  */
227
232
  addKnowledge: (data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/add`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
228
233
  /**
229
- * @description Only makes modifications to the enabled field.
234
+ * No description
230
235
  *
231
236
  * @tags knowledge
232
237
  * @name UpdateKnowledge
@@ -261,6 +266,15 @@ class Api extends HttpClient {
261
266
  * @request DELETE:/api/knowledge/delete
262
267
  */
263
268
  deleteKnowledge: (query, params = {}) => this.request(Object.assign({ path: `/api/knowledge/delete`, method: "DELETE", query: query, format: "json" }, params)),
269
+ /**
270
+ * No description
271
+ *
272
+ * @tags knowledge
273
+ * @name GetEmbeddingModelsList
274
+ * @summary Get Embedding Models List
275
+ * @request GET:/api/knowledge/embedding/models
276
+ */
277
+ getEmbeddingModelsList: (params = {}) => this.request(Object.assign({ path: `/api/knowledge/embedding/models`, method: "GET", format: "json" }, params)),
264
278
  };
265
279
  this.retrieval = {
266
280
  /**
@@ -339,6 +353,33 @@ class Api extends HttpClient {
339
353
  * @request POST:/api/chunk/list
340
354
  */
341
355
  getChunkList: (data, params = {}) => this.request(Object.assign({ path: `/api/chunk/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
356
+ /**
357
+ * No description
358
+ *
359
+ * @tags chunk
360
+ * @name DeleteChunkById
361
+ * @summary Delete Chunk By Id
362
+ * @request DELETE:/api/chunk/id/{id}/model_name/{model_name}
363
+ */
364
+ deleteChunkById: (id, modelName, params = {}) => this.request(Object.assign({ path: `/api/chunk/id/${id}/model_name/${modelName}`, method: "DELETE", format: "json" }, params)),
365
+ /**
366
+ * No description
367
+ *
368
+ * @tags chunk
369
+ * @name GetChunkById
370
+ * @summary Get Chunk By Id
371
+ * @request GET:/api/chunk/id/{id}/model_name/{model_name}
372
+ */
373
+ getChunkById: (id, modelName, params = {}) => this.request(Object.assign({ path: `/api/chunk/id/${id}/model_name/${modelName}`, method: "GET", format: "json" }, params)),
374
+ /**
375
+ * No description
376
+ *
377
+ * @tags chunk
378
+ * @name SaveChunk
379
+ * @summary Save Chunk
380
+ * @request POST:/api/chunk/save
381
+ */
382
+ saveChunk: (data, params = {}) => this.request(Object.assign({ path: `/api/chunk/save`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
342
383
  };
343
384
  this.tenant = {
344
385
  /**
@@ -350,6 +391,42 @@ class Api extends HttpClient {
350
391
  * @request POST:/api/tenant/create
351
392
  */
352
393
  createTenant: (data, params = {}) => this.request(Object.assign({ path: `/api/tenant/create`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
394
+ /**
395
+ * No description
396
+ *
397
+ * @tags tenant
398
+ * @name GetTenantById
399
+ * @summary Query Tenant
400
+ * @request GET:/api/tenant/id/{id}
401
+ */
402
+ getTenantById: (id, params = {}) => this.request(Object.assign({ path: `/api/tenant/id/${id}`, method: "GET", format: "json" }, params)),
403
+ /**
404
+ * No description
405
+ *
406
+ * @tags tenant
407
+ * @name DeleteTenantById
408
+ * @summary Delete Tenant
409
+ * @request DELETE:/api/tenant/{id}
410
+ */
411
+ deleteTenantById: (id, params = {}) => this.request(Object.assign({ path: `/api/tenant/${id}`, method: "DELETE", format: "json" }, params)),
412
+ /**
413
+ * No description
414
+ *
415
+ * @tags tenant
416
+ * @name UpdateTenant
417
+ * @summary Update Tenant
418
+ * @request POST:/api/tenant/update
419
+ */
420
+ updateTenant: (data, params = {}) => this.request(Object.assign({ path: `/api/tenant/update`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
421
+ /**
422
+ * No description
423
+ *
424
+ * @tags tenant
425
+ * @name GetTenantList
426
+ * @summary Get Tenant List
427
+ * @request GET:/api/tenant/list
428
+ */
429
+ getTenantList: (query, params = {}) => this.request(Object.assign({ path: `/api/tenant/list`, method: "GET", query: query, format: "json" }, params)),
353
430
  /**
354
431
  * No description
355
432
  *
@@ -360,6 +437,53 @@ class Api extends HttpClient {
360
437
  */
361
438
  getTenant: (params = {}) => this.request(Object.assign({ path: `/api/tenant/me`, method: "GET", format: "json" }, params)),
362
439
  };
440
+ this.space = {
441
+ /**
442
+ * @description 获取知识库分页列表
443
+ *
444
+ * @tags space
445
+ * @name GetSpaceList
446
+ * @summary Get Space List
447
+ * @request POST:/api/space/list
448
+ */
449
+ getSpaceList: (data, params = {}) => this.request(Object.assign({ path: `/api/space/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
450
+ /**
451
+ * @description 创建知识库
452
+ *
453
+ * @tags space
454
+ * @name AddSpace
455
+ * @summary Add Space
456
+ * @request POST:/api/space/add
457
+ */
458
+ addSpace: (data, params = {}) => this.request(Object.assign({ path: `/api/space/add`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
459
+ /**
460
+ * @description 删除知识库
461
+ *
462
+ * @tags space
463
+ * @name DeleteSpace
464
+ * @summary Delete Space
465
+ * @request DELETE:/api/space/{space_id}
466
+ */
467
+ deleteSpace: (spaceId, params = {}) => this.request(Object.assign({ path: `/api/space/${spaceId}`, method: "DELETE", format: "json" }, params)),
468
+ /**
469
+ * @description 修改知识库信息,注意:tenant_id 和 space_id 字段不可修改
470
+ *
471
+ * @tags space
472
+ * @name UpdateSpace
473
+ * @summary Update Space
474
+ * @request PUT:/api/space/{space_id}
475
+ */
476
+ updateSpace: (spaceId, data, params = {}) => this.request(Object.assign({ path: `/api/space/${spaceId}`, method: "PUT", body: data, type: ContentType.Json, format: "json" }, params)),
477
+ /**
478
+ * @description 获取知识库详情
479
+ *
480
+ * @tags space
481
+ * @name GetSpaceById
482
+ * @summary Get Space By Id
483
+ * @request GET:/api/space/{space_id}
484
+ */
485
+ getSpaceById: (spaceId, params = {}) => this.request(Object.assign({ path: `/api/space/${spaceId}`, method: "GET", format: "json" }, params)),
486
+ };
363
487
  this.healthChecker = {
364
488
  /**
365
489
  * No description
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@petercatai/whisker-client",
3
- "version": "0.1.202504211903-dev",
4
- "description": "Generated API client (dev)",
3
+ "version": "0.1.202504281028",
4
+ "description": "Generated API client (Production)",
5
5
  "main": "dist/api.js",
6
6
  "types": "dist/api.d.ts",
7
7
  "files": [
@@ -13,11 +13,11 @@
13
13
  },
14
14
  "publishConfig": {
15
15
  "access": "public",
16
- "tag": "dev"
16
+ "tag": "latest"
17
17
  },
18
18
  "devDependencies": {
19
- "@types/node": "^22.14.1",
20
- "axios": "^1.8.4",
19
+ "@types/node": "^22.15.2",
20
+ "axios": "^1.9.0",
21
21
  "typescript": "^5.8.3"
22
22
  }
23
23
  }