Skip to content

Fix OpenAI model definitions by restricting to gpt-4o models for multimodal support#18

Merged
felixarntz merged 3 commits intofelixarntz:mainfrom
mslinnea:openai-models-image-input
Nov 18, 2024
Merged

Fix OpenAI model definitions by restricting to gpt-4o models for multimodal support#18
felixarntz merged 3 commits intofelixarntz:mainfrom
mslinnea:openai-models-image-input

Conversation

@mslinnea
Copy link
Copy Markdown
Contributor

I encountered an issue with the current model selection for the OpenAI service. It defaults to gpt-4-turbo-preview as the preferred multimodal model, but this model fails to generate image alt text, returning the error:

“Invalid content type. image_url is only supported by certain models.”

This error persists even though a valid base64-encoded image is sent in the request.

To resolve this, I’ve updated the model selection to use only gpt-4o models, which are compatible and successfully handle the image input for generating alt text.

I also excluded realtime and audio models. Realtime models are incompatiable with the v1/chat/completions endpoint (they require v1/completions endpoint). Audio models don't accept image inputs.

Let me know if this fits or if you need any more tweaks!

@felixarntz felixarntz added the bug Something isn't working label Nov 18, 2024
Copy link
Copy Markdown
Owner

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @mslinnea, this is a great catch!

Comment thread includes/OpenAI/OpenAI_AI_Service.php Outdated
@felixarntz felixarntz changed the title Fix OpenAI Model Support: Restrict to Compatible gpt-4o Variants for Alt Text Fix OpenAI model definitions by restricting to gpt-4o models for multimodal support Nov 18, 2024
Comment thread includes/OpenAI/OpenAI_AI_Service.php Outdated
@felixarntz felixarntz merged commit 75f5d24 into felixarntz:main Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants