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

add control flag #248

Merged
merged 1 commit into from
Oct 16, 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
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PUBLIC_LIVECHAT_HOST=https://victorious-moss-007e11310.4.azurestaticapps.net/
PUBLIC_LIVECHAT_ENTRY_ICON=images/users/bot.png
PUBLIC_LIVECHAT_VOICE_ENABLED=false
PUBLIC_LIVECHAT_FILES_ENABLED=false
PUBLIC_LIVECHAT_ENABLE_TRAINING=false
PUBLIC_HOME_IMAGE=images/megamenu-img.png
PUBLIC_HOME_SLOGAN=A central workspace for building, testing and evaluating your AI Agents.
PUBLIC_LOGO_URL=images/logo.png
Expand All @@ -17,4 +18,4 @@ PUBLIC_COMPANY_WEBSITE=https://scisharp.github.io/SciSharp/
PUBLIC_PLUGIN_DEFAULT_ICON=https://avatars.githubusercontent.com/u/44989469?s=200&v=4
PUBLIC_ALLOW_SIGNUP=true
PUBLIC_AUTH_ENABLE_SSO=true
PUBLIC_AUTH_ENABLE_FIND_PWD=true
PUBLIC_AUTH_ENABLE_FIND_PWD=true
55 changes: 30 additions & 25 deletions src/routes/chat/[agentId]/[conversationId]/chat-box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
PUBLIC_LIVECHAT_ENTRY_ICON,
PUBLIC_LIVECHAT_VOICE_ENABLED,
PUBLIC_LIVECHAT_FILES_ENABLED,
PUBLIC_LIVECHAT_ENABLE_TRAINING
} from '$env/static/public';
import { BOT_SENDERS, LERNER_ID, TEXT_EDITORS, TRAINING_MODE, USER_SENDERS } from '$lib/helpers/constants';
import { signalr } from '$lib/services/signalr-service.js';
Expand Down Expand Up @@ -1497,35 +1498,37 @@
id={message?.message_id}
text={message?.rich_content?.message?.text || message?.text}
/>
{#if message?.function}
{#if PUBLIC_LIVECHAT_ENABLE_TRAINING === 'true'}
{#if message?.function}
<div class="line-align-center" style="font-size: 17px;">
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="clickable"
style="height: 95%;"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Like"
on:click={e => likeMessage(e, message)}
>
<i class="mdi mdi-thumb-up-outline text-primary" />
</div>
</div>
{/if}
<div class="line-align-center" style="font-size: 17px;">
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="clickable"
style="height: 95%;"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Like"
on:click={e => likeMessage(e, message)}
title="Edit"
on:click={() => openEditBotMsgModal(message)}
>
<i class="mdi mdi-thumb-up-outline text-primary" />
<i class="bx bxs-edit text-primary" />
</div>
</div>
{/if}
<div class="line-align-center" style="font-size: 17px;">
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="clickable"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Edit"
on:click={() => openEditBotMsgModal(message)}
>
<i class="bx bxs-edit text-primary" />
</div>
</div>
</div>
{/if}
{#if !!message.is_chat_message || !!message.has_message_files}
Expand Down Expand Up @@ -1579,11 +1582,11 @@
<div class={`chat-input-section css-animation ${!loadEditor ? 'chat-input-hide' : 'fade-in-from-none'}`}>
<div class="row">
<div class="col-auto">
{#if !disableSpeech}
{#if PUBLIC_LIVECHAT_VOICE_ENABLED === 'true' && !disableSpeech}
<button
type="submit"
class={`btn btn-rounded waves-effect waves-light ${mode === TRAINING_MODE ? 'btn-danger' : 'btn-primary'}`}
disabled={isSendingMsg || isThinking || disableAction || PUBLIC_LIVECHAT_VOICE_ENABLED != 'true'}
disabled={isSendingMsg || isThinking || disableAction}
on:click={() => startListen()}
>
<i class="mdi mdi-{microphoneIcon} md-36" />
Expand Down Expand Up @@ -1652,12 +1655,14 @@
</ChatTextArea>
<div class="chat-util-links">
{#if !isLite}
<ChatBigMessage
disabled={disableAction}
on:click={() => toggleBigMessageModal()}
/>
<ChatBigMessage
disabled={disableAction}
on:click={() => toggleBigMessageModal()}
/>
{/if}
{#if PUBLIC_LIVECHAT_FILES_ENABLED === 'true'}
<ChatUtil disabled={disableAction} on:click={() => loadChatUtils = true} />
{/if}
<ChatUtil disabled={disableAction || PUBLIC_LIVECHAT_FILES_ENABLED != 'true'} on:click={() => loadChatUtils = true} />
</div>
</div>
</div>
Expand Down
Loading