Skip to content

Commit fbf1372

Browse files
committed
Fix azureChat issue with APIVersion, Endpoint and Deployment arguments
APIVersion, Endpoint and Deployment arguments did not cast char arrays to strings. Fixed that so char arrays strings are accepted as inputs of these arguments.
1 parent 4cd9047 commit fbf1372

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

azureChat.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@
103103
function this = azureChat(systemPrompt, nvp)
104104
arguments
105105
systemPrompt {llms.utils.mustBeTextOrEmpty} = []
106-
nvp.Endpoint {mustBeNonzeroLengthTextScalar}
107-
nvp.Deployment {mustBeNonzeroLengthTextScalar}
106+
nvp.Endpoint (1,1) string {mustBeNonzeroLengthTextScalar}
107+
nvp.Deployment (1,1) string {mustBeNonzeroLengthTextScalar}
108108
nvp.APIKey {mustBeNonzeroLengthTextScalar}
109109
nvp.Tools (1,:) {mustBeA(nvp.Tools, "openAIFunction")} = openAIFunction.empty
110-
nvp.APIVersion (1,1) {mustBeAPIVersion} = "2024-02-01"
110+
nvp.APIVersion (1,1) string {mustBeAPIVersion} = "2024-02-01"
111111
nvp.Temperature {llms.utils.mustBeValidTemperature} = 1
112112
nvp.TopP {llms.utils.mustBeValidTopP} = 1
113113
nvp.StopSequences {llms.utils.mustBeValidStop} = {}

tests/tazureChat.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function canUseAPIVersions(testCase, APIVersions)
157157
% azureChat.generate
158158

159159
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.");
160-
chat = azureChat("APIVersion", string(APIVersions));
160+
chat = azureChat("APIVersion", APIVersions);
161161

162162
response = testCase.verifyWarningFree(@() generate(chat,"How similar is the DNA of a cat and a tiger?"));
163163
testCase.verifyClass(response,'string');

0 commit comments

Comments
 (0)