mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 20:35:19 +00:00
refac: prompt command behaviour
This commit is contained in:
parent
300b7dfcc0
commit
effa87638d
2 changed files with 7 additions and 4 deletions
|
|
@ -855,7 +855,6 @@
|
|||
on:keydown={async (e) => {
|
||||
const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac
|
||||
|
||||
console.log('keydown', e);
|
||||
const commandsContainerElement =
|
||||
document.getElementById('commands-container');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { prompts, user } from '$lib/stores';
|
||||
import { prompts, settings, user } from '$lib/stores';
|
||||
import {
|
||||
findWordIndices,
|
||||
getUserPosition,
|
||||
|
|
@ -120,12 +120,16 @@
|
|||
text = text.replaceAll('{{CURRENT_WEEKDAY}}', weekday);
|
||||
}
|
||||
|
||||
const promptWords = prompt.split(' ');
|
||||
const paragraphs = prompt.split('\n');
|
||||
|
||||
let lastParagraph = paragraphs.pop();
|
||||
const promptWords = lastParagraph.split(' ');
|
||||
|
||||
promptWords.pop();
|
||||
promptWords.push(`${text}`);
|
||||
|
||||
prompt = promptWords.join(' ');
|
||||
lastParagraph = promptWords.join(' ');
|
||||
prompt = $settings?.richTextInput ? paragraphs.join('<br/>') : paragraphs.join('\n');
|
||||
|
||||
const chatInputContainerElement = document.getElementById('chat-input-container');
|
||||
const chatInputElement = document.getElementById('chat-input');
|
||||
|
|
|
|||
Loading…
Reference in a new issue