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
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user