diff --git a/model_server/src/core/function_calling.py b/model_server/src/core/function_calling.py index 6b3bc6d6..23eb441b 100644 --- a/model_server/src/core/function_calling.py +++ b/model_server/src/core/function_calling.py @@ -495,8 +495,7 @@ class ArchFunctionHandler(ArchBaseHandler): model_response = prefill_response.choices[0].message.content break - # start parameter gathering if the model is not generating tool calls - if self.hallu_handler.hallucination == False: + if has_tool_call and self.hallu_handler.hallucination == False: model_response = "".join(self.hallu_handler.tokens) # start parameter gathering if the model is not generating tool calls