Skip to content

gpt-4o-mini does handle images #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion +llms/+openai/validateMessageSupported.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

% only certain models support image generation
if iscell(message.content) && any(cellfun(@(x) isfield(x,"image_url"), message.content))
if ~ismember(model,["gpt-4-turbo","gpt-4-turbo-2024-04-09","gpt-4o","gpt-4o-2024-05-13"])
if ~ismember(model,["gpt-4-turbo","gpt-4-turbo-2024-04-09",...
"gpt-4o-mini","gpt-4o-mini-2024-07-18",...
"gpt-4o","gpt-4o-2024-05-13"])
error("llms:invalidContentTypeForModel", ...
llms.utils.errorMessageCatalog.getMessage("llms:invalidContentTypeForModel", "Image content", model));
end
Expand Down
Binary file modified examples/DescribeImagesUsingChatGPT.mlx
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/topenAIChat.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function assignValueToProperty(property, value)
end

function invalidGenerateInputforModel(testCase)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to add an equivalent positive test for the default gpt-4o-mini model.

chat = openAIChat(APIKey="this-is-not-a-real-key");
chat = openAIChat(APIKey="this-is-not-a-real-key",Model="gpt-3.5-turbo");
image_path = "peppers.png";
emptyMessages = messageHistory;
inValidMessages = addUserMessageWithImages(emptyMessages,"What is in the image?",image_path);
Expand Down