Skip to content
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

Features/refine chat window #180

Merged
merged 2 commits into from
Aug 2, 2024
Merged
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
12 changes: 6 additions & 6 deletions src/routes/chat/[agentId]/[conversationId]/chat-box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -444,7 +444,7 @@
// @ts-ignore
postback: {
...postback,
payload: `${postback?.payload || msgText || ''} ${filePayload}`
payload: `${postback?.payload || msgText || ''}\r\n${filePayload}`
}
};
}
Expand All @@ -470,7 +470,7 @@
// @ts-ignore
postback: {
...postback,
payload: `${postback?.payload || msgText || ''} ${filePayload}`
payload: `${postback?.payload || msgText || ''}\r\n${filePayload}`
}
};
}
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -1083,7 +1083,7 @@
<RcDisclaimer content={message.post_action_disclaimer} />
{/if}
{#if !!message.is_chat_message || !!message.has_message_files}
<MessageImageGallery
<MessageFileGallery
galleryStyles={'justify-content: flex-end;'}
fetchFiles={() => getConversationFiles(params.conversationId, message.message_id, FileSourceType.User)}
/>
Expand Down Expand Up @@ -1113,7 +1113,7 @@
<RcMessage message={message} />
<AudioSpeaker text={message?.rich_content?.message?.text || message?.text} />
{#if !!message.is_chat_message || !!message.has_message_files}
<MessageImageGallery
<MessageFileGallery
galleryStyles={'justify-content: flex-start;'}
fetchFiles={() => getConversationFiles(params.conversationId, message.message_id, FileSourceType.Bot)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[]} */
Expand Down Expand Up @@ -70,7 +70,7 @@
<Markdown text={dialog?.rich_content?.message?.text || dialog?.text} containerClasses={'text-primary'} />
</p>
{#if !!dialog.has_message_files}
<MessageImageGallery
<MessageFileGallery
galleryClasses={'dialog-file-display'}
fetchFiles={() => getConversationFiles(conversation.id, dialog.message_id, showInRight(dialog) ? FileSourceType.User : FileSourceType.Bot)}
/>
Expand Down
Loading