From 35ee126c03d233f90b31c3356fff573f57521971 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Fri, 8 Mar 2024 19:35:49 +0200 Subject: [PATCH] Trim whitespace at the end of Claude's prefill. Otherwise it won't pass validation. I didn't make the rules. --- src/endpoints/prompt-converters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/endpoints/prompt-converters.js b/src/endpoints/prompt-converters.js index bf7ff76c8..8d95c28d2 100644 --- a/src/endpoints/prompt-converters.js +++ b/src/endpoints/prompt-converters.js @@ -172,7 +172,7 @@ function convertClaudeMessages(messages, prefillString, useSysPrompt, humanMsgFi if (prefillString) { mergedMessages.push({ role: 'assistant', - content: prefillString, + content: prefillString.trimEnd(), }); }