diff --git a/vllm/tool_parsers/hermes_tool_parser.py b/vllm/tool_parsers/hermes_tool_parser.py index 992590525..37fa6bd66 100644 --- a/vllm/tool_parsers/hermes_tool_parser.py +++ b/vllm/tool_parsers/hermes_tool_parser.py @@ -329,11 +329,12 @@ class Hermes2ProToolParser(ToolParser): logger.debug("unable to parse JSON") return None + if current_tool_call is None: + return None + # case - we haven't sent the tool name yet. If it's available, send # it. otherwise, wait until it's available. if not self.current_tool_name_sent: - if current_tool_call is None: - return None function_name: str | None = current_tool_call.get("name") if function_name: self.current_tool_name_sent = True