|
52 | 52 | import LoadingDots from '$lib/common/LoadingDots.svelte'; |
53 | 53 | import StateModal from '$lib/common/StateModal.svelte'; |
54 | 54 | import LoadingToComplete from '$lib/common/LoadingToComplete.svelte'; |
55 | | - import ChatTextArea from './chat-util/chat-text-area.svelte'; |
56 | 55 | import AudioSpeaker from '$lib/common/audio-player/AudioSpeaker.svelte'; |
| 56 | + import { AgentExtensions } from '$lib/helpers/utils/agent'; |
57 | 57 | import { utcToLocal } from '$lib/helpers/datetime'; |
58 | 58 | import { replaceNewLine } from '$lib/helpers/http'; |
59 | 59 | import { isAudio, isExcel, isPdf } from '$lib/helpers/utils/file'; |
60 | 60 | import { ChatAction, ConversationTag, EditorType, FileSourceType, SenderAction, UserRole } from '$lib/helpers/enums'; |
| 61 | + import ChatTextArea from './chat-util/chat-text-area.svelte'; |
61 | 62 | import RichContent from './rich-content/rich-content.svelte'; |
62 | 63 | import RcMessage from "./rich-content/rc-message.svelte"; |
63 | 64 | import RcDisclaimer from './rich-content/rc-disclaimer.svelte'; |
|
202 | 203 | } |
203 | 204 |
|
204 | 205 | $: { |
205 | | - disableAction = !ADMIN_ROLES.includes(currentUser?.role || '') && currentUser?.id !== conversationUser?.id || !agent?.chatable; |
| 206 | + disableAction = !ADMIN_ROLES.includes(currentUser?.role || '') && currentUser?.id !== conversationUser?.id || !AgentExtensions.chatable(agent); |
206 | 207 | } |
207 | 208 |
|
208 | 209 | setContext('chat-window-context', { |
|
1647 | 1648 | text={message?.rich_content?.message?.text || message?.text} |
1648 | 1649 | /> |
1649 | 1650 | {/if} |
1650 | | - {#if PUBLIC_LIVECHAT_ENABLE_TRAINING === 'true' && agent?.trainable} |
| 1651 | + {#if PUBLIC_LIVECHAT_ENABLE_TRAINING === 'true' && AgentExtensions.trainable(agent)} |
1651 | 1652 | {#if message?.function} |
1652 | 1653 | <div class="line-align-center" style="font-size: 17px;"> |
1653 | 1654 | <!-- svelte-ignore a11y-click-events-have-key-events --> |
|
0 commit comments