@quidgest/chatbot 0.4.0 → 0.5.0
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/dist/components/ChatBot/ChatBot.vue.d.ts +53 -0
- package/dist/components/ChatBot/types.d.ts +48 -0
- package/dist/components/ChatBotInput/ChatBotInput.vue.d.ts +17 -0
- package/dist/components/ChatBotInput/index.d.ts +5 -0
- package/dist/components/ChatBotInput/types.d.ts +28 -0
- package/dist/components/ChatBotMessage/ChatBotMessage.vue.d.ts +41 -0
- package/dist/components/ChatBotMessage/ChatBotMessageButtons.vue.d.ts +21 -0
- package/dist/components/ChatBotMessage/index.d.ts +6 -0
- package/dist/components/ChatBotMessage/types.d.ts +46 -0
- package/dist/components/ChatToolBar/ChatToolBar.vue.d.ts +39 -0
- package/dist/components/ChatToolBar/index.d.ts +5 -0
- package/dist/components/ChatToolBar/types.d.ts +16 -0
- package/dist/components/FieldPreview/FieldPreview.vue.d.ts +17 -0
- package/dist/components/FieldPreview/index.d.ts +5 -0
- package/dist/components/FieldPreview/types.d.ts +7 -0
- package/dist/components/MarkdownRender/MarkdownRender.vue.d.ts +13 -0
- package/dist/components/MarkdownRender/index.d.ts +5 -0
- package/dist/components/MarkdownRender/types.d.ts +7 -0
- package/dist/composables/useChatApi.d.ts +23 -0
- package/dist/composables/useChatMessages.d.ts +11 -0
- package/dist/composables/useSSE.d.ts +10 -0
- package/dist/composables/useTexts.d.ts +26 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -47
- package/dist/index.mjs +2651 -8663
- package/dist/style.css +1 -1
- package/dist/utils/helper.d.ts +1 -0
- package/package.json +5 -5
- package/src/assets/chatbot_profile.svg +1 -0
- package/src/assets/styles/styles.scss +10 -42
- package/src/components/ChatBot/ChatBot.vue +375 -0
- package/src/components/ChatBot/types.ts +55 -0
- package/src/components/ChatBotInput/ChatBotInput.vue +195 -0
- package/src/components/ChatBotInput/index.ts +5 -0
- package/src/components/ChatBotInput/types.ts +33 -0
- package/src/components/ChatBotMessage/ChatBotMessage.vue +139 -0
- package/src/components/ChatBotMessage/ChatBotMessageButtons.vue +169 -0
- package/src/components/ChatBotMessage/index.ts +8 -0
- package/src/components/ChatBotMessage/types.ts +70 -0
- package/src/components/ChatToolBar/ChatToolBar.vue +82 -0
- package/src/components/ChatToolBar/index.ts +5 -0
- package/src/components/ChatToolBar/types.ts +18 -0
- package/src/components/FieldPreview/FieldPreview.vue +78 -0
- package/src/components/FieldPreview/field-preview.scss +34 -0
- package/src/components/FieldPreview/index.ts +5 -0
- package/src/components/FieldPreview/types.ts +7 -0
- package/src/components/MarkdownRender/MarkdownRender.vue +25 -0
- package/src/components/MarkdownRender/index.ts +5 -0
- package/src/components/MarkdownRender/markdown-render.scss +24 -0
- package/src/components/MarkdownRender/types.ts +7 -0
- package/src/components/PulseDots/PulseDots.vue +24 -0
- package/src/components/PulseDots/pulse-dots.scss +37 -0
- package/src/composables/useChatApi.ts +156 -0
- package/src/composables/useChatMessages.ts +58 -0
- package/src/composables/useSSE.ts +90 -0
- package/src/composables/useTexts.ts +32 -0
- package/src/index.ts +1 -1
- package/src/utils/helper.ts +12 -0
- package/dist/components/CBMessage.vue.d.ts +0 -95
- package/dist/components/ChatBot.vue.d.ts +0 -65
- package/dist/components/index.d.ts +0 -4
- package/dist/types/chatbot.type.d.ts +0 -14
- package/dist/types/message.type.d.ts +0 -34
- package/dist/types/texts.type.d.ts +0 -3
- package/src/assets/chatbot.png +0 -0
- package/src/components/CBMessage.vue +0 -276
- package/src/components/ChatBot.vue +0 -496
- package/src/components/PulseDots.vue +0 -15
- package/src/components/index.ts +0 -4
- package/src/types/chatbot.type.ts +0 -15
- package/src/types/message.type.ts +0 -55
- package/src/types/texts.type.ts +0 -3
- /package/dist/components/{PulseDots.vue.d.ts → PulseDots/PulseDots.vue.d.ts} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ChatBotProps, AppliedFieldData } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChatBotProps>, {
|
|
4
|
+
apiEndpoint: string;
|
|
5
|
+
userImage: string;
|
|
6
|
+
chatbotImage: string;
|
|
7
|
+
userPrompt: string;
|
|
8
|
+
availableAgents: () => never[];
|
|
9
|
+
agentData: () => {
|
|
10
|
+
id: string;
|
|
11
|
+
formId: string;
|
|
12
|
+
jobId: string;
|
|
13
|
+
};
|
|
14
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
"apply-fields": (fields: AppliedFieldData[]) => void;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChatBotProps>, {
|
|
17
|
+
apiEndpoint: string;
|
|
18
|
+
userImage: string;
|
|
19
|
+
chatbotImage: string;
|
|
20
|
+
userPrompt: string;
|
|
21
|
+
availableAgents: () => never[];
|
|
22
|
+
agentData: () => {
|
|
23
|
+
id: string;
|
|
24
|
+
formId: string;
|
|
25
|
+
jobId: string;
|
|
26
|
+
};
|
|
27
|
+
}>>> & Readonly<{
|
|
28
|
+
"onApply-fields"?: ((fields: AppliedFieldData[]) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
apiEndpoint: string;
|
|
31
|
+
userImage: string;
|
|
32
|
+
chatbotImage: string;
|
|
33
|
+
availableAgents: import('./types').AvailableAgents[];
|
|
34
|
+
agentData: import('./types').AgentData;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
38
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
39
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
40
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
41
|
+
} : {
|
|
42
|
+
type: import('vue').PropType<T[K]>;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
type __VLS_WithDefaults<P, D> = {
|
|
47
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
48
|
+
default: D[K];
|
|
49
|
+
}> : P[K];
|
|
50
|
+
};
|
|
51
|
+
type __VLS_Prettify<T> = {
|
|
52
|
+
[K in keyof T]: T[K];
|
|
53
|
+
} & {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type ChatBotProps = {
|
|
2
|
+
apiEndpoint?: string;
|
|
3
|
+
controllerEndpoint?: string;
|
|
4
|
+
username: string;
|
|
5
|
+
projectPath: string;
|
|
6
|
+
userImage?: string;
|
|
7
|
+
chatbotImage?: string;
|
|
8
|
+
dateFormat: string;
|
|
9
|
+
agentData?: AgentData;
|
|
10
|
+
availableAgents?: AvailableAgents[];
|
|
11
|
+
};
|
|
12
|
+
export type AvailableAgents = {
|
|
13
|
+
key: string;
|
|
14
|
+
value: string;
|
|
15
|
+
formId: string;
|
|
16
|
+
};
|
|
17
|
+
export type AgentData = {
|
|
18
|
+
id: string;
|
|
19
|
+
jobId: string;
|
|
20
|
+
formId: string;
|
|
21
|
+
};
|
|
22
|
+
export type FieldData = {
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
text: string;
|
|
26
|
+
applied?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type AppliedFieldData = {
|
|
29
|
+
name: string;
|
|
30
|
+
text: unknown;
|
|
31
|
+
};
|
|
32
|
+
export type ChatMessage = {
|
|
33
|
+
id: number;
|
|
34
|
+
message: string;
|
|
35
|
+
date: Date;
|
|
36
|
+
sender: ChatBotMessageSender;
|
|
37
|
+
sessionID: string;
|
|
38
|
+
imagePreviewUrl?: string;
|
|
39
|
+
isWelcomeMessage?: boolean;
|
|
40
|
+
fields?: FieldData[];
|
|
41
|
+
};
|
|
42
|
+
export type ChatBotMessageContent = {
|
|
43
|
+
content: string;
|
|
44
|
+
type: string;
|
|
45
|
+
sessionID: string;
|
|
46
|
+
imageUrl?: string;
|
|
47
|
+
};
|
|
48
|
+
export type ChatBotMessageSender = 'bot' | 'user';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChatBotInputProps, ChatBotImage } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ChatBotInputProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
|
+
sendMessage: (prompt: string, image?: ChatBotImage | undefined) => void;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ChatBotInputProps>>> & Readonly<{
|
|
6
|
+
onSendMessage?: ((prompt: string, image?: ChatBotImage | undefined) => any) | undefined;
|
|
7
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
10
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
11
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
12
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
13
|
+
} : {
|
|
14
|
+
type: import('vue').PropType<T[K]>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type ChatBotInputProps = {
|
|
2
|
+
/**
|
|
3
|
+
* If the footer is disabled or not
|
|
4
|
+
*/
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* If the footer is loading or not
|
|
8
|
+
*/
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The message to be sent
|
|
12
|
+
*/
|
|
13
|
+
userPrompt?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The agent to be used
|
|
16
|
+
*/
|
|
17
|
+
agentId?: string;
|
|
18
|
+
};
|
|
19
|
+
export type ChatBotImage = {
|
|
20
|
+
/**
|
|
21
|
+
* The image URL
|
|
22
|
+
*/
|
|
23
|
+
previewUrl: string;
|
|
24
|
+
/**
|
|
25
|
+
* The file object
|
|
26
|
+
*/
|
|
27
|
+
file: File;
|
|
28
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ChatBotMessageProps } from './';
|
|
2
|
+
import { AppliedFieldData, FieldData } from '../ChatBot/types';
|
|
3
|
+
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChatBotMessageProps>, {
|
|
5
|
+
sender: string;
|
|
6
|
+
userImage: undefined;
|
|
7
|
+
date: () => Date;
|
|
8
|
+
fields: () => never[];
|
|
9
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
"apply-fields": (fields: AppliedFieldData[]) => void;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChatBotMessageProps>, {
|
|
12
|
+
sender: string;
|
|
13
|
+
userImage: undefined;
|
|
14
|
+
date: () => Date;
|
|
15
|
+
fields: () => never[];
|
|
16
|
+
}>>> & Readonly<{
|
|
17
|
+
"onApply-fields"?: ((fields: AppliedFieldData[]) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
date: Date;
|
|
20
|
+
sender: import('../ChatBot/types').ChatBotMessageSender;
|
|
21
|
+
userImage: string;
|
|
22
|
+
fields: FieldData[];
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
27
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
+
} : {
|
|
30
|
+
type: import('vue').PropType<T[K]>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
type __VLS_WithDefaults<P, D> = {
|
|
35
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
|
+
default: D[K];
|
|
37
|
+
}> : P[K];
|
|
38
|
+
};
|
|
39
|
+
type __VLS_Prettify<T> = {
|
|
40
|
+
[K in keyof T]: T[K];
|
|
41
|
+
} & {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChatBotMessageButtonsProps } from './';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ChatBotMessageButtonsProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
|
+
"submit-feedback": (feedback: number, comment: string) => void;
|
|
5
|
+
"copy-response": () => void;
|
|
6
|
+
"apply-all": () => void;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ChatBotMessageButtonsProps>>> & Readonly<{
|
|
8
|
+
"onSubmit-feedback"?: ((feedback: number, comment: string) => any) | undefined;
|
|
9
|
+
"onCopy-response"?: (() => any) | undefined;
|
|
10
|
+
"onApply-all"?: (() => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as ChatBotMessage } from './ChatBotMessage.vue';
|
|
2
|
+
import { ChatBotMessageProps, ChatBotMessageButtonsProps } from './types';
|
|
3
|
+
import { default as ChatBotMessageButtons } from './ChatBotMessageButtons.vue';
|
|
4
|
+
|
|
5
|
+
export { ChatBotMessage, ChatBotMessageButtons };
|
|
6
|
+
export type { ChatBotMessageProps, ChatBotMessageButtonsProps };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ChatBotMessageSender, FieldData } from '../ChatBot/types';
|
|
2
|
+
|
|
3
|
+
export type ChatBotMessageProps = {
|
|
4
|
+
sender?: ChatBotMessageSender;
|
|
5
|
+
message?: string;
|
|
6
|
+
date?: Date;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Project locale
|
|
10
|
+
*/
|
|
11
|
+
dateFormat: string;
|
|
12
|
+
/**
|
|
13
|
+
* Image preview URL
|
|
14
|
+
*/
|
|
15
|
+
imagePreviewUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Default api endpoint
|
|
18
|
+
*/
|
|
19
|
+
apiEndpoint: string;
|
|
20
|
+
/**
|
|
21
|
+
* Session ID
|
|
22
|
+
*/
|
|
23
|
+
sessionID?: string;
|
|
24
|
+
/**
|
|
25
|
+
* User image
|
|
26
|
+
*/
|
|
27
|
+
userImage: string;
|
|
28
|
+
/**
|
|
29
|
+
* Chatbot image
|
|
30
|
+
*/
|
|
31
|
+
chatbotImage: string;
|
|
32
|
+
/**
|
|
33
|
+
* Flag to mark welcome messages
|
|
34
|
+
*/
|
|
35
|
+
isWelcomeMessage?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Additional fields for the message
|
|
38
|
+
*/
|
|
39
|
+
fields?: FieldData[];
|
|
40
|
+
};
|
|
41
|
+
export type ChatBotMessageButtonsProps = {
|
|
42
|
+
loading: boolean;
|
|
43
|
+
showButtons: boolean;
|
|
44
|
+
dateFormat: string;
|
|
45
|
+
date?: Date;
|
|
46
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ChatToolBarProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChatToolBarProps>, {
|
|
4
|
+
availableAgents: () => never[];
|
|
5
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
+
clear: () => void;
|
|
7
|
+
"change-chat": (value: {
|
|
8
|
+
key: string;
|
|
9
|
+
formId: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChatToolBarProps>, {
|
|
12
|
+
availableAgents: () => never[];
|
|
13
|
+
}>>> & Readonly<{
|
|
14
|
+
onClear?: (() => any) | undefined;
|
|
15
|
+
"onChange-chat"?: ((value: {
|
|
16
|
+
key: string;
|
|
17
|
+
formId: string;
|
|
18
|
+
}) => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
availableAgents: import('../ChatBot/types').AvailableAgents[];
|
|
21
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
24
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
25
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
26
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
27
|
+
} : {
|
|
28
|
+
type: import('vue').PropType<T[K]>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
type __VLS_WithDefaults<P, D> = {
|
|
33
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
34
|
+
default: D[K];
|
|
35
|
+
}> : P[K];
|
|
36
|
+
};
|
|
37
|
+
type __VLS_Prettify<T> = {
|
|
38
|
+
[K in keyof T]: T[K];
|
|
39
|
+
} & {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AvailableAgents } from '../ChatBot/types';
|
|
2
|
+
|
|
3
|
+
export type ChatToolBarProps = {
|
|
4
|
+
/**
|
|
5
|
+
* If true, the toolbar will be disabled and not clickable.
|
|
6
|
+
*/
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Availabe Agents to select from.
|
|
10
|
+
*/
|
|
11
|
+
availableAgents?: AvailableAgents[];
|
|
12
|
+
/**
|
|
13
|
+
* The currently selected agent.
|
|
14
|
+
*/
|
|
15
|
+
selectedAgentKey?: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FieldPreviewProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FieldPreviewProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
|
+
apply: (text: unknown) => void;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FieldPreviewProps>>> & Readonly<{
|
|
6
|
+
onApply?: ((text: unknown) => any) | undefined;
|
|
7
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
10
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
11
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
12
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
13
|
+
} : {
|
|
14
|
+
type: import('vue').PropType<T[K]>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MarkdownRenderProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<MarkdownRenderProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<MarkdownRenderProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export default _default;
|
|
5
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
6
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
7
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
8
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
9
|
+
} : {
|
|
10
|
+
type: import('vue').PropType<T[K]>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChatBotMessageContent } from '../components/ChatBot/types';
|
|
2
|
+
|
|
3
|
+
type RequestResponse<T> = {
|
|
4
|
+
data: T | null;
|
|
5
|
+
error: Error | null;
|
|
6
|
+
};
|
|
7
|
+
export declare function useChatApi(apiEndpoint: string): {
|
|
8
|
+
isLoading: import('vue').Ref<boolean, boolean>;
|
|
9
|
+
lastError: import('vue').Ref<Error | null, Error | null>;
|
|
10
|
+
getChatData: (username: string, project: string, agentID: string, formId: string) => Promise<RequestResponse<{
|
|
11
|
+
success: boolean;
|
|
12
|
+
history: ChatBotMessageContent[];
|
|
13
|
+
}>>;
|
|
14
|
+
clearChatData: (username: string, project: string, agentID: string, formId: string) => Promise<RequestResponse<{
|
|
15
|
+
success: boolean;
|
|
16
|
+
}>>;
|
|
17
|
+
getFieldSuggestionData: (jobId: string, onChunk: (chunk: string) => void, onMetaData: (metadata: Record<string, unknown>) => void) => Promise<void>;
|
|
18
|
+
sendPrompt: (formData: FormData, onChunk: (chunk: string) => void, onError?: (error: Error) => void) => Promise<void>;
|
|
19
|
+
handleFeedback: (feedback: number, comment: string, sessionID: string) => Promise<RequestResponse<{
|
|
20
|
+
success: boolean;
|
|
21
|
+
}>>;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ChatMessage, ChatBotMessageSender } from '../components/ChatBot/types';
|
|
3
|
+
|
|
4
|
+
export declare function useChatMessages(): {
|
|
5
|
+
messages: Ref<ChatMessage[], ChatMessage[]>;
|
|
6
|
+
nextMessageId: Ref<number, number>;
|
|
7
|
+
addChatMessage: (message: string, sender?: ChatBotMessageSender, imagePreviewUrl?: string | null, sessionID?: string, isWelcomeMessage?: boolean) => void;
|
|
8
|
+
getLastMessage: () => ChatMessage | undefined;
|
|
9
|
+
clearMessages: () => void;
|
|
10
|
+
getMessages: () => ChatMessage[];
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
|
|
3
|
+
type SSEvents = {
|
|
4
|
+
onMessage?: (message: string) => void;
|
|
5
|
+
onError?: (error: Error) => void;
|
|
6
|
+
onFieldMetadata?: (metadata: Record<string, unknown>) => void;
|
|
7
|
+
onDone?: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function useSSE(config: AxiosRequestConfig, handlers: SSEvents): Promise<void>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare function useTexts(): {
|
|
2
|
+
copy: string;
|
|
3
|
+
apply: string;
|
|
4
|
+
applyAll: string;
|
|
5
|
+
chatbotTitle: string;
|
|
6
|
+
sendMessage: string;
|
|
7
|
+
clearChat: string;
|
|
8
|
+
inputLabel: string;
|
|
9
|
+
imageUpload: string;
|
|
10
|
+
imageUploadQButton: string;
|
|
11
|
+
goodResponse: string;
|
|
12
|
+
badResponse: string;
|
|
13
|
+
initialMessage: string;
|
|
14
|
+
initialAgentMessage: string;
|
|
15
|
+
loginError: string;
|
|
16
|
+
botIsSick: string;
|
|
17
|
+
commentDialogTitle: string;
|
|
18
|
+
commentPlaceholder: string;
|
|
19
|
+
copyResponse: string;
|
|
20
|
+
submitButton: string;
|
|
21
|
+
cancelButton: string;
|
|
22
|
+
senderImage: string;
|
|
23
|
+
imagePreview: string;
|
|
24
|
+
regenerateResponse: string;
|
|
25
|
+
generatingResponse: string;
|
|
26
|
+
};
|
package/dist/index.d.ts
CHANGED