Fix hallucination check

This commit is contained in:
Shuguang Chen 2025-03-28 16:30:03 -07:00
parent 425f9b0dd5
commit f035d166c8
2 changed files with 2 additions and 2 deletions

View file

@ -417,7 +417,7 @@ class ArchFunctionHandler(ArchBaseHandler):
has_tool_calls, has_hallucination = None, False
for _ in self.hallucination_state:
# check if the first token is <tool_call>
if len(self.hallucination_state.tokens) > 2 and has_tool_calls is None:
if len(self.hallucination_state.tokens) > 5 and has_tool_calls is None:
content = "".join(self.hallucination_state.tokens)
if "tool_calls" in content:
has_tool_calls = True