Skip to content

Add onRequest to steaming requests #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ You can also customize chatbot with different configuration
form: {
backgroundColor: 'white',
textColor: 'black',
}
},
customCSS: ``, // Add custom CSS styles. Use !important to override default styles
chatWindow: {
showTitle: true,
Expand Down
5 changes: 2 additions & 3 deletions dist/components/Bot.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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';
import { BaseRequest } from '@/queries/types';
export type FileEvent<T = EventTarget> = {
target: T;
};
Expand Down Expand Up @@ -82,8 +83,6 @@ type observerConfigType = (accessor: string | boolean | object | MessageType[])
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;
Expand Down Expand Up @@ -118,7 +117,7 @@ export type BotProps = {
dateTimeToggle?: DateTimeToggleTheme;
renderHTML?: boolean;
closeBot?: () => void;
};
} & BaseRequest;
export type LeadsConfig = {
status: boolean;
title?: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/components/Bot.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions dist/components/bubbles/BotBubble.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { IAction, MessageType } from '../Bot';
import { DateTimeToggleTheme } from '@/features/bubble/types';
import { BaseRequest } from '@/queries/types';
type Props = {
message: MessageType;
chatflowid: string;
chatId: string;
apiHost?: string;
onRequest?: (request: RequestInit) => Promise<void>;
fileAnnotations?: any;
showAvatar?: boolean;
avatarSrc?: string;
Expand All @@ -21,7 +20,7 @@ type Props = {
renderHTML?: boolean;
handleActionClick: (elem: any, action: IAction | undefined | null) => void;
handleSourceDocumentsClick: (src: any) => void;
};
} & BaseRequest;
export declare const BotBubble: (props: Props) => import("solid-js").JSX.Element;
export {};
//# sourceMappingURL=BotBubble.d.ts.map
2 changes: 1 addition & 1 deletion dist/components/bubbles/BotBubble.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/components/bubbles/LeadCaptureBubble.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { LeadsConfig, MessageType } from '@/components/Bot';
import { BaseRequest } from '@/queries/types';
type Props = {
message: MessageType;
chatflowid: string;
chatId: string;
leadsConfig?: LeadsConfig;
apiHost?: string;
showAvatar?: boolean;
avatarSrc?: string;
backgroundColor?: string;
Expand All @@ -14,7 +14,7 @@ type Props = {
isLeadSaved: boolean;
setIsLeadSaved: (value: boolean) => void;
setLeadEmail: (value: string) => void;
};
} & BaseRequest;
export declare const LeadCaptureBubble: (props: Props) => import("solid-js").JSX.Element;
export {};
//# sourceMappingURL=LeadCaptureBubble.d.ts.map
2 changes: 1 addition & 1 deletion dist/components/bubbles/LeadCaptureBubble.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions dist/queries/sendMessageQuery.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FileUpload, IAction } from '@/components/Bot';
import { BaseRequest } from './types';
export type IncomingInput = {
question?: string;
form?: Record<string, unknown>;
Expand All @@ -11,10 +12,6 @@ export type IncomingInput = {
action?: IAction;
humanInput?: Record<string, unknown>;
};
type BaseRequest = {
apiHost?: string;
onRequest?: (request: RequestInit) => Promise<void>;
};
export type MessageRequest = BaseRequest & {
chatflowid?: string;
body?: IncomingInput;
Expand Down Expand Up @@ -85,5 +82,4 @@ export declare const addLeadQuery: ({ apiHost, body, onRequest }: LeadCaptureReq
data?: any;
error?: Error | undefined;
}>;
export {};
//# sourceMappingURL=sendMessageQuery.d.ts.map
2 changes: 1 addition & 1 deletion dist/queries/sendMessageQuery.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading