-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathBot.d.ts
More file actions
135 lines (135 loc) · 4.03 KB
/
Bot.d.ts
File metadata and controls
135 lines (135 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import { FeedbackRatingType } from '@/queries/sendMessageQuery';
import { BotMessageTheme, FooterTheme, TextInputTheme, UserMessageTheme, FeedbackTheme, DisclaimerPopUpTheme, DateTimeToggleTheme, FollowUpPromptTheme } from '@/features/bubble/types';
import { FilePreview } from '@/components/inputs/textInput/components/FilePreview';
export type FileEvent<T = EventTarget> = {
target: T;
};
export type FormEvent<T = EventTarget> = {
preventDefault: () => void;
currentTarget: T;
};
type IUploadConstraits = {
fileTypes: string[];
maxUploadSize: number;
};
export type UploadsConfig = {
imgUploadSizeAndTypes: IUploadConstraits[];
fileUploadSizeAndTypes: IUploadConstraits[];
isImageUploadAllowed: boolean;
isSpeechToTextEnabled: boolean;
isRAGFileUploadAllowed: boolean;
};
type FilePreviewData = string | ArrayBuffer;
type FilePreview = {
data: FilePreviewData;
mime: string;
name: string;
preview: string;
type: string;
};
type messageType = 'apiMessage' | 'userMessage' | 'usermessagewaiting' | 'leadCaptureMessage';
type ExecutionState = 'INPROGRESS' | 'FINISHED' | 'ERROR' | 'TERMINATED' | 'TIMEOUT' | 'STOPPED';
export type IAgentReasoning = {
agentName?: string;
messages?: string[];
usedTools?: any[];
artifacts?: FileUpload[];
sourceDocuments?: any[];
instructions?: string;
nextAgent?: string;
};
export type IAction = {
id?: string;
data?: any;
elements?: Array<{
type: string;
label: string;
}>;
mapping?: {
approve: string;
reject: string;
toolCalls: any[];
};
};
export type FileUpload = Omit<FilePreview, 'preview'>;
export type AgentFlowExecutedData = {
nodeLabel: string;
nodeId: string;
data: any;
previousNodeIds: string[];
status?: ExecutionState;
};
export type MessageType = {
messageId?: string;
message: string;
type: messageType;
sourceDocuments?: any;
fileAnnotations?: any;
fileUploads?: Partial<FileUpload>[];
artifacts?: Partial<FileUpload>[];
agentReasoning?: IAgentReasoning[];
execution?: any;
agentFlowEventStatus?: string;
agentFlowExecutedData?: any;
usedTools?: any[];
action?: IAction | null;
rating?: FeedbackRatingType;
id?: string;
followUpPrompts?: string;
dateTime?: string;
};
type observerConfigType = (accessor: string | boolean | object | MessageType[]) => void;
export type observersConfigType = Record<'observeUserInput' | 'observeLoading' | 'observeMessages', observerConfigType>;
export type BotProps = {
chatflowid: string;
apiHost?: string;
onRequest?: (request: RequestInit) => Promise<void>;
chatflowConfig?: Record<string, unknown>;
backgroundColor?: string;
welcomeMessage?: string;
errorMessage?: string;
botMessage?: BotMessageTheme;
userMessage?: UserMessageTheme;
followUpPrompts?: FollowUpPromptTheme;
textInput?: TextInputTheme;
feedback?: FeedbackTheme;
poweredByTextColor?: string;
badgeBackgroundColor?: string;
bubbleBackgroundColor?: string;
bubbleTextColor?: string;
showTitle?: boolean;
showAgentMessages?: boolean;
title?: string;
titleAvatarSrc?: string;
titleTextColor?: string;
titleBackgroundColor?: string;
formBackgroundColor?: string;
formTextColor?: string;
fontSize?: number;
isFullPage?: boolean;
footer?: FooterTheme;
sourceDocsTitle?: string;
observersConfig?: observersConfigType;
starterPrompts?: string[] | Record<string, {
prompt: string;
}>;
starterPromptFontSize?: number;
clearChatOnReload?: boolean;
disclaimer?: DisclaimerPopUpTheme;
dateTimeToggle?: DateTimeToggleTheme;
renderHTML?: boolean;
closeBot?: () => void;
};
export type LeadsConfig = {
status: boolean;
title?: string;
name?: boolean;
email?: boolean;
phone?: boolean;
successMessage?: string;
};
export declare const Bot: (botProps: BotProps & {
class?: string;
}) => import("solid-js").JSX.Element;
export {};
//# sourceMappingURL=Bot.d.ts.map