Skip to content

Commit 6736937

Browse files
committed
Add a test case for ToolChoice="none"
1 parent 5505b32 commit 6736937

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/topenAIChat.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ function errorsWhenPassingToolChoiceWithEmptyTools(testCase)
7777
testCase.verifyError(@()generate(chat,"input", ToolChoice="bla"), "llms:mustSetFunctionsForCall");
7878
end
7979

80+
function errorsWhenPassingToolChoiceWithNone(testCase)
81+
functions = openAIFunction("funName");
82+
chat = openAIChat(ApiKey="this-is-not-a-real-key",Tools=functions);
83+
testCase.verifyWarningFree(@()generate(chat,"This is okay","ToolChoice","none"));
84+
end
85+
8086
function invalidInputsConstructor(testCase, InvalidConstructorInput)
8187
testCase.verifyError(@()openAIChat(InvalidConstructorInput.Input{:}), InvalidConstructorInput.Error);
8288
end

0 commit comments

Comments
 (0)