chore: enhance log for LLM

This commit is contained in:
Richard Tang
2026-04-06 13:30:31 -07:00
parent cd9a625041
commit df41732e95
+5 -1
View File
@@ -1987,9 +1987,13 @@ class LiteLLMProvider(LLMProvider):
if accumulated_text and "<tool_code>" in accumulated_text:
extracted, cleaned = _extract_text_tool_calls(accumulated_text)
if extracted:
tool_names = [tc.tool_name for tc in extracted]
logger.info(
"[stream] extracted %d hallucinated tool call(s) from text",
"[stream] Model emitted %d tool call(s) as <tool_code> text "
"instead of structured function calls; converting to "
"synthetic ToolCallEvents: %s",
len(extracted),
tool_names,
)
accumulated_text = cleaned
# Emit a corrected TextDeltaEvent so the caller's