mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-12 23:02:35 +00:00
refac
Some checks are pending
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args: free_disk:false name:main suffix:]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_CUDA=true
USE_CUDA_VER=cu126
free_disk:true name:cuda126 suffix:-cuda126]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_CUDA=true free_disk:true name:cuda suffix:-cuda]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_OLLAMA=true free_disk:false name:ollama suffix:-ollama]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_SLIM=true free_disk:false name:slim suffix:-slim]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args: free_disk:false name:main suffix:]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_CUDA=true
USE_CUDA_VER=cu126
free_disk:true name:cuda126 suffix:-cuda126]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_CUDA=true free_disk:true name:cuda suffix:-cuda]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_OLLAMA=true free_disk:false name:ollama suffix:-ollama]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_SLIM=true free_disk:false name:slim suffix:-slim]) (push) Waiting to run
Create and publish Docker images with specific build args / merge (map[name:cuda suffix:-cuda]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-cuda126, cuda126) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-ollama, ollama) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-slim, slim) (push) Blocked by required conditions
Frontend Build / Format & Build (push) Waiting to run
Frontend Build / Unit Tests (push) Waiting to run
Create and publish Docker images with specific build args / merge (map[name:cuda126 suffix:-cuda126]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:main suffix:]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:ollama suffix:-ollama]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:slim suffix:-slim]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / notify-helm-charts (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (, main) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-cuda, cuda) (push) Blocked by required conditions
Some checks are pending
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args: free_disk:false name:main suffix:]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_CUDA=true
USE_CUDA_VER=cu126
free_disk:true name:cuda126 suffix:-cuda126]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_CUDA=true free_disk:true name:cuda suffix:-cuda]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_OLLAMA=true free_disk:false name:ollama suffix:-ollama]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_SLIM=true free_disk:false name:slim suffix:-slim]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args: free_disk:false name:main suffix:]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_CUDA=true
USE_CUDA_VER=cu126
free_disk:true name:cuda126 suffix:-cuda126]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_CUDA=true free_disk:true name:cuda suffix:-cuda]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_OLLAMA=true free_disk:false name:ollama suffix:-ollama]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_SLIM=true free_disk:false name:slim suffix:-slim]) (push) Waiting to run
Create and publish Docker images with specific build args / merge (map[name:cuda suffix:-cuda]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-cuda126, cuda126) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-ollama, ollama) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-slim, slim) (push) Blocked by required conditions
Frontend Build / Format & Build (push) Waiting to run
Frontend Build / Unit Tests (push) Waiting to run
Create and publish Docker images with specific build args / merge (map[name:cuda126 suffix:-cuda126]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:main suffix:]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:ollama suffix:-ollama]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:slim suffix:-slim]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / notify-helm-charts (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (, main) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-cuda, cuda) (push) Blocked by required conditions
Co-Authored-By: G30 <50341825+silentoplayz@users.noreply.github.com>
This commit is contained in:
parent
5e7e38c035
commit
7aaa4a692e
4 changed files with 45 additions and 3 deletions
|
|
@ -607,6 +607,15 @@ html.high-contrast.dark .ProseMirror p.is-editor-empty:first-child::before {
|
|||
}
|
||||
}
|
||||
|
||||
.ProseMirror p.is-editor-empty.ai-autocompletion:first-child::before {
|
||||
content: attr(data-suggestion);
|
||||
color: #a0a0a0;
|
||||
}
|
||||
|
||||
.ProseMirror p.is-editor-empty.ai-autocompletion:first-child::after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
.ai-autocompletion::after {
|
||||
color: #a0a0a0;
|
||||
|
||||
|
|
|
|||
|
|
@ -2029,6 +2029,11 @@
|
|||
json={true}
|
||||
richText={$settings?.richTextInput ?? true}
|
||||
messageInput={true}
|
||||
followUpSuggestion={!generating &&
|
||||
history?.messages?.[history?.currentId]?.role === 'assistant' &&
|
||||
history?.messages?.[history?.currentId]?.done
|
||||
? (history.messages[history.currentId].followUps?.[0] ?? '')
|
||||
: ''}
|
||||
showFormattingToolbar={$settings?.showFormattingToolbar ?? false}
|
||||
floatingMenuPlacement={'top-start'}
|
||||
insertPromptAsRichText={$settings?.insertPromptAsRichText ?? false}
|
||||
|
|
|
|||
|
|
@ -317,6 +317,28 @@
|
|||
export let preserveBreaks = false;
|
||||
export let generateAutoCompletion: Function = async () => null;
|
||||
export let autocomplete = false;
|
||||
export let followUpSuggestion = '';
|
||||
|
||||
$: if (editor && !editor.isDestroyed) {
|
||||
const { doc } = editor.state;
|
||||
const node = doc.firstChild;
|
||||
if (node?.type.name === 'paragraph' && !node.attrs['data-prompt']) {
|
||||
const suggestion = doc.childCount === 1 && node.content.size === 0 ? followUpSuggestion : '';
|
||||
if ((node.attrs['data-suggestion'] ?? '') !== suggestion) {
|
||||
editor.view.dispatch(
|
||||
editor.state.tr
|
||||
.setNodeMarkup(0, null, {
|
||||
...node.attrs,
|
||||
class: suggestion ? 'ai-autocompletion' : null,
|
||||
'data-prompt': suggestion ? '' : null,
|
||||
'data-suggestion': suggestion || null
|
||||
})
|
||||
.setMeta('addToHistory', false)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export let messageInput = false;
|
||||
export let shiftEnter = false;
|
||||
export let largeTextAsFile = false;
|
||||
|
|
@ -844,11 +866,11 @@
|
|||
})
|
||||
]
|
||||
: []),
|
||||
...(autocomplete
|
||||
...(autocomplete || messageInput
|
||||
? [
|
||||
AIAutocompletion.configure({
|
||||
generateCompletion: async (text) => {
|
||||
if (text.trim().length === 0) {
|
||||
if (!autocomplete || text.trim().length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -134,6 +134,8 @@ export const AIAutocompletion = Extension.create({
|
|||
key: new PluginKey('aiAutocompletion'),
|
||||
props: {
|
||||
handleKeyDown: (view, event) => {
|
||||
if (isComposing || event.isComposing || (event.key === 'Tab' && event.shiftKey))
|
||||
return false;
|
||||
const { state, dispatch } = view;
|
||||
const { selection } = state;
|
||||
const { $head } = selection;
|
||||
|
|
@ -274,7 +276,11 @@ export const AIAutocompletion = Extension.create({
|
|||
// Iterate over all nodes in the document
|
||||
const tr = state.tr;
|
||||
state.doc.descendants((node, pos) => {
|
||||
if (node.type.name === 'paragraph' && node.attrs['data-suggestion']) {
|
||||
if (
|
||||
node.type.name === 'paragraph' &&
|
||||
node.attrs['data-suggestion'] &&
|
||||
node.attrs['data-prompt']
|
||||
) {
|
||||
// Remove suggestion from this paragraph
|
||||
tr.setNodeMarkup(pos, null, {
|
||||
...node.attrs,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue