diff --git a/strix/llm/llm.py b/strix/llm/llm.py index 4f624956..c27ac042 100644 --- a/strix/llm/llm.py +++ b/strix/llm/llm.py @@ -202,6 +202,13 @@ class LLM: accumulated = normalize_tool_format(accumulated) accumulated = fix_incomplete_tool_call(_truncate_to_first_function(accumulated)) + + thinking_content = "" + for match in re.finditer(r"]*>(.*?)", accumulated, re.DOTALL): + thinking_content += match.group(1) + "\n" + if thinking_content: + accumulated = accumulated.replace(thinking_content, "") + yield LLMResponse( content=accumulated, tool_invocations=parse_tool_invocations(accumulated), diff --git a/strix/llm/utils.py b/strix/llm/utils.py index 9771854f..314eee22 100644 --- a/strix/llm/utils.py +++ b/strix/llm/utils.py @@ -20,7 +20,7 @@ def normalize_tool_format(content: str) -> str: """ - if "", content) content = _PARAM_NAME_ATTR.sub(r"", content)