diff --git a/vllm/entrypoints/openai/serving_chat.py b/vllm/entrypoints/openai/serving_chat.py index d07cfeaf72cb0..a8849aec8ad37 100644 --- a/vllm/entrypoints/openai/serving_chat.py +++ b/vllm/entrypoints/openai/serving_chat.py @@ -496,7 +496,11 @@ async def chat_completion_stream_generator( if self._should_check_for_unstreamed_tool_arg_tokens( delta_message, output) and tool_parser: latest_delta_len = 0 - if (isinstance(delta_message,DeltaMessage)): + if ((isinstance( + delta_message.tool_calls[0].function, + DeltaFunctionCall)) and isinstance( + delta_message.tool_calls[0].function. + arguments, str)): latest_delta_len = len( delta_message.tool_calls[0].function. arguments)