feat: enforced temporary chat

This commit is contained in:
Timothy Jaeryang Baek
2025-03-31 17:58:43 -07:00
parent 580965df17
commit 5f792d2771
6 changed files with 34 additions and 3 deletions

View File

@@ -52,12 +52,19 @@
prompts: false,
tools: false
},
sharing: {
public_models: false,
public_knowledge: false,
public_prompts: false,
public_tools: false
},
chat: {
controls: true,
file_upload: true,
delete: true,
edit: true,
temporary: true
temporary: true,
temporary_enforced: true
},
features: {
web_search: true,

View File

@@ -23,8 +23,9 @@
controls: true,
delete: true,
edit: true,
file_upload: true,
temporary: true,
file_upload: true
temporary_enforced: true
},
features: {
web_search: true,
@@ -277,6 +278,16 @@
<Switch bind:state={permissions.chat.temporary} />
</div>
{#if permissions.chat.temporary}
<div class=" flex w-full justify-between my-2 pr-2">
<div class=" self-center text-xs font-medium">
{$i18n.t('Enforce Temporary Chat')}
</div>
<Switch bind:state={permissions.chat.temporary_enforced} />
</div>
{/if}
</div>
<hr class=" border-gray-100 dark:border-gray-850 my-2" />

View File

@@ -46,7 +46,8 @@
model: model
}))}
showTemporaryChatControl={$user.role === 'user'
? ($user?.permissions?.chat?.temporary ?? true)
? ($user?.permissions?.chat?.temporary ?? true) &&
!($user?.permissions?.chat?.temporary_enforced ?? false)
: true}
bind:value={selectedModel}
/>