Skip to content

Commit

Permalink
Add a test case for ToolChoice="none"
Browse files Browse the repository at this point in the history
  • Loading branch information
toshiakit committed Mar 1, 2024
1 parent 5505b32 commit 6736937
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/topenAIChat.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ function errorsWhenPassingToolChoiceWithEmptyTools(testCase)
testCase.verifyError(@()generate(chat,"input", ToolChoice="bla"), "llms:mustSetFunctionsForCall");
end

function errorsWhenPassingToolChoiceWithNone(testCase)
functions = openAIFunction("funName");
chat = openAIChat(ApiKey="this-is-not-a-real-key",Tools=functions);
testCase.verifyWarningFree(@()generate(chat,"This is okay","ToolChoice","none"));
end

function invalidInputsConstructor(testCase, InvalidConstructorInput)
testCase.verifyError(@()openAIChat(InvalidConstructorInput.Input{:}), InvalidConstructorInput.Error);
end
Expand Down

0 comments on commit 6736937

Please sign in to comment.