Issue: Error Code 422 When Sending Chat Messages Containing Images in Azure OpenAI Pipeline #57

Closed
opened 2026-02-15 19:15:15 -05:00 by yindo · 3 comments
Owner

Originally created by @Wenlin88 on GitHub (Jun 20, 2024).

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). 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
yindo closed this issue 2026-02-15 19:15:15 -05:00
Author
Owner

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

Vision can be disabled per model in Workspace > Models:

Screenshot_20240620-052430.png

@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]
@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 22, 2024):

#104

@Wenlin88 commented on GitHub (Jun 22, 2024): #104
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui/pipelines#57