From e7970de6d2263288ef70daba9873cf77f65cbfdc Mon Sep 17 00:00:00 2001 From: 0xallam Date: Fri, 20 Feb 2026 07:48:54 -0800 Subject: [PATCH] fix: Handle single-quoted and whitespace-padded tool call tags --- strix/llm/utils.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/strix/llm/utils.py b/strix/llm/utils.py index b1c244f..b866661 100644 --- a/strix/llm/utils.py +++ b/strix/llm/utils.py @@ -3,11 +3,11 @@ import re from typing import Any -_INVOKE_OPEN = re.compile(r'') -_PARAM_NAME_ATTR = re.compile(r'') +_INVOKE_OPEN = re.compile(r'') +_PARAM_NAME_ATTR = re.compile(r'') _FUNCTION_CALLS_TAG = re.compile(r"") -_QUOTED_FUNCTION = re.compile(r'') -_QUOTED_PARAMETER = re.compile(r'') +_QUOTED_FUNCTION = re.compile(r"""""") +_QUOTED_PARAMETER = re.compile(r"""""") def normalize_tool_format(content: str) -> str: @@ -28,7 +28,10 @@ def normalize_tool_format(content: str) -> str: content = content.replace("", "") content = _QUOTED_FUNCTION.sub(r"", content) - return _QUOTED_PARAMETER.sub(r"", content) + content = _QUOTED_PARAMETER.sub(r"", content) + + content = re.sub(r"