@petercatai/whisker-client 0.1.202505131519 → 0.1.202505141300

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 +114 -136
  2. package/dist/api.js +3 -4
  3. package/package.json +2 -2
package/dist/api.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare enum ITaskStatus {
10
10
  }
11
11
  /**
12
12
  * KnowledgeTypeEnum
13
- * mime type of the knowledge
13
+ * mime type of the knowledge. If multiple files are included and require a decomposer, please set the type to 'folder'
14
14
  */
15
15
  export declare enum IKnowledgeTypeEnum {
16
16
  Text = "text",
@@ -31,10 +31,9 @@ export declare enum IKnowledgeSourceEnum {
31
31
  GithubRepo = "github_repo",
32
32
  GithubFile = "github_file",
33
33
  UserInputText = "user_input_text",
34
- UserUploadFile = "user_upload_file",
35
- Yuque = "yuque",
36
- Youtube = "youtube",
37
- Database = "database"
34
+ CloudStorageText = "cloud_storage_text",
35
+ CloudStorageImage = "cloud_storage_image",
36
+ Yuque = "yuque"
38
37
  }
39
38
  /** EmbeddingModelEnum */
40
39
  export declare enum IEmbeddingModelEnum {
@@ -46,7 +45,7 @@ export declare enum IEmbeddingModelEnum {
46
45
  }
47
46
  /**
48
47
  * BaseCharSplitConfig
49
- * Base split configuration class
48
+ * Base char split configuration class
50
49
  */
51
50
  export interface IBaseCharSplitConfig {
52
51
  /**
@@ -297,8 +296,12 @@ export interface IImageCreate {
297
296
  * @default {}
298
297
  */
299
298
  metadata?: Record<string, any>;
300
- /** source type */
301
- source_type: IKnowledgeSourceEnum;
299
+ /**
300
+ * Source Type
301
+ * source type
302
+ * @default "cloud_storage_image"
303
+ */
304
+ source_type?: "cloud_storage_image";
302
305
  /**
303
306
  * Embedding Model Name
304
307
  * name of the embedding model. you can set any other model if target embedding service registered
@@ -320,6 +323,15 @@ export interface IImageCreate {
320
323
  * source config of the knowledge
321
324
  */
322
325
  source_config: IOpenUrlSourceConfig | IOpenIdSourceConfig | IS3SourceConfig;
326
+ split_config: IImageSplitConfig;
327
+ }
328
+ /** ImageSplitConfig */
329
+ export interface IImageSplitConfig {
330
+ /**
331
+ * Type
332
+ * @default "image"
333
+ */
334
+ type?: "image";
323
335
  }
324
336
  /** JSONCreate */
325
337
  export interface IJSONCreate {
@@ -575,87 +587,6 @@ export interface IKnowledgeOutput {
575
587
  */
576
588
  gmt_modified?: string;
577
589
  }
578
- /**
579
- * KnowledgeCreate
580
- * KnowledgeCreate model for creating knowledge resources.
581
- * Attributes:
582
- * knowledge_type (ResourceType): Type of knowledge resource.
583
- * space_id (str): Space ID, example: petercat bot ID.
584
- * knowledge_name (str): Name of the knowledge resource.
585
- * file_sha (Optional[str]): SHA of the file.
586
- * file_size (Optional[int]): Size of the file.
587
- * split_config (Optional[dict]): Configuration for splitting the knowledge.
588
- * source_data (Optional[str]): Source data of the knowledge.
589
- * auth_info (Optional[str]): Authentication information.
590
- * embedding_model_name (Optional[str]): Name of the embedding model.
591
- * metadata (Optional[dict]): Additional metadata.
592
- */
593
- export interface IKnowledgeCreate {
594
- /**
595
- * Space Id
596
- * the space of knowledge, example: petercat bot id, github repo name
597
- */
598
- space_id: string;
599
- /**
600
- * type of knowledge resource
601
- * @default "text"
602
- */
603
- knowledge_type?: IKnowledgeTypeEnum;
604
- /**
605
- * Knowledge Name
606
- * name of the knowledge resource
607
- * @maxLength 255
608
- */
609
- knowledge_name: string;
610
- /**
611
- * source type
612
- * @default "user_input_text"
613
- */
614
- source_type?: IKnowledgeSourceEnum;
615
- /**
616
- * Source Config
617
- * source config of the knowledge
618
- */
619
- source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IYuqueSourceConfig;
620
- /**
621
- * Embedding Model Name
622
- * name of the embedding model. you can set any other model if target embedding service registered
623
- * @default "openai"
624
- */
625
- embedding_model_name?: IEmbeddingModelEnum | string;
626
- /**
627
- * Split Config
628
- * configuration for splitting the knowledge
629
- */
630
- split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IGeaGraphSplitConfig;
631
- /**
632
- * File Sha
633
- * SHA of the file
634
- */
635
- file_sha?: string | null;
636
- /**
637
- * File Size
638
- * size of the file
639
- */
640
- file_size?: number | null;
641
- /**
642
- * Metadata
643
- * additional metadata, user can update it
644
- * @default {}
645
- */
646
- metadata?: Record<string, any>;
647
- /**
648
- * Parent Id
649
- * parent knowledge id
650
- */
651
- parent_id?: string | null;
652
- /**
653
- * Enabled
654
- * is knowledge enabled
655
- * @default true
656
- */
657
- enabled?: boolean;
658
- }
659
590
  /** MarkdownCreate */
660
591
  export interface IMarkdownCreate {
661
592
  /**
@@ -723,21 +654,33 @@ export interface IMarkdownSplitConfig {
723
654
  * @default 150
724
655
  */
725
656
  chunk_overlap?: number;
657
+ /**
658
+ * Type
659
+ * @default "markdown"
660
+ */
661
+ type?: "markdown";
726
662
  /**
727
663
  * Separators
728
- * separator list, if None, use default separators
664
+ * List of separators to split the text. If None, uses default separators
729
665
  */
730
- separators?: string[] | null;
666
+ separators: string[];
731
667
  /**
732
- * Split Regex
733
- * split_regex,if set, use it instead of separators
668
+ * Is Separator Regex
669
+ * If true, the separators should be in regular expression format.
734
670
  */
735
- split_regex?: string | null;
671
+ is_separator_regex: boolean;
736
672
  /**
737
- * Type
738
- * @default "markdown"
673
+ * Keep Separator
674
+ * Whether to keep the separator and where to place it in each corresponding chunk (True='start')
675
+ * @default false
739
676
  */
740
- type?: "markdown";
677
+ keep_separator?: boolean | "start" | "end" | null;
678
+ /**
679
+ * Extract Header First
680
+ * If true, will split markdown by header first
681
+ * @default false
682
+ */
683
+ extract_header_first?: boolean | null;
741
684
  }
742
685
  /** OpenIdSourceConfig */
743
686
  export interface IOpenIdSourceConfig {
@@ -825,33 +768,11 @@ export interface IPDFSplitConfig {
825
768
  * @default 150
826
769
  */
827
770
  chunk_overlap?: number;
828
- /**
829
- * Separators
830
- * separator list, if None, use default separators
831
- */
832
- separators?: string[] | null;
833
- /**
834
- * Split Regex
835
- * split_regex,if set, use it instead of separators
836
- */
837
- split_regex?: string | null;
838
771
  /**
839
772
  * Type
840
773
  * @default "pdf"
841
774
  */
842
775
  type?: "pdf";
843
- /**
844
- * Split By Page
845
- * Whether to split by pages
846
- * @default false
847
- */
848
- split_by_page?: boolean;
849
- /**
850
- * Keep Layout
851
- * Whether to preserve the original layout
852
- * @default true
853
- */
854
- keep_layout?: boolean;
855
776
  /**
856
777
  * Extract Images
857
778
  * Whether to extract images
@@ -1078,8 +999,12 @@ export interface IQACreate {
1078
999
  * @default {}
1079
1000
  */
1080
1001
  metadata?: Record<string, any>;
1081
- /** source type */
1082
- source_type: IKnowledgeSourceEnum;
1002
+ /**
1003
+ * Source Type
1004
+ * source type
1005
+ * @default "user_input_text"
1006
+ */
1007
+ source_type?: "user_input_text";
1083
1008
  /**
1084
1009
  * Embedding Model Name
1085
1010
  * name of the embedding model. you can set any other model if target embedding service registered
@@ -1880,9 +1805,8 @@ export interface ITextSplitConfig {
1880
1805
  /**
1881
1806
  * Separators
1882
1807
  * List of separators to split the text. If None, uses default separators
1883
- * @default ["\n","\n\n","\r"]
1884
1808
  */
1885
- separators?: string[];
1809
+ separators: string[];
1886
1810
  /**
1887
1811
  * Split Regex
1888
1812
  * split_regex,if set, use it instead of separators
@@ -1893,18 +1817,17 @@ export interface ITextSplitConfig {
1893
1817
  * @default "text"
1894
1818
  */
1895
1819
  type?: "text";
1820
+ /**
1821
+ * Is Separator Regex
1822
+ * If true, the separators should be in regular expression format.
1823
+ */
1824
+ is_separator_regex: boolean;
1896
1825
  /**
1897
1826
  * Keep Separator
1898
1827
  * Whether to keep the separator and where to place it in each corresponding chunk (True='start')
1899
1828
  * @default false
1900
1829
  */
1901
1830
  keep_separator?: boolean | "start" | "end" | null;
1902
- /**
1903
- * Strip Whitespace
1904
- * If `True`, strips whitespace from the start and end of every document
1905
- * @default false
1906
- */
1907
- strip_whitespace?: boolean | null;
1908
1831
  }
1909
1832
  /** ValidationError */
1910
1833
  export interface IValidationError {
@@ -1915,6 +1838,61 @@ export interface IValidationError {
1915
1838
  /** Error Type */
1916
1839
  type: string;
1917
1840
  }
1841
+ /** YuqueCreate */
1842
+ export interface IYuqueCreate {
1843
+ /**
1844
+ * Space Id
1845
+ * the space of knowledge, example: petercat bot id, github repo name
1846
+ */
1847
+ space_id: string;
1848
+ /**
1849
+ * Knowledge Type
1850
+ * type of knowledge resource
1851
+ * @default "yuquedoc"
1852
+ */
1853
+ knowledge_type?: "yuquedoc" | "folder";
1854
+ /**
1855
+ * Knowledge Name
1856
+ * name of the knowledge resource
1857
+ * @maxLength 255
1858
+ */
1859
+ knowledge_name: string;
1860
+ /**
1861
+ * Metadata
1862
+ * additional metadata, user can update it
1863
+ * @default {}
1864
+ */
1865
+ metadata?: Record<string, any>;
1866
+ /**
1867
+ * Source Type
1868
+ * source type
1869
+ * @default "yuque"
1870
+ */
1871
+ source_type?: "yuque";
1872
+ /**
1873
+ * Embedding Model Name
1874
+ * name of the embedding model. you can set any other model if target embedding service registered
1875
+ * @default "openai"
1876
+ */
1877
+ embedding_model_name?: IEmbeddingModelEnum | string;
1878
+ /**
1879
+ * File Sha
1880
+ * SHA of the file
1881
+ */
1882
+ file_sha?: string | null;
1883
+ /**
1884
+ * File Size
1885
+ * size of the file
1886
+ */
1887
+ file_size?: number | null;
1888
+ /** source config of the knowledge */
1889
+ source_config: IYuqueSourceConfig;
1890
+ /**
1891
+ * Split Config
1892
+ * split config of the knowledge
1893
+ */
1894
+ split_config: IGeaGraphSplitConfig | IBaseCharSplitConfig;
1895
+ }
1918
1896
  /** YuqueSourceConfig */
1919
1897
  export interface IYuqueSourceConfig {
1920
1898
  /**
@@ -1924,20 +1902,20 @@ export interface IYuqueSourceConfig {
1924
1902
  */
1925
1903
  api_url?: string;
1926
1904
  /**
1927
- * Group Id
1905
+ * Group Login
1928
1906
  * the yuque group id
1929
1907
  */
1930
- group_id: number;
1908
+ group_login: string;
1931
1909
  /**
1932
- * Book Id
1910
+ * Book Slug
1933
1911
  * the yuque book id, if not set, will use the group all book
1934
1912
  */
1935
- book_id?: number | null;
1913
+ book_slug?: string | null;
1936
1914
  /**
1937
1915
  * Document Id
1938
- * the yuque document id in book, if not set, will use the book id as document id
1916
+ * the yuque document id in book, if not set, will use the book all doc
1939
1917
  */
1940
- document_id?: number | null;
1918
+ document_id?: string | number | null;
1941
1919
  /**
1942
1920
  * Auth Info
1943
1921
  * authentication information
@@ -2024,7 +2002,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
2024
2002
  * @summary Add Knowledge
2025
2003
  * @request POST:/api/knowledge/add
2026
2004
  */
2027
- addKnowledge: (data: (IKnowledgeCreate | ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IGithubRepoCreate | IQACreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
2005
+ addKnowledge: (data: (ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IGithubRepoCreate | IQACreate | IYuqueCreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
2028
2006
  /**
2029
2007
  * No description
2030
2008
  *
package/dist/api.js CHANGED
@@ -36,7 +36,7 @@ var ITaskStatus;
36
36
  })(ITaskStatus || (exports.ITaskStatus = ITaskStatus = {}));
37
37
  /**
38
38
  * KnowledgeTypeEnum
39
- * mime type of the knowledge
39
+ * mime type of the knowledge. If multiple files are included and require a decomposer, please set the type to 'folder'
40
40
  */
41
41
  var IKnowledgeTypeEnum;
42
42
  (function (IKnowledgeTypeEnum) {
@@ -59,10 +59,9 @@ var IKnowledgeSourceEnum;
59
59
  IKnowledgeSourceEnum["GithubRepo"] = "github_repo";
60
60
  IKnowledgeSourceEnum["GithubFile"] = "github_file";
61
61
  IKnowledgeSourceEnum["UserInputText"] = "user_input_text";
62
- IKnowledgeSourceEnum["UserUploadFile"] = "user_upload_file";
62
+ IKnowledgeSourceEnum["CloudStorageText"] = "cloud_storage_text";
63
+ IKnowledgeSourceEnum["CloudStorageImage"] = "cloud_storage_image";
63
64
  IKnowledgeSourceEnum["Yuque"] = "yuque";
64
- IKnowledgeSourceEnum["Youtube"] = "youtube";
65
- IKnowledgeSourceEnum["Database"] = "database";
66
65
  })(IKnowledgeSourceEnum || (exports.IKnowledgeSourceEnum = IKnowledgeSourceEnum = {}));
67
66
  /** EmbeddingModelEnum */
68
67
  var IEmbeddingModelEnum;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@petercatai/whisker-client",
3
- "version": "0.1.202505131519",
3
+ "version": "0.1.202505141300",
4
4
  "description": "Generated API client (Production)",
5
5
  "main": "dist/api.js",
6
6
  "types": "dist/api.d.ts",
@@ -16,7 +16,7 @@
16
16
  "tag": "latest"
17
17
  },
18
18
  "devDependencies": {
19
- "@types/node": "^22.15.17",
19
+ "@types/node": "^22.15.18",
20
20
  "axios": "^1.9.0",
21
21
  "typescript": "^5.8.3"
22
22
  }