funda-ui 4.5.713 → 4.5.766
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/Chatbox/index.d.ts +54 -0
- package/Chatbox/index.js +4863 -0
- package/README.md +1 -1
- package/Utils/useStreamController.d.ts +71 -0
- package/Utils/useStreamController.js +494 -0
- package/all.d.ts +1 -0
- package/all.js +1 -0
- package/lib/cjs/Chatbox/index.d.ts +54 -0
- package/lib/cjs/Chatbox/index.js +4863 -0
- package/lib/cjs/Utils/useStreamController.d.ts +71 -0
- package/lib/cjs/Utils/useStreamController.js +494 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/esm/Chatbox/PureLoader.tsx +45 -0
- package/lib/esm/Chatbox/TypingEffect.tsx +32 -0
- package/lib/esm/Chatbox/index.scss +502 -0
- package/lib/esm/Chatbox/index.tsx +1171 -0
- package/lib/esm/Chatbox/useStreamController.tsx +277 -0
- package/lib/esm/Chatbox/utils/func.ts +107 -0
- package/lib/esm/Textarea/index.tsx +1 -0
- package/lib/esm/Utils/hooks/useStreamController.tsx +277 -0
- package/lib/esm/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type MessageDetail = {
|
|
3
|
+
sender: string;
|
|
4
|
+
timestamp: string;
|
|
5
|
+
content: string;
|
|
6
|
+
tag: string;
|
|
7
|
+
};
|
|
8
|
+
export interface FloatingButton {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
onClick: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RequestConfig {
|
|
14
|
+
apiUrl: string;
|
|
15
|
+
requestBody: string;
|
|
16
|
+
responseExtractor: string;
|
|
17
|
+
}
|
|
18
|
+
export declare type ChatboxProps = {
|
|
19
|
+
debug?: boolean;
|
|
20
|
+
prefix?: string;
|
|
21
|
+
contentRef?: React.RefObject<any>;
|
|
22
|
+
model?: string;
|
|
23
|
+
baseUrl?: string;
|
|
24
|
+
apiKey?: string;
|
|
25
|
+
defaultMessages?: MessageDetail[];
|
|
26
|
+
verbose?: boolean;
|
|
27
|
+
reasoningSwitchLabel?: string;
|
|
28
|
+
stopLabel?: React.ReactNode;
|
|
29
|
+
questionName?: React.ReactNode;
|
|
30
|
+
answerName?: React.ReactNode;
|
|
31
|
+
questionNameIcon?: string;
|
|
32
|
+
answerNameIcon?: string;
|
|
33
|
+
bubble?: boolean;
|
|
34
|
+
bubbleLabel?: string;
|
|
35
|
+
sendLabel?: string;
|
|
36
|
+
sendLoading?: boolean;
|
|
37
|
+
sendLoadingLabel?: string;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
noDataPlaceholder?: string;
|
|
40
|
+
requestConfig: RequestConfig;
|
|
41
|
+
headerConfig?: any;
|
|
42
|
+
maxHistoryLength?: number;
|
|
43
|
+
contextData?: Record<string, any>;
|
|
44
|
+
toolkitButtons?: FloatingButton[];
|
|
45
|
+
newChatButton?: FloatingButton;
|
|
46
|
+
renderParser?: (input: string) => Promise<string>;
|
|
47
|
+
requestBodyFormatter?: (body: any, contextData: Record<string, any>, conversationHistory: MessageDetail[]) => any;
|
|
48
|
+
nameFormatter?: (input: string) => string;
|
|
49
|
+
onInputChange?: (controlRef: React.RefObject<any>, val: string) => any;
|
|
50
|
+
onChunk?: (controlRef: React.RefObject<any>, lastContent: string, conversationHistory: MessageDetail[]) => any;
|
|
51
|
+
onComplete?: (controlRef: React.RefObject<any>, lastContent: string, conversationHistory: MessageDetail[]) => any;
|
|
52
|
+
};
|
|
53
|
+
declare const Chatbox: (props: ChatboxProps) => JSX.Element;
|
|
54
|
+
export default Chatbox;
|