vllm.entrypoints.serve.utils.tool_calls_utils
¶
Functions:
-
maybe_filter_parallel_tool_calls–Filter to first tool call only when parallel_tool_calls is explicitly False.
-
resolve_finish_reason–Map the engine finish reason to the OpenAI chat
finish_reason.
maybe_filter_parallel_tool_calls(item, request)
¶
Filter to first tool call only when parallel_tool_calls is explicitly False.
Source code in vllm/entrypoints/serve/utils/tool_calls_utils.py
resolve_finish_reason(engine_finish_reason, request, tool_calls_made)
¶
Map the engine finish reason to the OpenAI chat finish_reason.
tool_calls is reported only when the choice actually carries tool
calls, the engine stopped on its own (a length cut stays visible so
clients can tell a truncated call from a complete one) and the caller did
not force a single named tool, for which OpenAI reports stop.