|
@@ -30,70 +30,74 @@
|
|
|
</button>
|
|
|
</div>
|
|
|
|
|
|
- <div class=" dark:text-gray-200 text-sm font-primary py-0.5 px-0.5">
|
|
|
- {#if chatFiles.length > 0}
|
|
|
- <Collapsible title={$i18n.t('Files')} open={true} buttonClassName="w-full">
|
|
|
- <div class="flex flex-col gap-1 mt-1.5" slot="content">
|
|
|
- {#each chatFiles as file, fileIdx}
|
|
|
- <FileItem
|
|
|
- className="w-full"
|
|
|
- item={file}
|
|
|
- edit={true}
|
|
|
- url={file?.url ? file.url : null}
|
|
|
- name={file.name}
|
|
|
- type={file.type}
|
|
|
- size={file?.size}
|
|
|
- dismissible={true}
|
|
|
- on:dismiss={() => {
|
|
|
- // Remove the file from the chatFiles array
|
|
|
+ {#if $user?.role === 'admin' || ($user?.permissions.chat?.controls ?? true)}
|
|
|
+ <div class=" dark:text-gray-200 text-sm font-primary py-0.5 px-0.5">
|
|
|
+ {#if chatFiles.length > 0}
|
|
|
+ <Collapsible title={$i18n.t('Files')} open={true} buttonClassName="w-full">
|
|
|
+ <div class="flex flex-col gap-1 mt-1.5" slot="content">
|
|
|
+ {#each chatFiles as file, fileIdx}
|
|
|
+ <FileItem
|
|
|
+ className="w-full"
|
|
|
+ item={file}
|
|
|
+ edit={true}
|
|
|
+ url={file?.url ? file.url : null}
|
|
|
+ name={file.name}
|
|
|
+ type={file.type}
|
|
|
+ size={file?.size}
|
|
|
+ dismissible={true}
|
|
|
+ on:dismiss={() => {
|
|
|
+ // Remove the file from the chatFiles array
|
|
|
|
|
|
- chatFiles.splice(fileIdx, 1);
|
|
|
- chatFiles = chatFiles;
|
|
|
- }}
|
|
|
- on:click={() => {
|
|
|
- console.log(file);
|
|
|
- }}
|
|
|
- />
|
|
|
- {/each}
|
|
|
- </div>
|
|
|
- </Collapsible>
|
|
|
+ chatFiles.splice(fileIdx, 1);
|
|
|
+ chatFiles = chatFiles;
|
|
|
+ }}
|
|
|
+ on:click={() => {
|
|
|
+ console.log(file);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ {/each}
|
|
|
+ </div>
|
|
|
+ </Collapsible>
|
|
|
|
|
|
- <hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
|
|
- {/if}
|
|
|
+ <hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
|
|
+ {/if}
|
|
|
|
|
|
- <Collapsible bind:open={showValves} title={$i18n.t('Valves')} buttonClassName="w-full">
|
|
|
- <div class="text-sm" slot="content">
|
|
|
- <Valves show={showValves} />
|
|
|
- </div>
|
|
|
- </Collapsible>
|
|
|
+ {#if $user?.role === 'admin' || ($user?.permissions.chat?.valves ?? true)}
|
|
|
+ <Collapsible bind:open={showValves} title={$i18n.t('Valves')} buttonClassName="w-full">
|
|
|
+ <div class="text-sm" slot="content">
|
|
|
+ <Valves show={showValves} />
|
|
|
+ </div>
|
|
|
+ </Collapsible>
|
|
|
+ {/if}
|
|
|
|
|
|
- {#if $user?.role === 'admin' || ($user?.permissions.chat?.system_prompt ?? true)}
|
|
|
- <hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
|
|
+ {#if $user?.role === 'admin' || ($user?.permissions.chat?.system_prompt ?? true)}
|
|
|
+ <hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
|
|
|
|
|
- <Collapsible title={$i18n.t('System Prompt')} open={true} buttonClassName="w-full">
|
|
|
- <div class="" slot="content">
|
|
|
- <textarea
|
|
|
- bind:value={params.system}
|
|
|
- class="w-full text-xs outline-hidden resize-vertical {$settings.highContrastMode
|
|
|
- ? 'border-2 border-gray-300 dark:border-gray-700 rounded-lg bg-gray-50 dark:bg-gray-800 p-2.5'
|
|
|
- : 'py-1.5 bg-transparent'}"
|
|
|
- rows="4"
|
|
|
- placeholder={$i18n.t('Enter system prompt')}
|
|
|
- />
|
|
|
- </div>
|
|
|
- </Collapsible>
|
|
|
- {/if}
|
|
|
+ <Collapsible title={$i18n.t('System Prompt')} open={true} buttonClassName="w-full">
|
|
|
+ <div class="" slot="content">
|
|
|
+ <textarea
|
|
|
+ bind:value={params.system}
|
|
|
+ class="w-full text-xs outline-hidden resize-vertical {$settings.highContrastMode
|
|
|
+ ? 'border-2 border-gray-300 dark:border-gray-700 rounded-lg bg-gray-50 dark:bg-gray-800 p-2.5'
|
|
|
+ : 'py-1.5 bg-transparent'}"
|
|
|
+ rows="4"
|
|
|
+ placeholder={$i18n.t('Enter system prompt')}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </Collapsible>
|
|
|
+ {/if}
|
|
|
|
|
|
- {#if $user?.role === 'admin' || ($user?.permissions.chat?.controls ?? true)}
|
|
|
- <hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
|
|
+ {#if $user?.role === 'admin' || ($user?.permissions.chat?.params ?? true)}
|
|
|
+ <hr class="my-2 border-gray-50 dark:border-gray-700/10" />
|
|
|
|
|
|
- <Collapsible title={$i18n.t('Advanced Params')} open={true} buttonClassName="w-full">
|
|
|
- <div class="text-sm mt-1.5" slot="content">
|
|
|
- <div>
|
|
|
- <AdvancedParams admin={$user?.role === 'admin'} custom={true} bind:params />
|
|
|
+ <Collapsible title={$i18n.t('Advanced Params')} open={true} buttonClassName="w-full">
|
|
|
+ <div class="text-sm mt-1.5" slot="content">
|
|
|
+ <div>
|
|
|
+ <AdvancedParams admin={$user?.role === 'admin'} custom={true} bind:params />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </Collapsible>
|
|
|
- {/if}
|
|
|
- </div>
|
|
|
+ </Collapsible>
|
|
|
+ {/if}
|
|
|
+ </div>
|
|
|
+ {/if}
|
|
|
</div>
|