@mxmweb/aichat 1.0.0 → 1.1.7
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/HeadlessChat.d.ts +1 -0
- package/LoginPage/components/Login/LoginBox/index.d.ts +18 -0
- package/LoginPage/components/Login/RegisterBox/index.d.ts +15 -0
- package/LoginPage/components/Login/index.d.ts +17 -0
- package/LoginPage/index.d.ts +4 -0
- package/LoginPage/useServices.d.ts +9 -0
- package/LoginPage/utils.d.ts +2 -0
- package/Preview.d.ts +1 -0
- package/README.md +7 -5
- package/UseLogingHeadless.d.ts +1 -0
- package/adopters/GientechChat/Conversations/Item.d.ts +11 -0
- package/adopters/GientechChat/Conversations/List.d.ts +18 -0
- package/adopters/GientechChat/Conversations/groupByTime.d.ts +17 -0
- package/adopters/GientechChat/Conversations/index.d.ts +18 -0
- package/adopters/GientechChat/constants.d.ts +17 -0
- package/adopters/GientechChat/index.d.ts +10 -0
- package/adopters/GientechChat/types.d.ts +14 -0
- package/adopters/HeadLessChat/constants.d.ts +16 -0
- package/adopters/HeadLessChat/index.d.ts +14 -0
- package/adopters/HeadLessChat/types.d.ts +21 -0
- package/adopters/gientechCommon/components/AppError.d.ts +4 -0
- package/adopters/gientechCommon/components/AppLoading.d.ts +1 -0
- package/adopters/gientechCommon/components/DisplayError.d.ts +1 -0
- package/adopters/gientechCommon/components/DisplayLoading.d.ts +1 -0
- package/adopters/gientechCommon/components/FeedBackModal.d.ts +2 -0
- package/adopters/gientechCommon/components/FileManager/index.d.ts +21 -0
- package/adopters/gientechCommon/components/Messages/AiChatBox.d.ts +37 -0
- package/adopters/gientechCommon/components/Messages/GientechNewChatWelcome.d.ts +7 -0
- package/adopters/gientechCommon/components/Messages/ReferenceCard.d.ts +13 -0
- package/adopters/gientechCommon/components/Messages/UserChatBox.d.ts +13 -0
- package/adopters/gientechCommon/components/RenameModal.d.ts +1 -0
- package/adopters/gientechCommon/configs/commonConfig.d.ts +2 -0
- package/adopters/gientechCommon/configs/senderConfig.d.ts +1 -0
- package/adopters/gientechCommon/configs/stylesConfig.d.ts +88 -0
- package/adopters/gientechCommon/hooks/AichatUseController.d.ts +44 -0
- package/adopters/gientechCommon/slate/converters/deserializers.d.ts +5 -0
- package/adopters/gientechCommon/slate/converters/mockData.d.ts +72 -0
- package/adopters/gientechCommon/slate/converters/slateConverters.d.ts +66 -0
- package/adopters/gientechCommon/slate/richElements/index.d.ts +4 -0
- package/adopters/gientechCommon/utils/request.d.ts +2 -0
- package/adopters/gientechCommon/utils/serverFn.d.ts +37 -0
- package/assets/aichat.css +1 -1
- package/components/AiChat.d.ts +79 -0
- package/components/AiChat.types.d.ts +111 -0
- package/components/DefaultAppError.d.ts +1 -0
- package/components/DefaultAppLoading.d.ts +1 -0
- package/components/DefaultDisplayError.d.ts +1 -0
- package/components/DefaultDisplayLoading.d.ts +1 -0
- package/components/DefaultNewChatWelcome.d.ts +1 -0
- package/components/Displayer/DefaultAiChatBox.d.ts +1 -0
- package/components/Displayer/DefaultUserChatBox.d.ts +1 -0
- package/components/Displayer/index.d.ts +14 -0
- package/components/Displayer/slate/converters/deserializers.d.ts +5 -0
- package/components/Displayer/slate/converters/mockData.d.ts +71 -0
- package/components/Displayer/slate/converters/slateConverters.d.ts +64 -0
- package/components/Displayer/slate/richElements/index.d.ts +2 -0
- package/components/DrawerContent.d.ts +11 -0
- package/components/DrawerPreview.d.ts +5 -0
- package/components/DynamicForm.d.ts +8 -0
- package/components/Loading.d.ts +1 -0
- package/components/RetrieveTest/components/ChatInput.d.ts +17 -0
- package/components/RetrieveTest/components/ChatMessage.d.ts +34 -0
- package/components/RetrieveTest/components/ConfigPanel.d.ts +28 -0
- package/components/RetrieveTest/components/RichTextEditor.d.ts +62 -0
- package/components/RetrieveTest/components/VoiceInput.d.ts +40 -0
- package/components/RetrieveTest/components/config/index.d.ts +1 -0
- package/components/RetrieveTest/components/converters/deserializers.d.ts +5 -0
- package/components/RetrieveTest/components/converters/mockData.d.ts +71 -0
- package/components/RetrieveTest/components/converters/slateConverters.d.ts +3 -0
- package/components/RetrieveTest/components/richElements/index.d.ts +2 -0
- package/components/RetrieveTest/index.d.ts +26 -0
- package/components/Sender/FileUpload.d.ts +12 -0
- package/components/Sender/FilesDisplay.d.ts +16 -0
- package/components/Sender/VoiceInput.d.ts +6 -0
- package/components/Sender/contexts/BadgeContext.d.ts +10 -0
- package/components/Sender/index.d.ts +33 -0
- package/components/Sidebar/Loading.d.ts +1 -0
- package/components/Sidebar/RetriveConfigPanel.d.ts +10 -0
- package/components/Sidebar/useDynamicFormItems.d.ts +2 -0
- package/components/SidebarProp.d.ts +16 -0
- package/components/common/FileCardCommon.d.ts +19 -0
- package/components/defaultStyleSet.d.ts +88 -0
- package/components/styles.config.d.ts +4 -0
- package/icons/answerAwartar.png +0 -0
- package/icons/docx-file.png +0 -0
- package/icons/folder.png +0 -0
- package/icons/html.png +0 -0
- package/icons/image.png +0 -0
- package/icons/jpg-file.png +0 -0
- package/icons/json.png +0 -0
- package/icons/md.png +0 -0
- package/icons/pdf.png +0 -0
- package/icons/pptx.png +0 -0
- package/icons/questionAwartar.png +0 -0
- package/icons/sheets.png +0 -0
- package/icons/txt.png +0 -0
- package/icons/xlsx.png +0 -0
- package/index.d.ts +1 -0
- package/index.js +19726 -17820
- package/lib_enter.d.ts +3 -0
- package/libs/luckysheet/fontAwesome.otf +0 -0
- package/libs/luckysheet/fontawesome-webfont.eot +0 -0
- package/libs/luckysheet/fontawesome-webfont.svg +2671 -0
- package/libs/luckysheet/fontawesome-webfont.ttf +0 -0
- package/libs/luckysheet/fontawesome-webfont.woff +0 -0
- package/libs/luckysheet/fontawesome-webfont.woff2 +0 -0
- package/libs/luckysheet/fonts/fontawesome-webfont.ttf +0 -0
- package/libs/luckysheet/fonts/fontawesome-webfont.woff +0 -0
- package/libs/luckysheet/fonts/fontawesome-webfont.woff2 +0 -0
- package/libs/luckysheet/iconfont.css +461 -0
- package/libs/luckysheet/jquery.min.js +2 -0
- package/libs/luckysheet/luckysheet.css +1 -0
- package/libs/luckysheet/luckysheet.umd.js +27 -0
- package/libs/luckysheet/plugin.js +1 -0
- package/libs/luckysheet/plugins.css +10 -0
- package/libs/luckysheet/pluginsCss.css +1 -0
- package/main.d.ts +0 -0
- package/mockForm.d.ts +116 -0
- package/package.json +1 -1
- package/servers/chatApi.d.ts +7 -0
- package/servers/fileApi.d.ts +5 -0
- package/servers/modelApi.d.ts +8 -0
- package/utils/commonFn.d.ts +3 -0
- package/utils/index.d.ts +19 -0
- package/worker/pdf.worker.min.js +32 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export declare const markdownExample = "# \u4EA7\u54C1\u529F\u80FD\u6982\u8FF0\n\n\u8FD9\u662F\u4E00\u4E2A**\u91CD\u8981**\u7684\u4EA7\u54C1\u8BF4\u660E\u6587\u6863\uFF0C\u5305\u542B\u4E86_\u4E3B\u8981\u529F\u80FD_\u548C<u>\u4F7F\u7528\u8BF4\u660E</u>\u3002\n\n## \u6838\u5FC3\u529F\u80FD\n\n* **\u5B9E\u65F6\u540C\u6B65\uFF1A** \u6570\u636E\u5B9E\u65F6\u66F4\u65B0\n* **\u591A\u7AEF\u652F\u6301\uFF1A** \u652F\u6301\u5404\u79CD\u8BBE\u5907\u8BBF\u95EE\n* **\u5B89\u5168\u53EF\u9760\uFF1A** \u6570\u636E\u52A0\u5BC6\u5B58\u50A8\n\n1. \u7B2C\u4E00\u6B65\uFF1A\u5B89\u88C5\u5E94\u7528\n2. \u7B2C\u4E8C\u6B65\uFF1A\u6CE8\u518C\u8D26\u53F7\n3. \u7B2C\u4E09\u6B65\uFF1A\u5F00\u59CB\u4F7F\u7528\n\n| \u529F\u80FD | \u57FA\u7840\u7248 | \u4E13\u4E1A\u7248 |\n|------|--------|--------|\n| \u5B9E\u65F6\u540C\u6B65 | \u2713 | \u2713 |\n| \u591A\u4EBA\u534F\u4F5C | \u00D7 | \u2713 |\n| \u5386\u53F2\u8BB0\u5F55 | \u00D7 | \u2713 |\n\n\n\n\u66F4\u591A\u8BE6\u7EC6\u4FE1\u606F\u8BF7\u8BBF\u95EE\u6211\u4EEC\u7684\u5B98\u7F51\u3002";
|
|
2
|
+
export declare const htmlExample = "<h1>\u4EA7\u54C1\u529F\u80FD\u6982\u8FF0</h1>\n\n<p>\u8FD9\u662F\u4E00\u4E2A<strong>\u91CD\u8981</strong>\u7684\u4EA7\u54C1\u8BF4\u660E\u6587\u6863\uFF0C\u5305\u542B\u4E86<em>\u4E3B\u8981\u529F\u80FD</em>\u548C<u>\u4F7F\u7528\u8BF4\u660E</u>\u3002</p>\n\n<h2>\u6838\u5FC3\u529F\u80FD</h2>\n\n<ul>\n <li><strong>\u5B9E\u65F6\u540C\u6B65\uFF1A</strong> \u6570\u636E\u5B9E\u65F6\u66F4\u65B0</li>\n <li><strong>\u591A\u7AEF\u652F\u6301\uFF1A</strong> \u652F\u6301\u5404\u79CD\u8BBE\u5907\u8BBF\u95EE</li>\n <li><strong>\u5B89\u5168\u53EF\u9760\uFF1A</strong> \u6570\u636E\u52A0\u5BC6\u5B58\u50A8</li>\n</ul>\n\n<ol>\n <li>\u7B2C\u4E00\u6B65\uFF1A\u5B89\u88C5\u5E94\u7528</li>\n <li>\u7B2C\u4E8C\u6B65\uFF1A\u6CE8\u518C\u8D26\u53F7</li>\n <li>\u7B2C\u4E09\u6B65\uFF1A\u5F00\u59CB\u4F7F\u7528</li>\n</ol>\n\n<table>\n <thead>\n <tr>\n <th>\u529F\u80FD</th>\n <th>\u57FA\u7840\u7248</th>\n <th>\u4E13\u4E1A\u7248</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\u5B9E\u65F6\u540C\u6B65</td>\n <td>\u2713</td>\n <td>\u2713</td>\n </tr>\n <tr>\n <td>\u591A\u4EBA\u534F\u4F5C</td>\n <td>\u00D7</td>\n <td>\u2713</td>\n </tr>\n <tr>\n <td>\u5386\u53F2\u8BB0\u5F55</td>\n <td>\u00D7</td>\n <td>\u2713</td>\n </tr>\n </tbody>\n</table>\n\n<p style=\"text-align: center\">\n <img src=\"https://example.com/preview.jpg\" alt=\"\" style=\"display: block; margin: 0 auto;\">\n</p>\n\n<p>\u66F4\u591A\u8BE6\u7EC6\u4FE1\u606F\u8BF7\u8BBF\u95EE\u6211\u4EEC\u7684\u5B98\u7F51\u3002</p>";
|
|
3
|
+
export declare const slateExample: ({
|
|
4
|
+
type: string;
|
|
5
|
+
children: ({
|
|
6
|
+
text: string;
|
|
7
|
+
bold?: undefined;
|
|
8
|
+
italic?: undefined;
|
|
9
|
+
underline?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
text: string;
|
|
12
|
+
bold: boolean;
|
|
13
|
+
italic?: undefined;
|
|
14
|
+
underline?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
text: string;
|
|
17
|
+
italic: boolean;
|
|
18
|
+
bold?: undefined;
|
|
19
|
+
underline?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
text: string;
|
|
22
|
+
underline: boolean;
|
|
23
|
+
bold?: undefined;
|
|
24
|
+
italic?: undefined;
|
|
25
|
+
})[];
|
|
26
|
+
url?: undefined;
|
|
27
|
+
align?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
type: string;
|
|
30
|
+
children: {
|
|
31
|
+
type: string;
|
|
32
|
+
children: ({
|
|
33
|
+
text: string;
|
|
34
|
+
bold: boolean;
|
|
35
|
+
} | {
|
|
36
|
+
text: string;
|
|
37
|
+
bold?: undefined;
|
|
38
|
+
})[];
|
|
39
|
+
}[];
|
|
40
|
+
url?: undefined;
|
|
41
|
+
align?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
type: string;
|
|
44
|
+
children: ({
|
|
45
|
+
type: string;
|
|
46
|
+
children: {
|
|
47
|
+
type: string;
|
|
48
|
+
children: {
|
|
49
|
+
text: string;
|
|
50
|
+
bold: boolean;
|
|
51
|
+
}[];
|
|
52
|
+
}[];
|
|
53
|
+
} | {
|
|
54
|
+
type: string;
|
|
55
|
+
children: {
|
|
56
|
+
type: string;
|
|
57
|
+
children: {
|
|
58
|
+
text: string;
|
|
59
|
+
}[];
|
|
60
|
+
}[];
|
|
61
|
+
})[];
|
|
62
|
+
url?: undefined;
|
|
63
|
+
align?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
type: string;
|
|
66
|
+
url: string;
|
|
67
|
+
children: {
|
|
68
|
+
text: string;
|
|
69
|
+
}[];
|
|
70
|
+
align: string;
|
|
71
|
+
})[];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BaseEditor } from 'slate';
|
|
2
|
+
import { ReactEditor } from 'slate-react';
|
|
3
|
+
export type CustomText = {
|
|
4
|
+
text: string;
|
|
5
|
+
bold?: boolean;
|
|
6
|
+
italic?: boolean;
|
|
7
|
+
underline?: boolean;
|
|
8
|
+
code?: boolean;
|
|
9
|
+
retrive?: boolean;
|
|
10
|
+
strikethrough?: boolean;
|
|
11
|
+
link?: string;
|
|
12
|
+
};
|
|
13
|
+
export interface BaseElement {
|
|
14
|
+
type: string;
|
|
15
|
+
children: (CustomElement | CustomText)[];
|
|
16
|
+
align?: 'left' | 'center' | 'right';
|
|
17
|
+
}
|
|
18
|
+
export interface ParagraphElement extends BaseElement {
|
|
19
|
+
type: 'paragraph';
|
|
20
|
+
}
|
|
21
|
+
export interface HeadingOneElement extends BaseElement {
|
|
22
|
+
type: 'heading-one';
|
|
23
|
+
}
|
|
24
|
+
export interface HeadingTwoElement extends BaseElement {
|
|
25
|
+
type: 'heading-two';
|
|
26
|
+
}
|
|
27
|
+
export interface HeadingThreeElement extends BaseElement {
|
|
28
|
+
type: 'heading-three';
|
|
29
|
+
}
|
|
30
|
+
export interface ListElement extends BaseElement {
|
|
31
|
+
type: 'bulleted-list' | 'numbered-list';
|
|
32
|
+
}
|
|
33
|
+
export interface ListItemElement extends BaseElement {
|
|
34
|
+
type: 'list-item';
|
|
35
|
+
}
|
|
36
|
+
export interface TableElement extends BaseElement {
|
|
37
|
+
type: 'table';
|
|
38
|
+
}
|
|
39
|
+
export interface TableRowElement extends BaseElement {
|
|
40
|
+
type: 'table-row';
|
|
41
|
+
}
|
|
42
|
+
export interface TableCellElement extends BaseElement {
|
|
43
|
+
type: 'table-cell';
|
|
44
|
+
}
|
|
45
|
+
export interface ImageElement extends BaseElement {
|
|
46
|
+
type: 'image';
|
|
47
|
+
url: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CodeBlockElement extends BaseElement {
|
|
50
|
+
type: 'code-block';
|
|
51
|
+
}
|
|
52
|
+
export interface BlockQuoteElement extends BaseElement {
|
|
53
|
+
type: 'block-quote';
|
|
54
|
+
}
|
|
55
|
+
export type CustomElement = ParagraphElement | HeadingOneElement | HeadingTwoElement | HeadingThreeElement | ListElement | ListItemElement | TableElement | TableRowElement | TableCellElement | ImageElement | CodeBlockElement | BlockQuoteElement;
|
|
56
|
+
declare module 'slate' {
|
|
57
|
+
interface CustomTypes {
|
|
58
|
+
Editor: BaseEditor & ReactEditor;
|
|
59
|
+
Element: CustomElement;
|
|
60
|
+
Text: CustomText;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export declare const serializeToMarkdown: (nodes: CustomElement[]) => string;
|
|
64
|
+
export declare const serializeToHtml: (nodes: CustomElement[]) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DrawerContent: ({ content, onClose, }: {
|
|
2
|
+
content: {
|
|
3
|
+
file_source: string;
|
|
4
|
+
contents: any[];
|
|
5
|
+
curMark: string;
|
|
6
|
+
file_type: string;
|
|
7
|
+
title: string;
|
|
8
|
+
metadata: any;
|
|
9
|
+
} | null;
|
|
10
|
+
onClose: any;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface DynamicFormProps {
|
|
2
|
+
config?: any[];
|
|
3
|
+
initialValues?: Record<string, any>;
|
|
4
|
+
onChange?: (values: any) => void;
|
|
5
|
+
styles?: any;
|
|
6
|
+
}
|
|
7
|
+
export default function DynamicForm({ config, initialValues, onChange, styles }: DynamicFormProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface FilePreview {
|
|
2
|
+
file: File;
|
|
3
|
+
preview?: string;
|
|
4
|
+
type: 'image' | 'document';
|
|
5
|
+
}
|
|
6
|
+
interface ChatInputProps {
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
onSend: () => void;
|
|
10
|
+
onUpload: (files: FileList) => void;
|
|
11
|
+
onVoice: () => void;
|
|
12
|
+
onClear: () => void;
|
|
13
|
+
uploadedFiles: FilePreview[];
|
|
14
|
+
onRemoveFile: (index: number) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function ChatInput({ value, onChange, onSend, onUpload, onVoice, onClear, uploadedFiles, onRemoveFile }: ChatInputProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface ChatMessageProps {
|
|
2
|
+
type: 'user' | 'ai';
|
|
3
|
+
time: string;
|
|
4
|
+
content: any;
|
|
5
|
+
hasLLMConfig?: boolean;
|
|
6
|
+
retrievedChunks?: Array<{
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
prompt?: string;
|
|
10
|
+
configInfo?: {
|
|
11
|
+
textChunks: number;
|
|
12
|
+
topP: number;
|
|
13
|
+
topN: number;
|
|
14
|
+
denseWeight: number;
|
|
15
|
+
enableKG: boolean;
|
|
16
|
+
enableRerank: boolean;
|
|
17
|
+
model: string;
|
|
18
|
+
temperature?: number;
|
|
19
|
+
diversity?: number;
|
|
20
|
+
maxTokens?: number;
|
|
21
|
+
recallModel: string;
|
|
22
|
+
llmModel: string;
|
|
23
|
+
respTime?: number;
|
|
24
|
+
tokens?: number;
|
|
25
|
+
search_type?: string | string[];
|
|
26
|
+
search_policy?: string;
|
|
27
|
+
};
|
|
28
|
+
streaming?: boolean;
|
|
29
|
+
isLatest?: boolean;
|
|
30
|
+
finished?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function ChatMessage({ type, time, content, hasLLMConfig, retrievedChunks, prompt, configInfo, }: ChatMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare const Welcome: () => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FormInstance } from 'antd';
|
|
2
|
+
interface ConfigPanelProps {
|
|
3
|
+
form: FormInstance;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
enableLLM: boolean;
|
|
6
|
+
sliderValues: {
|
|
7
|
+
textChunks: number;
|
|
8
|
+
topP: number;
|
|
9
|
+
topN: number;
|
|
10
|
+
denseWeight: number;
|
|
11
|
+
temperature: number;
|
|
12
|
+
diversity: number;
|
|
13
|
+
maxTokens: number;
|
|
14
|
+
};
|
|
15
|
+
onSliderChange: (field: keyof ConfigPanelProps['sliderValues'], value: number) => void;
|
|
16
|
+
onEnableLLMChange: (enabled: boolean) => void;
|
|
17
|
+
onVisibleChange: (visible: boolean) => void;
|
|
18
|
+
modelOptions?: {
|
|
19
|
+
label: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
recallModelOptions?: {
|
|
23
|
+
label: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
27
|
+
export declare function ConfigPanel({ form, visible, enableLLM, sliderValues, onSliderChange, onEnableLLMChange, onVisibleChange, modelOptions, recallModelOptions }: ConfigPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BaseEditor } from 'slate';
|
|
2
|
+
import { ReactEditor } from 'slate-react';
|
|
3
|
+
export type CustomText = {
|
|
4
|
+
text: string;
|
|
5
|
+
bold?: boolean;
|
|
6
|
+
italic?: boolean;
|
|
7
|
+
underline?: boolean;
|
|
8
|
+
code?: boolean;
|
|
9
|
+
retrive?: boolean;
|
|
10
|
+
strikethrough?: boolean;
|
|
11
|
+
link?: string;
|
|
12
|
+
};
|
|
13
|
+
export interface BaseElement {
|
|
14
|
+
type: string;
|
|
15
|
+
children: (CustomElement | CustomText)[];
|
|
16
|
+
align?: 'left' | 'center' | 'right';
|
|
17
|
+
}
|
|
18
|
+
export interface ParagraphElement extends BaseElement {
|
|
19
|
+
type: 'paragraph';
|
|
20
|
+
}
|
|
21
|
+
export interface HeadingOneElement extends BaseElement {
|
|
22
|
+
type: 'heading-one';
|
|
23
|
+
}
|
|
24
|
+
export interface HeadingTwoElement extends BaseElement {
|
|
25
|
+
type: 'heading-two';
|
|
26
|
+
}
|
|
27
|
+
export interface HeadingThreeElement extends BaseElement {
|
|
28
|
+
type: 'heading-three';
|
|
29
|
+
}
|
|
30
|
+
export interface ListElement extends BaseElement {
|
|
31
|
+
type: 'bulleted-list' | 'numbered-list';
|
|
32
|
+
}
|
|
33
|
+
export interface ListItemElement extends BaseElement {
|
|
34
|
+
type: 'list-item';
|
|
35
|
+
}
|
|
36
|
+
export interface TableElement extends BaseElement {
|
|
37
|
+
type: 'table';
|
|
38
|
+
}
|
|
39
|
+
export interface TableRowElement extends BaseElement {
|
|
40
|
+
type: 'table-row';
|
|
41
|
+
}
|
|
42
|
+
export interface TableCellElement extends BaseElement {
|
|
43
|
+
type: 'table-cell';
|
|
44
|
+
}
|
|
45
|
+
export interface ImageElement extends BaseElement {
|
|
46
|
+
type: 'image';
|
|
47
|
+
url: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CodeBlockElement extends BaseElement {
|
|
50
|
+
type: 'code-block';
|
|
51
|
+
}
|
|
52
|
+
export interface BlockQuoteElement extends BaseElement {
|
|
53
|
+
type: 'block-quote';
|
|
54
|
+
}
|
|
55
|
+
export type CustomElement = ParagraphElement | HeadingOneElement | HeadingTwoElement | HeadingThreeElement | ListElement | ListItemElement | TableElement | TableRowElement | TableCellElement | ImageElement | CodeBlockElement | BlockQuoteElement;
|
|
56
|
+
declare module 'slate' {
|
|
57
|
+
interface CustomTypes {
|
|
58
|
+
Editor: BaseEditor & ReactEditor;
|
|
59
|
+
Element: CustomElement;
|
|
60
|
+
Text: CustomText;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
interface VoiceInputProps {
|
|
2
|
+
onResult: (text: string) => void;
|
|
3
|
+
onError: (error: string) => void;
|
|
4
|
+
}
|
|
5
|
+
interface SpeechRecognitionErrorEvent extends Event {
|
|
6
|
+
error: 'no-speech' | 'audio-capture' | 'not-allowed' | string;
|
|
7
|
+
}
|
|
8
|
+
interface SpeechRecognitionEvent extends Event {
|
|
9
|
+
results: {
|
|
10
|
+
item(index: number): {
|
|
11
|
+
item(index: number): {
|
|
12
|
+
transcript: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
length: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface SpeechRecognition extends EventTarget {
|
|
19
|
+
continuous: boolean;
|
|
20
|
+
interimResults: boolean;
|
|
21
|
+
lang: string;
|
|
22
|
+
onstart: () => void;
|
|
23
|
+
onend: () => void;
|
|
24
|
+
onerror: (event: SpeechRecognitionErrorEvent) => void;
|
|
25
|
+
onresult: (event: SpeechRecognitionEvent) => void;
|
|
26
|
+
abort: () => void;
|
|
27
|
+
start: () => void;
|
|
28
|
+
stop: () => void;
|
|
29
|
+
}
|
|
30
|
+
interface SpeechRecognitionConstructor {
|
|
31
|
+
new (): SpeechRecognition;
|
|
32
|
+
}
|
|
33
|
+
declare global {
|
|
34
|
+
interface Window {
|
|
35
|
+
SpeechRecognition: SpeechRecognitionConstructor;
|
|
36
|
+
webkitSpeechRecognition: SpeechRecognitionConstructor;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export declare function VoiceInput({ onResult, onError }: VoiceInputProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export declare const markdownExample = "# \u4EA7\u54C1\u529F\u80FD\u6982\u8FF0\n\n\u8FD9\u662F\u4E00\u4E2A**\u91CD\u8981**\u7684\u4EA7\u54C1\u8BF4\u660E\u6587\u6863\uFF0C\u5305\u542B\u4E86_\u4E3B\u8981\u529F\u80FD_\u548C<u>\u4F7F\u7528\u8BF4\u660E</u>\u3002\n\n## \u6838\u5FC3\u529F\u80FD\n\n* **\u5B9E\u65F6\u540C\u6B65\uFF1A** \u6570\u636E\u5B9E\u65F6\u66F4\u65B0\n* **\u591A\u7AEF\u652F\u6301\uFF1A** \u652F\u6301\u5404\u79CD\u8BBE\u5907\u8BBF\u95EE\n* **\u5B89\u5168\u53EF\u9760\uFF1A** \u6570\u636E\u52A0\u5BC6\u5B58\u50A8\n\n1. \u7B2C\u4E00\u6B65\uFF1A\u5B89\u88C5\u5E94\u7528\n2. \u7B2C\u4E8C\u6B65\uFF1A\u6CE8\u518C\u8D26\u53F7\n3. \u7B2C\u4E09\u6B65\uFF1A\u5F00\u59CB\u4F7F\u7528\n\n| \u529F\u80FD | \u57FA\u7840\u7248 | \u4E13\u4E1A\u7248 |\n|------|--------|--------|\n| \u5B9E\u65F6\u540C\u6B65 | \u2713 | \u2713 |\n| \u591A\u4EBA\u534F\u4F5C | \u00D7 | \u2713 |\n| \u5386\u53F2\u8BB0\u5F55 | \u00D7 | \u2713 |\n\n\n\n\u66F4\u591A\u8BE6\u7EC6\u4FE1\u606F\u8BF7\u8BBF\u95EE\u6211\u4EEC\u7684\u5B98\u7F51\u3002";
|
|
2
|
+
export declare const htmlExample = "<h1>\u4EA7\u54C1\u529F\u80FD\u6982\u8FF0</h1>\n\n<p>\u8FD9\u662F\u4E00\u4E2A<strong>\u91CD\u8981</strong>\u7684\u4EA7\u54C1\u8BF4\u660E\u6587\u6863\uFF0C\u5305\u542B\u4E86<em>\u4E3B\u8981\u529F\u80FD</em>\u548C<u>\u4F7F\u7528\u8BF4\u660E</u>\u3002</p>\n\n<h2>\u6838\u5FC3\u529F\u80FD</h2>\n\n<ul>\n <li><strong>\u5B9E\u65F6\u540C\u6B65\uFF1A</strong> \u6570\u636E\u5B9E\u65F6\u66F4\u65B0</li>\n <li><strong>\u591A\u7AEF\u652F\u6301\uFF1A</strong> \u652F\u6301\u5404\u79CD\u8BBE\u5907\u8BBF\u95EE</li>\n <li><strong>\u5B89\u5168\u53EF\u9760\uFF1A</strong> \u6570\u636E\u52A0\u5BC6\u5B58\u50A8</li>\n</ul>\n\n<ol>\n <li>\u7B2C\u4E00\u6B65\uFF1A\u5B89\u88C5\u5E94\u7528</li>\n <li>\u7B2C\u4E8C\u6B65\uFF1A\u6CE8\u518C\u8D26\u53F7</li>\n <li>\u7B2C\u4E09\u6B65\uFF1A\u5F00\u59CB\u4F7F\u7528</li>\n</ol>\n\n<table>\n <thead>\n <tr>\n <th>\u529F\u80FD</th>\n <th>\u57FA\u7840\u7248</th>\n <th>\u4E13\u4E1A\u7248</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\u5B9E\u65F6\u540C\u6B65</td>\n <td>\u2713</td>\n <td>\u2713</td>\n </tr>\n <tr>\n <td>\u591A\u4EBA\u534F\u4F5C</td>\n <td>\u00D7</td>\n <td>\u2713</td>\n </tr>\n <tr>\n <td>\u5386\u53F2\u8BB0\u5F55</td>\n <td>\u00D7</td>\n <td>\u2713</td>\n </tr>\n </tbody>\n</table>\n\n<p style=\"text-align: center\">\n <img src=\"https://example.com/preview.jpg\" alt=\"\" style=\"display: block; margin: 0 auto;\">\n</p>\n\n<p>\u66F4\u591A\u8BE6\u7EC6\u4FE1\u606F\u8BF7\u8BBF\u95EE\u6211\u4EEC\u7684\u5B98\u7F51\u3002</p>";
|
|
3
|
+
export declare const slateExample: ({
|
|
4
|
+
type: string;
|
|
5
|
+
children: ({
|
|
6
|
+
text: string;
|
|
7
|
+
bold?: undefined;
|
|
8
|
+
italic?: undefined;
|
|
9
|
+
underline?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
text: string;
|
|
12
|
+
bold: boolean;
|
|
13
|
+
italic?: undefined;
|
|
14
|
+
underline?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
text: string;
|
|
17
|
+
italic: boolean;
|
|
18
|
+
bold?: undefined;
|
|
19
|
+
underline?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
text: string;
|
|
22
|
+
underline: boolean;
|
|
23
|
+
bold?: undefined;
|
|
24
|
+
italic?: undefined;
|
|
25
|
+
})[];
|
|
26
|
+
url?: undefined;
|
|
27
|
+
align?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
type: string;
|
|
30
|
+
children: {
|
|
31
|
+
type: string;
|
|
32
|
+
children: ({
|
|
33
|
+
text: string;
|
|
34
|
+
bold: boolean;
|
|
35
|
+
} | {
|
|
36
|
+
text: string;
|
|
37
|
+
bold?: undefined;
|
|
38
|
+
})[];
|
|
39
|
+
}[];
|
|
40
|
+
url?: undefined;
|
|
41
|
+
align?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
type: string;
|
|
44
|
+
children: ({
|
|
45
|
+
type: string;
|
|
46
|
+
children: {
|
|
47
|
+
type: string;
|
|
48
|
+
children: {
|
|
49
|
+
text: string;
|
|
50
|
+
bold: boolean;
|
|
51
|
+
}[];
|
|
52
|
+
}[];
|
|
53
|
+
} | {
|
|
54
|
+
type: string;
|
|
55
|
+
children: {
|
|
56
|
+
type: string;
|
|
57
|
+
children: {
|
|
58
|
+
text: string;
|
|
59
|
+
}[];
|
|
60
|
+
}[];
|
|
61
|
+
})[];
|
|
62
|
+
url?: undefined;
|
|
63
|
+
align?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
type: string;
|
|
66
|
+
url: string;
|
|
67
|
+
children: {
|
|
68
|
+
text: string;
|
|
69
|
+
}[];
|
|
70
|
+
align: string;
|
|
71
|
+
})[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface Message {
|
|
2
|
+
type: "user" | "ai";
|
|
3
|
+
time: string;
|
|
4
|
+
content: string;
|
|
5
|
+
hasLLMConfig?: boolean;
|
|
6
|
+
retrievedChunks?: Array<{
|
|
7
|
+
content: string;
|
|
8
|
+
similarity: number;
|
|
9
|
+
rerank: number;
|
|
10
|
+
chunk_id: number;
|
|
11
|
+
source: string;
|
|
12
|
+
}>;
|
|
13
|
+
prompt?: string;
|
|
14
|
+
configInfo?: any;
|
|
15
|
+
queryId?: string;
|
|
16
|
+
fullContent?: string;
|
|
17
|
+
finished?: boolean;
|
|
18
|
+
typedLength?: number;
|
|
19
|
+
}
|
|
20
|
+
interface RetrieveTestProps {
|
|
21
|
+
messages?: Message[];
|
|
22
|
+
onSearch?: (query: string, config: any) => void;
|
|
23
|
+
setKbInfo?: any;
|
|
24
|
+
}
|
|
25
|
+
export default function RetrieveTest({ messages: initialMessages, onSearch, setKbInfo }: RetrieveTestProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface FilePreview {
|
|
2
|
+
file: File;
|
|
3
|
+
preview?: string;
|
|
4
|
+
type: 'image' | 'document';
|
|
5
|
+
}
|
|
6
|
+
interface FileUploadProps {
|
|
7
|
+
uploadedFiles: FilePreview[];
|
|
8
|
+
onUpload?: (files: FileList) => void;
|
|
9
|
+
onRemoveFile?: (index: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export default function FileUpload({ uploadedFiles, onUpload, onRemoveFile }: FileUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface FilePreview {
|
|
2
|
+
file: File;
|
|
3
|
+
preview?: string;
|
|
4
|
+
type: 'image' | 'document';
|
|
5
|
+
status?: 'pending' | 'uploading' | 'parsing' | 'done' | 'error' | 'finished';
|
|
6
|
+
name?: string;
|
|
7
|
+
uid?: string;
|
|
8
|
+
styles?: any;
|
|
9
|
+
}
|
|
10
|
+
export default function FilesDisplay({ uploadedFiles, onRemoveFile, eventsEmit, styles }: {
|
|
11
|
+
uploadedFiles: FilePreview[];
|
|
12
|
+
onRemoveFile: (idx: number) => void;
|
|
13
|
+
eventsEmit?: (eventName: string) => void;
|
|
14
|
+
styles?: any;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface BadgeContextType {
|
|
3
|
+
badgeCounts: Record<string, number>;
|
|
4
|
+
updateBadgeCount: (name: string, count: number) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const BadgeProvider: React.FC<{
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const useBadge: () => BadgeContextType;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AiChatStyles } from '../defaultStyleSet';
|
|
2
|
+
import { SenderConfig } from '../AiChat';
|
|
3
|
+
interface FilePreview {
|
|
4
|
+
file: File;
|
|
5
|
+
preview?: string;
|
|
6
|
+
type: 'image' | 'document';
|
|
7
|
+
status?: 'pending' | 'uploading' | 'parsing' | 'done' | 'error';
|
|
8
|
+
name?: string;
|
|
9
|
+
uid?: string;
|
|
10
|
+
}
|
|
11
|
+
interface SenderProps {
|
|
12
|
+
value: string;
|
|
13
|
+
onSend: () => void;
|
|
14
|
+
onUpload: (files: FileList) => void;
|
|
15
|
+
onVoice: () => void;
|
|
16
|
+
styles: AiChatStyles;
|
|
17
|
+
uploadedFiles: FilePreview[];
|
|
18
|
+
fileUploadStatus?: any[];
|
|
19
|
+
status: 'ready' | 'loading' | 'error' | 'processing' | 'uploading';
|
|
20
|
+
onRemoveFile: (index: number) => void;
|
|
21
|
+
eventsEmit: (eventName: string, data?: any) => void;
|
|
22
|
+
recommandQuestions?: any;
|
|
23
|
+
senderConfig?: SenderConfig;
|
|
24
|
+
onSenderConfigChange?: (data: {
|
|
25
|
+
name: string;
|
|
26
|
+
checked: boolean;
|
|
27
|
+
all: Record<string, boolean>;
|
|
28
|
+
}) => void;
|
|
29
|
+
}
|
|
30
|
+
export default function Sender({ value: propValue, eventsEmit, styles, status, onUpload, onVoice, uploadedFiles, onRemoveFile, senderConfig, recommandQuestions, fileUploadStatus, }?: Partial<SenderProps> & {
|
|
31
|
+
senderConfig?: SenderConfig;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormItemProps } from '../AiChat.types';
|
|
2
|
+
interface RetriveConfigPanelProps {
|
|
3
|
+
config?: FormItemProps[];
|
|
4
|
+
styles?: any;
|
|
5
|
+
formName: string;
|
|
6
|
+
onChange?: (formName: string, values: any) => void;
|
|
7
|
+
initialValues?: any;
|
|
8
|
+
}
|
|
9
|
+
export default function RetriveConfigPanel(props: RetriveConfigPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SidebarTabConfig {
|
|
2
|
+
key: string;
|
|
3
|
+
type: 'custom' | 'form';
|
|
4
|
+
label: string;
|
|
5
|
+
icon: any;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
component?: any;
|
|
8
|
+
formConfig?: any[];
|
|
9
|
+
initialValues?: Record<string, any>;
|
|
10
|
+
onChange?: (values: any) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface SidebarProps {
|
|
13
|
+
tabs: SidebarTabConfig[];
|
|
14
|
+
styles?: any;
|
|
15
|
+
}
|
|
16
|
+
export declare const sidebarMock: SidebarProps;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FileCardCommonProps {
|
|
3
|
+
fileName: string;
|
|
4
|
+
fileSize?: number;
|
|
5
|
+
icon: React.ReactNode;
|
|
6
|
+
statusText?: string;
|
|
7
|
+
statusColor?: string;
|
|
8
|
+
statusIcon?: React.ReactNode;
|
|
9
|
+
onRemove?: () => void;
|
|
10
|
+
themeColors?: any;
|
|
11
|
+
cardId?: string;
|
|
12
|
+
showRemove?: boolean;
|
|
13
|
+
disabledRemove?: boolean;
|
|
14
|
+
onRemoveWithAnim?: (id: string) => void;
|
|
15
|
+
extra?: React.ReactNode;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
}
|
|
18
|
+
declare const FileCardCommon: React.FC<FileCardCommonProps>;
|
|
19
|
+
export default FileCardCommon;
|