From 6556161804b308a83aa6659be9d3ec2944a3fb7d Mon Sep 17 00:00:00 2001
From: Concedo <39025047+LostRuins@users.noreply.github.com>
Date: Sun, 12 Apr 2026 02:05:39 +0800
Subject: [PATCH] jinja tool streaming is now finally working
---
koboldcpp.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/koboldcpp.py b/koboldcpp.py
index 6bd4f1ff5..e6ada5c82 100755
--- a/koboldcpp.py
+++ b/koboldcpp.py
@@ -175,7 +175,7 @@ tool_call_pairs = [
("<|tool_call_begin|>", "<|tool_call_end|>"),
("<|tool▁call▁begin|>", "<|tool▁call▁end|>"),
("", ""),
- ("<|tool_call>call:", ""),
+ ("<|tool_call>", ""),
]
saved_stdout = None
@@ -3224,6 +3224,8 @@ def toolcall_to_normalized_json(text,start_tag,end_tag): #convert weird formats
return text
return json.dumps(results) if len(results) > 1 else json.dumps(results[0])
def parse_gemma4(text: str) -> str:
+ if text.startswith("call:"):
+ text = text[len("call:"):]
text = text.replace('<|"|>', '!$$REAL_QUOTE$$!')
text = text.replace('\"', '\\"')
text = text.replace('!$$REAL_QUOTE$$!','"')