|
@@ -15,12 +15,13 @@
|
|
|
|
|
|
const dispatch = createEventDispatcher();
|
|
const dispatch = createEventDispatcher();
|
|
|
|
|
|
- import { config, models, settings } from '$lib/stores';
|
|
|
|
|
|
+ import { config, models, settings, user } from '$lib/stores';
|
|
import { synthesizeOpenAISpeech } from '$lib/apis/audio';
|
|
import { synthesizeOpenAISpeech } from '$lib/apis/audio';
|
|
import { imageGenerations } from '$lib/apis/images';
|
|
import { imageGenerations } from '$lib/apis/images';
|
|
import {
|
|
import {
|
|
approximateToHumanReadable,
|
|
approximateToHumanReadable,
|
|
extractSentences,
|
|
extractSentences,
|
|
|
|
+ replaceTokens,
|
|
revertSanitizedResponseContent,
|
|
revertSanitizedResponseContent,
|
|
sanitizeResponseContent
|
|
sanitizeResponseContent
|
|
} from '$lib/utils';
|
|
} from '$lib/utils';
|
|
@@ -74,7 +75,9 @@
|
|
|
|
|
|
let selectedCitation = null;
|
|
let selectedCitation = null;
|
|
|
|
|
|
- $: tokens = marked.lexer(sanitizeResponseContent(message?.content));
|
|
|
|
|
|
+ $: tokens = marked.lexer(
|
|
|
|
+ replaceTokens(sanitizeResponseContent(message?.content), model?.name, $user?.name)
|
|
|
|
+ );
|
|
|
|
|
|
const renderer = new marked.Renderer();
|
|
const renderer = new marked.Renderer();
|
|
|
|
|