Skip to content

Commit 29cf265

Browse files
committed
add positive test for images with gpt-4o-mini (default model)
1 parent d9c7b37 commit 29cf265

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/topenAIChat.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,16 @@ function generateWithToolsAndStreamFunc(testCase)
173173
testCase.verifyThat(data,HasField("explanation"));
174174
end
175175

176+
function generateWithImages(testCase)
177+
chat = openAIChat;
178+
image_path = "peppers.png";
179+
emptyMessages = messageHistory;
180+
messages = addUserMessageWithImages(emptyMessages,"What is in the image?",image_path);
181+
182+
text = generate(chat,messages);
183+
testCase.verifyThat(text,matlab.unittest.constraints.ContainsSubstring("pepper"));
184+
end
185+
176186
function invalidInputsGenerate(testCase, InvalidGenerateInput)
177187
f = openAIFunction("validfunction");
178188
chat = openAIChat(Tools=f, APIKey="this-is-not-a-real-key");
@@ -189,7 +199,7 @@ function assignValueToProperty(property, value)
189199
testCase.verifyError(@()assignValueToProperty(InvalidValuesSetters.Property,InvalidValuesSetters.Value), InvalidValuesSetters.Error);
190200
end
191201

192-
function invalidGenerateInputforModel(testCase)
202+
function gpt35TurboErrorsForImages(testCase)
193203
chat = openAIChat(APIKey="this-is-not-a-real-key",Model="gpt-3.5-turbo");
194204
image_path = "peppers.png";
195205
emptyMessages = messageHistory;

0 commit comments

Comments
 (0)