Skip to content

Commit

Permalink
Fix ToolChoice bug
Browse files Browse the repository at this point in the history
  • Loading branch information
toshiakit committed Feb 29, 2024
1 parent efa591b commit da8e981
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openAIChat.m
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ function mustBeValidFunctionCall(this, functionCall)
if ~isempty(this.Tools)
toolChoice = "auto";
end
elseif ToolChoice ~= "auto"
% if toolChoice is not empty, then it must be in the format
elseif ~ismember(ToolChoice,["auto","none"])
% if toolChoice is not empty, then it must be "auto", "none" or in the format
% {"type": "function", "function": {"name": "my_function"}}
toolChoice = struct("type","function","function",struct("name",toolChoice));
end
Expand Down

0 comments on commit da8e981

Please sign in to comment.