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:
@@ -264,7 +264,7 @@ def convert_tool_responses_to_completions_format(tool: dict) -> dict:
|
|||||||
def construct_tool_dicts(
|
def construct_tool_dicts(
|
||||||
tools: list[Tool], tool_choice: ToolChoice
|
tools: list[Tool], tool_choice: ToolChoice
|
||||||
) -> list[dict[str, Any]] | None:
|
) -> list[dict[str, Any]] | None:
|
||||||
if tools is None or (tool_choice == "none"):
|
if not tools or (tool_choice == "none"):
|
||||||
tool_dicts = None
|
tool_dicts = None
|
||||||
else:
|
else:
|
||||||
tool_dicts = [
|
tool_dicts = [
|
||||||
|
|||||||
Reference in New Issue
Block a user