Skip to content

Commit d9c7b37

Browse files
committed
gpt-4o-mini does handle images
Permit sending images to gpt-4o-mini. Also, change `DescribeImagesUsingChatGPT` example to use the default model (now gpt-4o-mini), and while we are editing it anyway, remove the `addpath` and `loadenv` lines and use the newer `wrapText` utility function.
1 parent fc1798c commit d9c7b37

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

+llms/+openai/validateMessageSupported.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
% only certain models support image generation
77
if iscell(message.content) && any(cellfun(@(x) isfield(x,"image_url"), message.content))
8-
if ~ismember(model,["gpt-4-turbo","gpt-4-turbo-2024-04-09","gpt-4o","gpt-4o-2024-05-13"])
8+
if ~ismember(model,["gpt-4-turbo","gpt-4-turbo-2024-04-09",...
9+
"gpt-4o-mini","gpt-4o-mini-2024-07-18",...
10+
"gpt-4o","gpt-4o-2024-05-13"])
911
error("llms:invalidContentTypeForModel", ...
1012
llms.utils.errorMessageCatalog.getMessage("llms:invalidContentTypeForModel", "Image content", model));
1113
end
-841 KB
Binary file not shown.

tests/topenAIChat.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function assignValueToProperty(property, value)
190190
end
191191

192192
function invalidGenerateInputforModel(testCase)
193-
chat = openAIChat(APIKey="this-is-not-a-real-key");
193+
chat = openAIChat(APIKey="this-is-not-a-real-key",Model="gpt-3.5-turbo");
194194
image_path = "peppers.png";
195195
emptyMessages = messageHistory;
196196
inValidMessages = addUserMessageWithImages(emptyMessages,"What is in the image?",image_path);

0 commit comments

Comments
 (0)