From b962335c99f5f5232e926ded4609cd9d71d8cfc0 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:23:33 +0800 Subject: [PATCH] fix rosie toolcall issue --- koboldcpp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koboldcpp.py b/koboldcpp.py index 454825ff8..bf219604c 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -3293,7 +3293,7 @@ def repack_toolcall_tags(text: str, original_tools:list): break # fallback ONLY if no tags were found at all if not found: - tool_calls = extract_json_from_string(text) + tool_calls = extract_json_from_string(text,True) tool_calls = coerce_tool_argtypes(tool_calls, original_tools) return tool_calls @@ -6419,7 +6419,7 @@ Change Mode
"object": "chat.completion.chunk", "created": int(time.time()), "model": modelNameToReturn, - "choices": [{"index": 0, "finish_reason": "tool_calls", "delta": {}}] + "choices": [{"index": 0, "finish_reason": "tool_calls" if (len(toolsdata_res) > 0) else currfinishreason, "delta": {}}] }) self.wfile.write(f"data: {chunk_final}\n\n".encode()) self.wfile.write("data: [DONE]\n\n".encode())