diff --git a/src/ts/parser.ts b/src/ts/parser.ts index 43a2f716..a94db479 100644 --- a/src/ts/parser.ts +++ b/src/ts/parser.ts @@ -802,6 +802,7 @@ export function risuChatParser(da:string, arg:{ let commentMode = false let commentLatest:string[] = [""] let commentV = new Uint8Array(512) + let thinkingMode = false const matcherObj = { chatID: chatID, chara: chara, @@ -865,6 +866,7 @@ export function risuChatParser(da:string, arg:{ } case 'Comment':{ if(!commentMode){ + thinkingMode = false commentMode = true commentLatest = nested.map((f) => f) if(commentLatest[0].endsWith('\n')){ @@ -888,6 +890,7 @@ export function risuChatParser(da:string, arg:{ break } if(!commentMode){ + thinkingMode = true commentMode = true commentLatest = nested.map((f) => f) if(commentLatest[0].endsWith('\n')){ @@ -924,6 +927,14 @@ export function risuChatParser(da:string, arg:{ } pointer++ } + if(commentMode){ + nested = commentLatest + v = commentV + if(thinkingMode){ + nested[0] += `
Thinking...
` + } + commentMode = false + } if(nested.length === 1){ return nested[0] } diff --git a/src/ts/process/index.ts b/src/ts/process/index.ts index 48c27ee1..1df4dc98 100644 --- a/src/ts/process/index.ts +++ b/src/ts/process/index.ts @@ -263,7 +263,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n if(db.chainOfThought){ unformated.postEverything.push({ role: 'system', - content: `before responding everything, Think step by step how would you respond inside xml tag.` + content: `before respond everything, Think step by step as a ai assistant how would you respond inside xml tag.` }) }