fix validation: Only set tool_choice auto if at least one tool is provided (#8568)
This commit is contained in:
@@ -386,7 +386,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
|
||||
|
||||
# if "tool_choice" is not specified but tools are provided,
|
||||
# default to "auto" tool_choice
|
||||
if "tool_choice" not in data and "tools" in data:
|
||||
if "tool_choice" not in data and data.get("tools"):
|
||||
data["tool_choice"] = "auto"
|
||||
|
||||
# if "tool_choice" is specified -- validation
|
||||
|
||||
Reference in New Issue
Block a user