@quidgest/chatbot 0.5.3 → 0.5.4

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.
Files changed (31) hide show
  1. package/dist/components/ChatBot/ChatBot.vue.d.ts +2 -0
  2. package/dist/components/ChatBot/__tests__/ChatBot.spec.d.ts +1 -0
  3. package/dist/components/ChatBot/types.d.ts +2 -1
  4. package/dist/components/ChatBotMessage/ChatBotMessage.vue.d.ts +3 -1
  5. package/dist/components/FieldPreview/FieldPreview.vue.d.ts +2 -0
  6. package/dist/composables/useChatApi.d.ts +1 -1
  7. package/dist/composables/useChatMessages.d.ts +1 -0
  8. package/dist/composables/useTexts.d.ts +4 -0
  9. package/dist/index.js +15 -15
  10. package/dist/index.mjs +1597 -2209
  11. package/dist/style.css +1 -1
  12. package/package.json +2 -2
  13. package/src/components/ChatBot/ChatBot.vue +57 -60
  14. package/src/components/ChatBot/__tests__/ChatBot.spec.ts +52 -0
  15. package/src/components/ChatBot/__tests__/__snapshots__/ChatBot.spec.ts.snap +39 -0
  16. package/src/components/ChatBot/types.ts +2 -1
  17. package/src/components/ChatBotMessage/ChatBotMessage.vue +5 -3
  18. package/src/components/ChatBotMessage/ChatBotMessageButtons.vue +1 -0
  19. package/src/components/ChatBotMessage/__tests__/ChatBotMessage.spec.ts +7 -3
  20. package/src/components/ChatBotMessage/__tests__/ChatBotMessageButtons.spec.ts +4 -4
  21. package/src/components/ChatToolBar/ChatToolBar.vue +2 -1
  22. package/src/components/ChatToolBar/__tests__/ChatToolBar.spec.ts +38 -18
  23. package/src/components/FieldPreview/FieldPreview.vue +31 -9
  24. package/src/components/FieldPreview/__tests__/__snapshots__/FieldPreview.spec.ts.snap +4 -10
  25. package/src/components/FieldPreview/field-preview.scss +4 -0
  26. package/src/components/MarkdownRender/MarkdownRender.vue +1 -0
  27. package/src/composables/__tests__/useChatMessages.spec.ts +14 -1
  28. package/src/composables/useChatApi.ts +57 -53
  29. package/src/composables/useChatMessages.ts +6 -1
  30. package/src/composables/useTexts.ts +4 -0
  31. package/src/test/setup.ts +5 -0
@@ -13,6 +13,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
13
13
  };
14
14
  }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
15
  "apply-fields": (fields: AppliedFieldData[]) => void;
16
+ "direct-agent-chat": (agentId: string, prompt: string) => void;
16
17
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChatBotProps>, {
17
18
  apiEndpoint: string;
18
19
  userImage: string;
@@ -26,6 +27,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
26
27
  };
27
28
  }>>> & Readonly<{
28
29
  "onApply-fields"?: ((fields: AppliedFieldData[]) => any) | undefined;
30
+ "onDirect-agent-chat"?: ((agentId: string, prompt: string) => any) | undefined;
29
31
  }>, {
30
32
  apiEndpoint: string;
31
33
  userImage: string;
@@ -22,13 +22,14 @@ export type AgentData = {
22
22
  formId: string;
23
23
  };
24
24
  export type FieldData = {
25
+ id: string;
25
26
  name: string;
26
27
  type: string;
27
28
  text: string;
28
29
  applied?: boolean;
29
30
  };
30
31
  export type AppliedFieldData = {
31
- name: string;
32
+ id: string;
32
33
  text: unknown;
33
34
  };
34
35
  export type ChatMessage = {
@@ -1,5 +1,5 @@
1
- import { ChatBotMessageProps } from './';
2
1
  import { AppliedFieldData, FieldData } from '../ChatBot/types';
2
+ import { ChatBotMessageProps } from './types';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChatBotMessageProps>, {
5
5
  sender: string;
@@ -8,12 +8,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
8
8
  fields: () => never[];
9
9
  }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
10
  "apply-fields": (fields: AppliedFieldData[]) => void;
11
+ regenerate: (fieldName: string) => void;
11
12
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChatBotMessageProps>, {
12
13
  sender: string;
13
14
  userImage: undefined;
14
15
  date: () => Date;
15
16
  fields: () => never[];
16
17
  }>>> & Readonly<{
18
+ onRegenerate?: ((fieldName: string) => any) | undefined;
17
19
  "onApply-fields"?: ((fields: AppliedFieldData[]) => any) | undefined;
18
20
  }>, {
19
21
  date: Date;
@@ -2,8 +2,10 @@ import { FieldPreviewProps } from './types';
2
2
 
3
3
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FieldPreviewProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
4
4
  apply: (text: unknown) => void;
5
+ regenerate: (name: string) => void;
5
6
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FieldPreviewProps>>> & Readonly<{
6
7
  onApply?: ((text: unknown) => any) | undefined;
8
+ onRegenerate?: ((name: string) => any) | undefined;
7
9
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
8
10
  export default _default;
9
11
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -14,7 +14,7 @@ export declare function useChatApi(apiEndpoint: string): {
14
14
  clearChatData: (username: string, project: string, agentID: string, formId: string) => Promise<RequestResponse<{
15
15
  success: boolean;
16
16
  }>>;
17
- getFieldSuggestionData: (jobId: string, onChunk: (chunk: string) => void, onMetaData: (metadata: Record<string, unknown>) => void) => Promise<void>;
17
+ getJobResultData: (jobId: string, onChunk: (chunk: string) => void, onMetaData: (metadata: Record<string, unknown>) => void, onRequestError?: (error: Error) => void) => Promise<void>;
18
18
  sendPrompt: (formData: FormData, onChunk: (chunk: string) => void, onError?: (error: Error) => void) => Promise<void>;
19
19
  handleFeedback: (feedback: number, comment: string, sessionID: string) => Promise<RequestResponse<{
20
20
  success: boolean;
@@ -9,4 +9,5 @@ export declare function useChatMessages(): {
9
9
  getLastMessage: () => ChatMessage | undefined;
10
10
  clearMessages: () => void;
11
11
  getMessages: () => ChatMessage[];
12
+ deleteMessageById: (messageId: number) => void;
12
13
  };
@@ -1,3 +1,6 @@
1
+ /**
2
+ * TODO: Implement localization
3
+ */
1
4
  export declare function useTexts(): {
2
5
  copy: string;
3
6
  apply: string;
@@ -21,6 +24,7 @@ export declare function useTexts(): {
21
24
  cancelButton: string;
22
25
  senderImage: string;
23
26
  imagePreview: string;
27
+ regenerateResponsePrompt: string;
24
28
  regenerateResponse: string;
25
29
  generatingResponse: string;
26
30
  suggestionsForField: string;