|
@@ -41,6 +41,7 @@
|
|
|
let pdfExtractImages = true;
|
|
|
|
|
|
let OpenAIKey = '';
|
|
|
+ let showOpenAIKey = false;
|
|
|
let OpenAIUrl = '';
|
|
|
let OpenAIBatchSize = 1;
|
|
|
|
|
@@ -280,24 +281,28 @@
|
|
|
viewBox="0 0 24 24"
|
|
|
fill="currentColor"
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
- ><style>
|
|
|
+ >
|
|
|
+ <style>
|
|
|
.spinner_ajPY {
|
|
|
transform-origin: center;
|
|
|
animation: spinner_AtaB 0.75s infinite linear;
|
|
|
}
|
|
|
+
|
|
|
@keyframes spinner_AtaB {
|
|
|
100% {
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
}
|
|
|
- </style><path
|
|
|
+ </style>
|
|
|
+ <path
|
|
|
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
|
opacity=".25"
|
|
|
- /><path
|
|
|
+ />
|
|
|
+ <path
|
|
|
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
|
class="spinner_ajPY"
|
|
|
- /></svg
|
|
|
- >
|
|
|
+ />
|
|
|
+ </svg>
|
|
|
</div>
|
|
|
{/if}
|
|
|
</button>
|
|
@@ -330,18 +335,60 @@
|
|
|
{#if embeddingEngine === 'openai'}
|
|
|
<div class="my-0.5 flex gap-2">
|
|
|
<input
|
|
|
- class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
+ class="flex-1 w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
placeholder={$i18n.t('API Base URL')}
|
|
|
bind:value={OpenAIUrl}
|
|
|
required
|
|
|
/>
|
|
|
|
|
|
- <input
|
|
|
- class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
- placeholder={$i18n.t('API Key')}
|
|
|
- bind:value={OpenAIKey}
|
|
|
- required
|
|
|
- />
|
|
|
+ <div class="flex-1 flex">
|
|
|
+ <input
|
|
|
+ class="w-full rounded-l-lg py-2 pl-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
+ placeholder={$i18n.t('API Key')}
|
|
|
+ bind:value={OpenAIKey}
|
|
|
+ required
|
|
|
+ {...{ type: showOpenAIKey ? 'text' : 'password' }}
|
|
|
+ />
|
|
|
+ <button
|
|
|
+ class="px-2 transition rounded-r-lg bg-white dark:bg-gray-850"
|
|
|
+ on:click={(e) => {
|
|
|
+ e.preventDefault();
|
|
|
+ showOpenAIKey = !showOpenAIKey;
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {#if showOpenAIKey}
|
|
|
+ <svg
|
|
|
+ xmlns="http://www.w3.org/2000/svg"
|
|
|
+ viewBox="0 0 16 16"
|
|
|
+ fill="currentColor"
|
|
|
+ class="w-4 h-4"
|
|
|
+ >
|
|
|
+ <path
|
|
|
+ fill-rule="evenodd"
|
|
|
+ d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l10.5 10.5a.75.75 0 1 0 1.06-1.06l-1.322-1.323a7.012 7.012 0 0 0 2.16-3.11.87.87 0 0 0 0-.567A7.003 7.003 0 0 0 4.82 3.76l-1.54-1.54Zm3.196 3.195 1.135 1.136A1.502 1.502 0 0 1 9.45 8.389l1.136 1.135a3 3 0 0 0-4.109-4.109Z"
|
|
|
+ clip-rule="evenodd"
|
|
|
+ />
|
|
|
+ <path
|
|
|
+ d="m7.812 10.994 1.816 1.816A7.003 7.003 0 0 1 1.38 8.28a.87.87 0 0 1 0-.566 6.985 6.985 0 0 1 1.113-2.039l2.513 2.513a3 3 0 0 0 2.806 2.806Z"
|
|
|
+ />
|
|
|
+ </svg>
|
|
|
+ {:else}
|
|
|
+ <svg
|
|
|
+ xmlns="http://www.w3.org/2000/svg"
|
|
|
+ viewBox="0 0 16 16"
|
|
|
+ fill="currentColor"
|
|
|
+ class="w-4 h-4"
|
|
|
+ >
|
|
|
+ <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" />
|
|
|
+ <path
|
|
|
+ fill-rule="evenodd"
|
|
|
+ d="M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .566A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
|
|
|
+ clip-rule="evenodd"
|
|
|
+ />
|
|
|
+ </svg>
|
|
|
+ {/if}
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Embedding Batch Size')}</div>
|
|
@@ -439,24 +486,28 @@
|
|
|
viewBox="0 0 24 24"
|
|
|
fill="currentColor"
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
- ><style>
|
|
|
+ >
|
|
|
+ <style>
|
|
|
.spinner_ajPY {
|
|
|
transform-origin: center;
|
|
|
animation: spinner_AtaB 0.75s infinite linear;
|
|
|
}
|
|
|
+
|
|
|
@keyframes spinner_AtaB {
|
|
|
100% {
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
}
|
|
|
- </style><path
|
|
|
+ </style>
|
|
|
+ <path
|
|
|
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
|
opacity=".25"
|
|
|
- /><path
|
|
|
+ />
|
|
|
+ <path
|
|
|
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
|
class="spinner_ajPY"
|
|
|
- /></svg
|
|
|
- >
|
|
|
+ />
|
|
|
+ </svg>
|
|
|
</div>
|
|
|
{:else}
|
|
|
<svg
|
|
@@ -512,24 +563,28 @@
|
|
|
viewBox="0 0 24 24"
|
|
|
fill="currentColor"
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
- ><style>
|
|
|
+ >
|
|
|
+ <style>
|
|
|
.spinner_ajPY {
|
|
|
transform-origin: center;
|
|
|
animation: spinner_AtaB 0.75s infinite linear;
|
|
|
}
|
|
|
+
|
|
|
@keyframes spinner_AtaB {
|
|
|
100% {
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
}
|
|
|
- </style><path
|
|
|
+ </style>
|
|
|
+ <path
|
|
|
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
|
opacity=".25"
|
|
|
- /><path
|
|
|
+ />
|
|
|
+ <path
|
|
|
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
|
class="spinner_ajPY"
|
|
|
- /></svg
|
|
|
- >
|
|
|
+ />
|
|
|
+ </svg>
|
|
|
</div>
|
|
|
{:else}
|
|
|
<svg
|