Skip to content

Commit da8e981

Browse files
committed
Fix ToolChoice bug
1 parent efa591b commit da8e981

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openAIChat.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ function mustBeValidFunctionCall(this, functionCall)
311311
if ~isempty(this.Tools)
312312
toolChoice = "auto";
313313
end
314-
elseif ToolChoice ~= "auto"
315-
% if toolChoice is not empty, then it must be in the format
314+
elseif ~ismember(ToolChoice,["auto","none"])
315+
% if toolChoice is not empty, then it must be "auto", "none" or in the format
316316
% {"type": "function", "function": {"name": "my_function"}}
317317
toolChoice = struct("type","function","function",struct("name",toolChoice));
318318
end

0 commit comments

Comments
 (0)