-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathBot.d.ts
More file actions
159 lines (159 loc) · 4.66 KB
/
Bot.d.ts
File metadata and controls
159 lines (159 loc) · 4.66 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import { FeedbackRatingType } from '@/queries/sendMessageQuery';
import { BotMessageTheme, FooterTheme, TextInputTheme, UserMessageTheme, FeedbackTheme, DisclaimerPopUpTheme, DateTimeToggleTheme } 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 MessageResponseVersion = {
message?: string;
messageId?: string;
id?: string;
sourceDocuments?: any;
fileAnnotations?: any;
agentReasoning?: IAgentReasoning[];
agentFlowExecutedData?: any;
usedTools?: any[];
action?: IAction | null;
artifacts?: Partial<FileUpload>[];
thinking?: string;
thinkingDuration?: number;
rating?: FeedbackRatingType;
dateTime?: string;
};
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;
thinking?: string;
thinkingDuration?: number;
isThinking?: boolean;
isError?: boolean;
responseVersions?: MessageResponseVersion[];
responseVersionIndex?: number;
};
type observerConfigType = (accessor: string | boolean | object | MessageType[]) => void;
export type observersConfigType = Record<'observeUserInput' | 'observeLoading' | 'observeMessages', observerConfigType>;
export type BotProps = {
chatflowid: string;
apiHost?: string;
pageTitle?: string;
onRequest?: (request: RequestInit) => Promise<void>;
chatflowConfig?: Record<string, unknown>;
backgroundColor?: string;
welcomeMessage?: string;
errorMessage?: string;
botMessage?: BotMessageTheme;
userMessage?: UserMessageTheme;
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;
hasCustomHeader?: boolean;
dialogContainer?: HTMLElement;
};
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