From 108fccbcb6ce1c074c1fc8cfbd93921786bd449f Mon Sep 17 00:00:00 2001 From: LL Date: Tue, 6 Jun 2023 18:39:49 +0900 Subject: [PATCH] [fix]: Apply markdown for auto suggest, improve suggestion quality This commit adds the import for the ParseMarkdown function from the parser module required for translating messages in the Suggestion chat screen. The code changes also include adding a check for the translator variable in the button toggle handling to avoid unwanted button display. Lastly, the commit updates the template for rendering translated suggest messages. --- src/lib/ChatScreens/Suggestion.svelte | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/lib/ChatScreens/Suggestion.svelte b/src/lib/ChatScreens/Suggestion.svelte index 9ae4309f..2cd0c447 100644 --- a/src/lib/ChatScreens/Suggestion.svelte +++ b/src/lib/ChatScreens/Suggestion.svelte @@ -11,6 +11,7 @@ import { onDestroy } from 'svelte'; import { processScript } from "src/ts/process/scripts"; import { get } from "svelte/store"; + import { ParseMarkdown } from "src/ts/parser"; export let send: () => any; export let messageInput:(string:string) => any; @@ -68,10 +69,9 @@ role:'system', content: replacePlaceholders($DataBase.autoSuggestPrompt, currentChar.name) } - , - { + ,{ role: 'user', - content: lastMessages.map(b=>(b.role==='char'? 'assistant' : 'user')+":"+b.data).reduce((a,b)=>a+','+b) + content: lastMessages.map(b=>(b.role==='char'? currentChar.name : $DataBase.username)+":"+b.data).reduce((a,b)=>a+','+b) } ] @@ -118,16 +118,18 @@
{language.creatingSuggestions}
{:else if !$doingChat} -
- -
+ {#if $DataBase.translator !== ''} +
+ +
+ {/if} +