Unverified Commit 67ed01c3 authored by Yuan Tang's avatar Yuan Tang Committed by GitHub
Browse files

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


Signed-off-by: default avatarYuan Tang <terrytangyuan@gmail.com>
parent 6e10cb54
......@@ -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 = [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment