File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -841,7 +841,7 @@ def check_tool_usage(cls, data):
841
841
return data
842
842
843
843
# if "tool_choice" is specified -- validation
844
- if "tool_choice" in data :
844
+ if "tool_choice" in data and data [ "tool_choice" ] is not None :
845
845
846
846
# ensure that if "tool choice" is specified, tools are present
847
847
if "tools" not in data or data ["tools" ] is None :
@@ -853,7 +853,7 @@ def check_tool_usage(cls, data):
853
853
if data ["tool_choice" ] not in [
854
854
"auto" , "required"
855
855
] and not isinstance (data ["tool_choice" ], dict ):
856
- raise NotImplementedError (
856
+ raise ValueError (
857
857
f'Invalid value for `tool_choice`: { data ["tool_choice" ]} ! ' \
858
858
'Only named tools, "none", "auto" or "required" ' \
859
859
'are supported.'
You can’t perform that action at this time.
0 commit comments