mirror of
https://github.com/open-webui/open-webui
synced 2025-01-30 22:39:03 +00:00
refac
This commit is contained in:
parent
7be93d2a84
commit
17ed7351a4
@ -122,7 +122,7 @@ def replace_messages_variable(template: str, messages: list[str]) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def rag_template(template: str, context: str, query: str):
|
def rag_template(template: str, context: str, query: str):
|
||||||
if template == "":
|
if template.strip() == "":
|
||||||
template = DEFAULT_RAG_TEMPLATE
|
template = DEFAULT_RAG_TEMPLATE
|
||||||
|
|
||||||
if "[context]" not in template and "{{CONTEXT}}" not in template:
|
if "[context]" not in template and "{{CONTEXT}}" not in template:
|
||||||
|
@ -25,7 +25,8 @@
|
|||||||
function handlePaste(event: ClipboardEvent) {
|
function handlePaste(event: ClipboardEvent) {
|
||||||
event.preventDefault(); // Prevent the default paste action
|
event.preventDefault(); // Prevent the default paste action
|
||||||
const clipboardData = event.clipboardData?.getData('text/plain'); // Get plaintext from clipboard
|
const clipboardData = event.clipboardData?.getData('text/plain'); // Get plaintext from clipboard
|
||||||
document.execCommand('insertText', false, clipboardData); // Insert plaintext into contenteditable
|
|
||||||
|
value = `${value}${clipboardData}`; // Append the plaintext to the current value
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -35,8 +36,8 @@
|
|||||||
class="{className} whitespace-pre-wrap relative {!value.trim() ? 'placeholder' : ''}"
|
class="{className} whitespace-pre-wrap relative {!value.trim() ? 'placeholder' : ''}"
|
||||||
style="field-sizing: content; -moz-user-select: text !important;"
|
style="field-sizing: content; -moz-user-select: text !important;"
|
||||||
on:input={() => {
|
on:input={() => {
|
||||||
value = textareaElement.innerText;
|
const text = textareaElement.innerText;
|
||||||
console.log(value);
|
value = text.trim();
|
||||||
}}
|
}}
|
||||||
on:paste={handlePaste}
|
on:paste={handlePaste}
|
||||||
data-placeholder={placeholder}
|
data-placeholder={placeholder}
|
||||||
|
Loading…
Reference in New Issue
Block a user