Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
d863e7e6
Commit
d863e7e6
authored
Feb 21, 2024
by
Timothy J. Baek
Browse files
feat: save message
parent
cc50cc10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
src/lib/components/chat/Messages.svelte
src/lib/components/chat/Messages.svelte
+10
-0
src/lib/components/chat/Messages/ResponseMessage.svelte
src/lib/components/chat/Messages/ResponseMessage.svelte
+10
-5
No files found.
src/lib/components/chat/Messages.svelte
View file @
d863e7e6
...
@@ -309,6 +309,16 @@
...
@@ -309,6 +309,16 @@
{copyToClipboard}
{copyToClipboard}
{continueGeneration}
{continueGeneration}
{regenerateResponse}
{regenerateResponse}
on:save={async (e) => {
console.log('save', e);
const message = e.detail;
history.messages[message.id] = message;
await updateChatById(localStorage.token, chatId, {
messages: messages,
history: history
});
}}
/>
/>
{/if}
{/if}
</div>
</div>
...
...
src/lib/components/chat/Messages/ResponseMessage.svelte
View file @
d863e7e6
...
@@ -2,22 +2,25 @@
...
@@ -2,22 +2,25 @@
import toast from 'svelte-french-toast';
import toast from 'svelte-french-toast';
import dayjs from 'dayjs';
import dayjs from 'dayjs';
import { marked } from 'marked';
import { marked } from 'marked';
import { config, settings } from '$lib/stores';
import tippy from 'tippy.js';
import tippy from 'tippy.js';
import auto_render from 'katex/dist/contrib/auto-render.mjs';
import auto_render from 'katex/dist/contrib/auto-render.mjs';
import 'katex/dist/katex.min.css';
import 'katex/dist/katex.min.css';
import { createEventDispatcher } from 'svelte';
import { onMount, tick } from 'svelte';
import { onMount, tick } from 'svelte';
const dispatch = createEventDispatcher();
import { config, settings } from '$lib/stores';
import { synthesizeOpenAISpeech } from '$lib/apis/openai';
import { imageGenerations } from '$lib/apis/images';
import { extractSentences } from '$lib/utils';
import Name from './Name.svelte';
import Name from './Name.svelte';
import ProfileImage from './ProfileImage.svelte';
import ProfileImage from './ProfileImage.svelte';
import Skeleton from './Skeleton.svelte';
import Skeleton from './Skeleton.svelte';
import CodeBlock from './CodeBlock.svelte';
import CodeBlock from './CodeBlock.svelte';
import { synthesizeOpenAISpeech } from '$lib/apis/openai';
import { extractSentences } from '$lib/utils';
import { imageGenerations } from '$lib/apis/images';
export let modelfiles = [];
export let modelfiles = [];
export let message;
export let message;
export let siblings;
export let siblings;
...
@@ -280,6 +283,8 @@
...
@@ -280,6 +283,8 @@
type: 'image',
type: 'image',
url: `data:image/png;base64,${image}`
url: `data:image/png;base64,${image}`
}));
}));
dispatch('save', message);
}
}
generatingImage = false;
generatingImage = false;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment