fix: Do not make function calls when request has no tools for /v1/responses (#40314)

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
Yuan Tang
2026-04-20 04:17:30 +00:00
committed by GitHub
parent 6e10cb54f6
commit 67ed01c353
+1 -1
View File
@@ -264,7 +264,7 @@ def convert_tool_responses_to_completions_format(tool: dict) -> dict:
def construct_tool_dicts(
tools: list[Tool], tool_choice: ToolChoice
) -> list[dict[str, Any]] | None:
if tools is None or (tool_choice == "none"):
if not tools or (tool_choice == "none"):
tool_dicts = None
else:
tool_dicts = [