[GH-ISSUE #103] Issue: Error Code 422 When Sending Chat Messages Containing Images in Azure OpenAI Pipeline #55

Closed
opened 2026-10-18 21:01:59 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @Wenlin88 on GitHub (Jun 20, 2024).
Original GitHub issue: https://github.com/open-webui/pipelines/issues/103

When using the Azure OpenAI pipeline, attempting to send a chat message that contains an image results in a 422 Un processable Entity error. This issue occurs most probably because the current OpenAIChatMessage schema does not support image inputs, leading to validation failures.

Open WebUI Version
v0.3.5

Pipelines
commit df2124e

Originally created by @Wenlin88 on GitHub (Jun 20, 2024). Original GitHub issue: https://github.com/open-webui/pipelines/issues/103 When using the Azure OpenAI pipeline, attempting to send a chat message that contains an image results in a 422 Un processable Entity error. This issue occurs most probably because the current OpenAIChatMessage schema does not support image inputs, leading to validation failures. Open WebUI Version v0.3.5 Pipelines commit df2124e
Author
Owner

@justinh-rahb commented on GitHub (Jun 20, 2024):

Vision can be disabled per model in Workspace > Models:

Screenshot_20240620-052430.png

<!-- gh-comment-id:2180226063 --> @justinh-rahb commented on GitHub (Jun 20, 2024): Vision can be disabled per model in **Workspace > Models**: ![Screenshot_20240620-052430.png](https://github.com/open-webui/pipelines/assets/52832301/c923104f-bff0-41dd-88ba-3dcc015306d7)
Author
Owner

@Wenlin88 commented on GitHub (Jun 20, 2024):

My current understanding is that it is not coming from this, but more from the fact that image content is in dictionary from WebUI side.

Due that I added to schemas.py:

class ImageContent(BaseModel):
    type: str
    image_url: dict

class TextContent(BaseModel):
    type: str
    text: str

class MessageContent(RootModel):
    root: Union[TextContent, ImageContent]
<!-- gh-comment-id:2180242193 --> @Wenlin88 commented on GitHub (Jun 20, 2024): My current understanding is that it is not coming from this, but more from the fact that image content is in dictionary from WebUI side. Due that I added to schemas.py: ``` python class ImageContent(BaseModel): type: str image_url: dict class TextContent(BaseModel): type: str text: str class MessageContent(RootModel): root: Union[TextContent, ImageContent] ```
Author
Owner

@Wenlin88 commented on GitHub (Jun 23, 2024):

#104

<!-- gh-comment-id:2184487113 --> @Wenlin88 commented on GitHub (Jun 23, 2024): #104
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/pipelines#55
No description provided.