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):
841841 return data
842842
843843 # 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 :
845845
846846 # ensure that if "tool choice" is specified, tools are present
847847 if "tools" not in data or data ["tools" ] is None :
@@ -853,7 +853,7 @@ def check_tool_usage(cls, data):
853853 if data ["tool_choice" ] not in [
854854 "auto" , "required"
855855 ] and not isinstance (data ["tool_choice" ], dict ):
856- raise NotImplementedError (
856+ raise ValueError (
857857 f'Invalid value for `tool_choice`: { data ["tool_choice" ]} ! ' \
858858 'Only named tools, "none", "auto" or "required" ' \
859859 'are supported.'
You can’t perform that action at this time.
0 commit comments