function toolChoice = convertToolChoice(this, toolChoice)
% if toolChoice is empty
if isempty(toolChoice)
% if Tools is not empty, the default is 'auto'.
if ~isempty(this.Tools)
toolChoice = "auto";
end
elseif ToolChoice ~= "auto"
% if toolChoice is not empty, then it must be in the format
% {"type": "function", "function": {"name": "my_function"}}
toolChoice = struct("type","function","function",struct("name",toolChoice));
end
end
We should fix this
function toolChoice = convertToolChoice(this, toolChoice)
% if toolChoice is empty
if isempty(toolChoice)
% if Tools is not empty, the default is 'auto'.
if ~isempty(this.Tools)
toolChoice = "auto";
end
elseif ~ismember(ToolChoice,["auto","none"])
% if toolChoice is not empty, then it must be "none" or in the format
% {"type": "function", "function": {"name": "my_function"}}
toolChoice = struct("type","function","function",struct("name",toolChoice));
end
end
Currently you cannot select "none" for ToolChoice
We should fix this