diff --git a/openAIChat.m b/openAIChat.m index 54db2a0..55c19a5 100644 --- a/openAIChat.m +++ b/openAIChat.m @@ -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