From 07a5983cd4e30780cfbbd938485f4e2357951d3a Mon Sep 17 00:00:00 2001 From: Concedo Date: Sun, 26 Nov 2023 23:59:00 +0800 Subject: [PATCH] claude fix --- index.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 2a3be1f..9146e4a 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Just copy this single static HTML file anywhere and open it in a browser, or from a webserver. Please go to https://github.com/LostRuins/lite.koboldai.net for updates on Kobold Lite. Kobold Lite is under the AGPL v3.0 License unless otherwise exempted. Please do not remove this line. -Current version: 97 +Current version: 98 -Concedo --> @@ -8711,22 +8711,26 @@ } if(document.getElementById("clauderenamecompat").checked) { + let assistant_correct_case = "Assistant:"; if(!claude_payload.prompt.toLowerCase().trim().startsWith('human:')) { claude_payload.prompt = "Human: "+claude_payload.prompt; } - if(!claude_payload.prompt.toLowerCase().trim().endsWith('assistant:')) + if(!claude_payload.prompt.toLowerCase().trim().endsWith(assistant_correct_case.toLowerCase())) { if(localsettings.opmode==1) { - claude_payload.prompt = claude_payload.prompt + " \nAssistant: Here is a continuation of the story: \nAssistant:"; + claude_payload.prompt = claude_payload.prompt + " \n"+assistant_correct_case+" Here is a continuation of the story: \n"+assistant_correct_case; } else { - claude_payload.prompt = claude_payload.prompt + " Assistant:"; + claude_payload.prompt = claude_payload.prompt + " "+assistant_correct_case; } - } + //trim end + claude_payload.prompt = claude_payload.prompt.replace(/[\t\r\n ]+$/, ''); + //replace final assistant with fixed case + claude_payload.prompt = claude_payload.prompt.slice(0, -(assistant_correct_case.length))+assistant_correct_case; } last_request_str = JSON.stringify(claude_payload); @@ -11730,7 +11734,7 @@
Add Endpoint Version
- +
Claude Compatibility Rename Fix