From b9dcf7f63d683a379812ab5911316f36764f0df0 Mon Sep 17 00:00:00 2001 From: 0xallam Date: Fri, 20 Feb 2026 08:08:59 -0800 Subject: [PATCH] fix: Address code review feedback on tool format normalization --- strix/llm/llm.py | 8 +++----- strix/llm/utils.py | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/strix/llm/llm.py b/strix/llm/llm.py index 507e8c8..d941361 100644 --- a/strix/llm/llm.py +++ b/strix/llm/llm.py @@ -145,11 +145,9 @@ class LLM: if delta: accumulated += delta if "" in accumulated or "" in accumulated: - for end_tag in ("", ""): - pos = accumulated.find(end_tag) - if pos != -1: - accumulated = accumulated[: pos + len(end_tag)] - break + end_tag = "" if "" in accumulated else "" + pos = accumulated.find(end_tag) + accumulated = accumulated[: pos + len(end_tag)] yield LLMResponse(content=accumulated) done_streaming = 1 continue diff --git a/strix/llm/utils.py b/strix/llm/utils.py index b866661..1ba6a5f 100644 --- a/strix/llm/utils.py +++ b/strix/llm/utils.py @@ -3,8 +3,8 @@ 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"""""")