Skip to content

Commit a7f7634

Browse files
committed
Add test for azureChat.generate for the case when azureChat is called with a system prompt defined
1 parent 5882528 commit a7f7634

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/tazureChat.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ function doGenerate(testCase,StringInputs)
4141
testCase.verifyGreaterThan(strlength(response),0);
4242
end
4343

44+
function doGenerateUsingSystemPrompt(testCase)
45+
testCase.assumeTrue(isenv("AZURE_OPENAI_API_KEY"),"end-to-end test requires environment variables AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, and AZURE_OPENAI_DEPLOYMENT.");
46+
chat = azureChat("You are a helpful assistant");
47+
response = testCase.verifyWarningFree(@() generate(chat,"Hi"));
48+
testCase.verifyClass(response,'string');
49+
testCase.verifyGreaterThan(strlength(response),0);
50+
end
51+
4452
function generateMultipleResponses(testCase)
4553
chat = azureChat;
4654
[~,~,response] = generate(chat,"What is a cat?",NumCompletions=3);

0 commit comments

Comments
 (0)