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 @@ -682,7 +682,7 @@ def check_tool_usage(cls, data):
682
682
return data
683
683
684
684
# if "tool_choice" is specified -- validation
685
- if "tool_choice" in data :
685
+ if "tool_choice" in data and data [ "tool_choice" ] is not None :
686
686
687
687
# ensure that if "tool choice" is specified, tools are present
688
688
if "tools" not in data or data ["tools" ] is None :
@@ -694,7 +694,7 @@ def check_tool_usage(cls, data):
694
694
if data ["tool_choice" ] not in [
695
695
"auto" , "required"
696
696
] and not isinstance (data ["tool_choice" ], dict ):
697
- raise NotImplementedError (
697
+ raise ValueError (
698
698
f'Invalid value for `tool_choice`: { data ["tool_choice" ]} ! ' \
699
699
'Only named tools, "none", "auto" or "required" ' \
700
700
'are supported.'
You can’t perform that action at this time.
0 commit comments