Skip to content

Commit 393ceb1

Browse files
committed
fixing header dimension.
1 parent 9e68b2d commit 393ceb1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

+llms/+internal/sendRequest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
% Define the headers for the API request
1010

11-
headers = [matlab.net.http.HeaderField('Content-Type', 'application/json');
11+
headers = [matlab.net.http.HeaderField('Content-Type', 'application/json')...
1212
matlab.net.http.HeaderField('Authorization', "Bearer " + token)];
1313
% Define the request message
1414
request = matlab.net.http.RequestMessage('post',headers,parameters);

tests/topenAIChat.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ function generateAcceptsSingleStringAsInput(testCase)
2828
testCase.verifyWarningFree(@()generate(chat,"This is okay"));
2929
end
3030

31+
function generateAcceptsMessagesAsInput(testCase)
32+
chat = openAIChat(ApiKey="this-is-not-a-real-key");
33+
messages = openAIMessages;
34+
messages = addUserMessage(messages, "This should be okay.");
35+
testCase.verifyWarningFree(@()generate(chat,messages));
36+
end
37+
3138
function keyNotFound(testCase)
3239
testCase.verifyError(@()openAIChat, "llms:keyMustBeSpecified");
3340
end

0 commit comments

Comments
 (0)