Skip to content

ToolChoice not accepting "none" #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
toshiakit opened this issue Feb 29, 2024 · 0 comments
Closed

ToolChoice not accepting "none" #11

toshiakit opened this issue Feb 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@toshiakit
Copy link
Collaborator

Currently you cannot select "none" for ToolChoice

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
@toshiakit toshiakit self-assigned this Feb 29, 2024
@toshiakit toshiakit added the bug Something isn't working label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant