From 0961b0c2c269a3e37617e3dc6340e665a463bb20 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Fri, 2 Aug 2024 17:25:54 -0500 Subject: [PATCH 1/2] refine append prompt --- src/routes/chat/[agentId]/[conversationId]/chat-box.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte b/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte index 5a02f5b..ae01277 100644 --- a/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte +++ b/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte @@ -444,7 +444,7 @@ // @ts-ignore postback: { ...postback, - payload: `${postback?.payload || msgText || ''} ${filePayload}` + payload: `${postback?.payload || msgText || ''}\r\n${filePayload}` } }; } @@ -470,7 +470,7 @@ // @ts-ignore postback: { ...postback, - payload: `${postback?.payload || msgText || ''} ${filePayload}` + payload: `${postback?.payload || msgText || ''}\r\n${filePayload}` } }; } @@ -623,7 +623,7 @@ if (audioCount > 0) { fileStrs.push(`${audioCount} audio ${audioCount > 1 ? 'files' : 'file'}`); } - return prefix + fileStrs.join(' and '); + return prefix + fileStrs.join(' and ') + '.'; } function endChat() { From df17cbd1cb76f9ef71b816b24d9b975a99676aa7 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Fri, 2 Aug 2024 17:37:55 -0500 Subject: [PATCH 2/2] rename file --- ...MessageImageGallery.svelte => MessageFileGallery.svelte} | 0 src/routes/chat/[agentId]/[conversationId]/chat-box.svelte | 6 +++--- .../page/conversation/[conversationId]/conv-dialogs.svelte | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/lib/common/{MessageImageGallery.svelte => MessageFileGallery.svelte} (100%) diff --git a/src/lib/common/MessageImageGallery.svelte b/src/lib/common/MessageFileGallery.svelte similarity index 100% rename from src/lib/common/MessageImageGallery.svelte rename to src/lib/common/MessageFileGallery.svelte diff --git a/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte b/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte index ae01277..5697170 100644 --- a/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte +++ b/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte @@ -42,7 +42,7 @@ import RichContent from './rich-content/rich-content.svelte'; import RcMessage from "./rich-content/rc-message.svelte"; import RcDisclaimer from './rich-content/rc-disclaimer.svelte'; - import MessageImageGallery from '$lib/common/MessageImageGallery.svelte'; + import MessageFileGallery from '$lib/common/MessageFileGallery.svelte'; import ChatImageUploader from './chat-util/chat-image-uploader.svelte'; import ChatImageGallery from './chat-util/chat-image-gallery.svelte'; import PersistLog from './persist-log/persist-log.svelte'; @@ -1083,7 +1083,7 @@ {/if} {#if !!message.is_chat_message || !!message.has_message_files} - getConversationFiles(params.conversationId, message.message_id, FileSourceType.User)} /> @@ -1113,7 +1113,7 @@ {#if !!message.is_chat_message || !!message.has_message_files} - getConversationFiles(params.conversationId, message.message_id, FileSourceType.Bot)} /> diff --git a/src/routes/page/conversation/[conversationId]/conv-dialogs.svelte b/src/routes/page/conversation/[conversationId]/conv-dialogs.svelte index b1308d4..614303a 100644 --- a/src/routes/page/conversation/[conversationId]/conv-dialogs.svelte +++ b/src/routes/page/conversation/[conversationId]/conv-dialogs.svelte @@ -7,7 +7,7 @@ import { _ } from 'svelte-i18n' import { USER_SENDERS } from '$lib/helpers/constants'; import Markdown from '$lib/common/Markdown.svelte'; - import MessageImageGallery from '$lib/common/MessageImageGallery.svelte'; + import MessageFileGallery from '$lib/common/MessageFileGallery.svelte'; import { FileSourceType } from '$lib/helpers/enums'; /** @type {import('$types').ChatResponseModel[]} */ @@ -70,7 +70,7 @@

{#if !!dialog.has_message_files} - getConversationFiles(conversation.id, dialog.message_id, showInRight(dialog) ? FileSourceType.User : FileSourceType.Bot)} />