|
3177 | 3177 | </div> |
3178 | 3178 |
|
3179 | 3179 | {#if readOnly} |
3180 | | - <div class="pb-6 z-10"> |
3181 | | - <div |
3182 | | - class="text-xs text-gray-400 dark:text-gray-500 text-center" |
3183 | | - > |
3184 | | - {$i18n.t('Read only')} |
| 3180 | + <div class="pb-6 z-10"> |
| 3181 | + <div class="text-xs text-gray-400 dark:text-gray-500 text-center"> |
| 3182 | + {$i18n.t('Read only')} |
| 3183 | + </div> |
3185 | 3184 | </div> |
3186 | | - </div> |
3187 | | - {:else} |
3188 | | - <div class=" pb-2 {dragged ? 'z-0' : 'z-10'}"> |
3189 | | - <MessageInput |
3190 | | - bind:this={messageInput} |
3191 | | - {history} |
3192 | | - {taskIds} |
3193 | | - {selectedModels} |
3194 | | - bind:files |
3195 | | - bind:prompt |
3196 | | - bind:autoScroll |
3197 | | - bind:selectedToolIds |
3198 | | - bind:selectedSkillIds |
3199 | | - bind:selectedFilterIds |
3200 | | - bind:imageGenerationEnabled |
3201 | | - bind:codeInterpreterEnabled |
3202 | | - {pendingOAuthTools} |
3203 | | - bind:webSearchEnabled |
3204 | | - bind:atSelectedModel |
3205 | | - bind:showCommands |
3206 | | - bind:dragged |
3207 | | - toolServers={$toolServers} |
3208 | | - {generating} |
3209 | | - {stopResponse} |
3210 | | - {createMessagePair} |
3211 | | - {onUpload} |
3212 | | - messageQueue={$chatRequestQueues[$chatId] ?? []} |
3213 | | - {chatTasks} |
3214 | | - onQueueSendNow={async (id) => { |
3215 | | - const queue = $chatRequestQueues[$chatId] ?? []; |
3216 | | - const item = queue.find((m) => m.id === id); |
3217 | | - if (item) { |
3218 | | - // Remove from queue |
3219 | | - chatRequestQueues.update((q) => ({ |
3220 | | - ...q, |
3221 | | - [$chatId]: queue.filter((m) => m.id !== id) |
3222 | | - })); |
3223 | | - await stopResponse(false); |
3224 | | - await tick(); |
3225 | | - await submitPrompt(item.prompt, item.files); |
3226 | | - } |
3227 | | - }} |
3228 | | - onQueueEdit={(id) => { |
3229 | | - const queue = $chatRequestQueues[$chatId] ?? []; |
3230 | | - const item = queue.find((m) => m.id === id); |
3231 | | - if (item) { |
3232 | | - // Remove from queue |
| 3185 | + {:else} |
| 3186 | + <div class=" pb-2 {dragged ? 'z-0' : 'z-10'}"> |
| 3187 | + <MessageInput |
| 3188 | + bind:this={messageInput} |
| 3189 | + {history} |
| 3190 | + {taskIds} |
| 3191 | + {selectedModels} |
| 3192 | + bind:files |
| 3193 | + bind:prompt |
| 3194 | + bind:autoScroll |
| 3195 | + bind:selectedToolIds |
| 3196 | + bind:selectedSkillIds |
| 3197 | + bind:selectedFilterIds |
| 3198 | + bind:imageGenerationEnabled |
| 3199 | + bind:codeInterpreterEnabled |
| 3200 | + {pendingOAuthTools} |
| 3201 | + bind:webSearchEnabled |
| 3202 | + bind:atSelectedModel |
| 3203 | + bind:showCommands |
| 3204 | + bind:dragged |
| 3205 | + toolServers={$toolServers} |
| 3206 | + {generating} |
| 3207 | + {stopResponse} |
| 3208 | + {createMessagePair} |
| 3209 | + {onUpload} |
| 3210 | + messageQueue={$chatRequestQueues[$chatId] ?? []} |
| 3211 | + {chatTasks} |
| 3212 | + onQueueSendNow={async (id) => { |
| 3213 | + const queue = $chatRequestQueues[$chatId] ?? []; |
| 3214 | + const item = queue.find((m) => m.id === id); |
| 3215 | + if (item) { |
| 3216 | + // Remove from queue |
| 3217 | + chatRequestQueues.update((q) => ({ |
| 3218 | + ...q, |
| 3219 | + [$chatId]: queue.filter((m) => m.id !== id) |
| 3220 | + })); |
| 3221 | + await stopResponse(false); |
| 3222 | + await tick(); |
| 3223 | + await submitPrompt(item.prompt, item.files); |
| 3224 | + } |
| 3225 | + }} |
| 3226 | + onQueueEdit={(id) => { |
| 3227 | + const queue = $chatRequestQueues[$chatId] ?? []; |
| 3228 | + const item = queue.find((m) => m.id === id); |
| 3229 | + if (item) { |
| 3230 | + // Remove from queue |
| 3231 | + chatRequestQueues.update((q) => ({ |
| 3232 | + ...q, |
| 3233 | + [$chatId]: queue.filter((m) => m.id !== id) |
| 3234 | + })); |
| 3235 | + // Set files and restore prompt to input |
| 3236 | + files = item.files; |
| 3237 | + messageInput?.setText(item.prompt); |
| 3238 | + } |
| 3239 | + }} |
| 3240 | + onQueueDelete={(id) => { |
| 3241 | + const queue = $chatRequestQueues[$chatId] ?? []; |
3233 | 3242 | chatRequestQueues.update((q) => ({ |
3234 | 3243 | ...q, |
3235 | 3244 | [$chatId]: queue.filter((m) => m.id !== id) |
3236 | 3245 | })); |
3237 | | - // Set files and restore prompt to input |
3238 | | - files = item.files; |
3239 | | - messageInput?.setText(item.prompt); |
3240 | | - } |
3241 | | - }} |
3242 | | - onQueueDelete={(id) => { |
3243 | | - const queue = $chatRequestQueues[$chatId] ?? []; |
3244 | | - chatRequestQueues.update((q) => ({ |
3245 | | - ...q, |
3246 | | - [$chatId]: queue.filter((m) => m.id !== id) |
3247 | | - })); |
3248 | | - }} |
3249 | | - onChange={(data) => { |
3250 | | - if (!$temporaryChatEnabled) { |
3251 | | - saveDraft(data, $chatId); |
3252 | | - } |
3253 | | - }} |
3254 | | - on:submit={async (e) => { |
3255 | | - clearDraft($chatId); |
3256 | | - if (e.detail || files.length > 0) { |
3257 | | - await tick(); |
| 3246 | + }} |
| 3247 | + onChange={(data) => { |
| 3248 | + if (!$temporaryChatEnabled) { |
| 3249 | + saveDraft(data, $chatId); |
| 3250 | + } |
| 3251 | + }} |
| 3252 | + on:submit={async (e) => { |
| 3253 | + clearDraft($chatId); |
| 3254 | + if (e.detail || files.length > 0) { |
| 3255 | + await tick(); |
3258 | 3256 |
|
3259 | | - submitHandler(e.detail); |
3260 | | - } |
3261 | | - }} |
3262 | | - /> |
| 3257 | + submitHandler(e.detail); |
| 3258 | + } |
| 3259 | + }} |
| 3260 | + /> |
3263 | 3261 |
|
3264 | | - <div |
3265 | | - class="absolute bottom-1 text-xs text-gray-500 text-center line-clamp-1 right-0 left-0" |
3266 | | - > |
3267 | | - <!-- {$i18n.t('LLMs can make mistakes. Verify important information.')} --> |
| 3262 | + <div |
| 3263 | + class="absolute bottom-1 text-xs text-gray-500 text-center line-clamp-1 right-0 left-0" |
| 3264 | + > |
| 3265 | + <!-- {$i18n.t('LLMs can make mistakes. Verify important information.')} --> |
| 3266 | + </div> |
3268 | 3267 | </div> |
3269 | | - </div> |
3270 | 3268 | {/if} |
3271 | 3269 | {:else} |
3272 | 3270 | <div class="flex items-center h-full"> |
|
0 commit comments