From c984147c840a0ec2ca757c1497df58f5a03bf1c1 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Mon, 13 Apr 2026 22:50:08 +0800 Subject: [PATCH] fix quotes --- koboldcpp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koboldcpp.py b/koboldcpp.py index aafe0f6dd..6c07d999a 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -3232,7 +3232,8 @@ def toolcall_to_normalized_json(text,start_tag,end_tag): #convert weird formats if text.startswith("call:"): text = text[len("call:"):] text = text.replace('<|"|>', '!$$REAL_QUOTE$$!') - text = text.replace('\"', '\\"') + text = text.replace('\\', '\\\\') + text = text.replace('"', '\\"') text = text.replace('!$$REAL_QUOTE$$!','"') fn_match = re.match(r'^([a-zA-Z_][a-zA-Z0-9_]*)\{(.*)\}$', text.strip(), re.DOTALL) # extract fn name if not fn_match: