From bd5cd5eea9b4d8b9f47d530e57b5da27fd179c72 Mon Sep 17 00:00:00 2001 From: Ada Date: Wed, 4 Feb 2026 17:15:00 -0800 Subject: [PATCH] fix(ai): allow multimodal message content to fix image upload 422 - AIMessage.content: Union[str, List[dict]] for text-only and multimodal (e.g. image_url) - Image requests with content array now pass validation and are forwarded to AI --- app/schemas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/schemas.py b/app/schemas.py index a1c6c19..57cbde2 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -1,5 +1,5 @@ from pydantic import BaseModel, ConfigDict -from typing import List, Optional +from typing import List, Optional, Union from datetime import datetime # Heir Schemas @@ -80,10 +80,10 @@ class AssetDelete(BaseModel): class DeclareGuale(BaseModel): username: str -# AI Proxy Schemas +# AI Proxy Schemas (content: str for text-only, list for multimodal e.g. image_url) class AIMessage(BaseModel): role: str - content: str + content: Union[str, List[dict]] class AIRequest(BaseModel): messages: List[AIMessage]