@petercatai/whisker-client 0.1.202505131519 → 0.1.202505141055
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/api.d.ts +97 -131
- package/dist/api.js +2 -3
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
/**
|
|
@@ -320,6 +319,15 @@ export interface IImageCreate {
|
|
|
320
319
|
* source config of the knowledge
|
|
321
320
|
*/
|
|
322
321
|
source_config: IOpenUrlSourceConfig | IOpenIdSourceConfig | IS3SourceConfig;
|
|
322
|
+
split_config: IImageSplitConfig;
|
|
323
|
+
}
|
|
324
|
+
/** ImageSplitConfig */
|
|
325
|
+
export interface IImageSplitConfig {
|
|
326
|
+
/**
|
|
327
|
+
* Type
|
|
328
|
+
* @default "image"
|
|
329
|
+
*/
|
|
330
|
+
type?: "image";
|
|
323
331
|
}
|
|
324
332
|
/** JSONCreate */
|
|
325
333
|
export interface IJSONCreate {
|
|
@@ -575,87 +583,6 @@ export interface IKnowledgeOutput {
|
|
|
575
583
|
*/
|
|
576
584
|
gmt_modified?: string;
|
|
577
585
|
}
|
|
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
586
|
/** MarkdownCreate */
|
|
660
587
|
export interface IMarkdownCreate {
|
|
661
588
|
/**
|
|
@@ -723,21 +650,33 @@ export interface IMarkdownSplitConfig {
|
|
|
723
650
|
* @default 150
|
|
724
651
|
*/
|
|
725
652
|
chunk_overlap?: number;
|
|
653
|
+
/**
|
|
654
|
+
* Type
|
|
655
|
+
* @default "markdown"
|
|
656
|
+
*/
|
|
657
|
+
type?: "markdown";
|
|
726
658
|
/**
|
|
727
659
|
* Separators
|
|
728
|
-
*
|
|
660
|
+
* List of separators to split the text. If None, uses default separators
|
|
729
661
|
*/
|
|
730
|
-
separators
|
|
662
|
+
separators: string[];
|
|
731
663
|
/**
|
|
732
|
-
*
|
|
733
|
-
*
|
|
664
|
+
* Is Separator Regex
|
|
665
|
+
* If true, the separators should be in regular expression format.
|
|
734
666
|
*/
|
|
735
|
-
|
|
667
|
+
is_separator_regex: boolean;
|
|
736
668
|
/**
|
|
737
|
-
*
|
|
738
|
-
*
|
|
669
|
+
* Keep Separator
|
|
670
|
+
* Whether to keep the separator and where to place it in each corresponding chunk (True='start')
|
|
671
|
+
* @default false
|
|
739
672
|
*/
|
|
740
|
-
|
|
673
|
+
keep_separator?: boolean | "start" | "end" | null;
|
|
674
|
+
/**
|
|
675
|
+
* Extract Header First
|
|
676
|
+
* If true, will split markdown by header first
|
|
677
|
+
* @default false
|
|
678
|
+
*/
|
|
679
|
+
extract_header_first?: boolean | null;
|
|
741
680
|
}
|
|
742
681
|
/** OpenIdSourceConfig */
|
|
743
682
|
export interface IOpenIdSourceConfig {
|
|
@@ -825,33 +764,11 @@ export interface IPDFSplitConfig {
|
|
|
825
764
|
* @default 150
|
|
826
765
|
*/
|
|
827
766
|
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
767
|
/**
|
|
839
768
|
* Type
|
|
840
769
|
* @default "pdf"
|
|
841
770
|
*/
|
|
842
771
|
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
772
|
/**
|
|
856
773
|
* Extract Images
|
|
857
774
|
* Whether to extract images
|
|
@@ -1880,9 +1797,8 @@ export interface ITextSplitConfig {
|
|
|
1880
1797
|
/**
|
|
1881
1798
|
* Separators
|
|
1882
1799
|
* List of separators to split the text. If None, uses default separators
|
|
1883
|
-
* @default ["\n","\n\n","\r"]
|
|
1884
1800
|
*/
|
|
1885
|
-
separators
|
|
1801
|
+
separators: string[];
|
|
1886
1802
|
/**
|
|
1887
1803
|
* Split Regex
|
|
1888
1804
|
* split_regex,if set, use it instead of separators
|
|
@@ -1893,18 +1809,17 @@ export interface ITextSplitConfig {
|
|
|
1893
1809
|
* @default "text"
|
|
1894
1810
|
*/
|
|
1895
1811
|
type?: "text";
|
|
1812
|
+
/**
|
|
1813
|
+
* Is Separator Regex
|
|
1814
|
+
* If true, the separators should be in regular expression format.
|
|
1815
|
+
*/
|
|
1816
|
+
is_separator_regex: boolean;
|
|
1896
1817
|
/**
|
|
1897
1818
|
* Keep Separator
|
|
1898
1819
|
* Whether to keep the separator and where to place it in each corresponding chunk (True='start')
|
|
1899
1820
|
* @default false
|
|
1900
1821
|
*/
|
|
1901
1822
|
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
1823
|
}
|
|
1909
1824
|
/** ValidationError */
|
|
1910
1825
|
export interface IValidationError {
|
|
@@ -1915,6 +1830,57 @@ export interface IValidationError {
|
|
|
1915
1830
|
/** Error Type */
|
|
1916
1831
|
type: string;
|
|
1917
1832
|
}
|
|
1833
|
+
/** YuqueCreate */
|
|
1834
|
+
export interface IYuqueCreate {
|
|
1835
|
+
/**
|
|
1836
|
+
* Space Id
|
|
1837
|
+
* the space of knowledge, example: petercat bot id, github repo name
|
|
1838
|
+
*/
|
|
1839
|
+
space_id: string;
|
|
1840
|
+
/**
|
|
1841
|
+
* Knowledge Type
|
|
1842
|
+
* type of knowledge resource
|
|
1843
|
+
* @default "image"
|
|
1844
|
+
*/
|
|
1845
|
+
knowledge_type?: "image";
|
|
1846
|
+
/**
|
|
1847
|
+
* Knowledge Name
|
|
1848
|
+
* name of the knowledge resource
|
|
1849
|
+
* @maxLength 255
|
|
1850
|
+
*/
|
|
1851
|
+
knowledge_name: string;
|
|
1852
|
+
/**
|
|
1853
|
+
* Metadata
|
|
1854
|
+
* additional metadata, user can update it
|
|
1855
|
+
* @default {}
|
|
1856
|
+
*/
|
|
1857
|
+
metadata?: Record<string, any>;
|
|
1858
|
+
/** source type */
|
|
1859
|
+
source_type: IKnowledgeSourceEnum;
|
|
1860
|
+
/**
|
|
1861
|
+
* Embedding Model Name
|
|
1862
|
+
* name of the embedding model. you can set any other model if target embedding service registered
|
|
1863
|
+
* @default "openai"
|
|
1864
|
+
*/
|
|
1865
|
+
embedding_model_name?: IEmbeddingModelEnum | string;
|
|
1866
|
+
/**
|
|
1867
|
+
* File Sha
|
|
1868
|
+
* SHA of the file
|
|
1869
|
+
*/
|
|
1870
|
+
file_sha?: string | null;
|
|
1871
|
+
/**
|
|
1872
|
+
* File Size
|
|
1873
|
+
* size of the file
|
|
1874
|
+
*/
|
|
1875
|
+
file_size?: number | null;
|
|
1876
|
+
/** source config of the knowledge */
|
|
1877
|
+
source_config: IYuqueSourceConfig;
|
|
1878
|
+
/**
|
|
1879
|
+
* Split Config
|
|
1880
|
+
* split config of the knowledge
|
|
1881
|
+
*/
|
|
1882
|
+
split_config: IGeaGraphSplitConfig | IBaseCharSplitConfig;
|
|
1883
|
+
}
|
|
1918
1884
|
/** YuqueSourceConfig */
|
|
1919
1885
|
export interface IYuqueSourceConfig {
|
|
1920
1886
|
/**
|
|
@@ -1924,20 +1890,20 @@ export interface IYuqueSourceConfig {
|
|
|
1924
1890
|
*/
|
|
1925
1891
|
api_url?: string;
|
|
1926
1892
|
/**
|
|
1927
|
-
* Group
|
|
1893
|
+
* Group Login
|
|
1928
1894
|
* the yuque group id
|
|
1929
1895
|
*/
|
|
1930
|
-
|
|
1896
|
+
group_login: string;
|
|
1931
1897
|
/**
|
|
1932
|
-
* Book
|
|
1898
|
+
* Book Slug
|
|
1933
1899
|
* the yuque book id, if not set, will use the group all book
|
|
1934
1900
|
*/
|
|
1935
|
-
|
|
1901
|
+
book_slug?: string | null;
|
|
1936
1902
|
/**
|
|
1937
1903
|
* Document Id
|
|
1938
|
-
* the yuque document id in book, if not set, will use the book
|
|
1904
|
+
* the yuque document id in book, if not set, will use the book all doc
|
|
1939
1905
|
*/
|
|
1940
|
-
document_id?: number | null;
|
|
1906
|
+
document_id?: string | number | null;
|
|
1941
1907
|
/**
|
|
1942
1908
|
* Auth Info
|
|
1943
1909
|
* authentication information
|
|
@@ -2024,7 +1990,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2024
1990
|
* @summary Add Knowledge
|
|
2025
1991
|
* @request POST:/api/knowledge/add
|
|
2026
1992
|
*/
|
|
2027
|
-
addKnowledge: (data: (
|
|
1993
|
+
addKnowledge: (data: (ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IGithubRepoCreate | IQACreate | IYuqueCreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
|
|
2028
1994
|
/**
|
|
2029
1995
|
* No description
|
|
2030
1996
|
*
|
package/dist/api.js
CHANGED
|
@@ -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["
|
|
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;
|