diff --git a/schemas.py b/schemas.py index 57517dfd..caa0342a 100644 --- a/schemas.py +++ b/schemas.py @@ -1,23 +1,13 @@ -from typing import List, Union, Optional -from pydantic import BaseModel, RootModel, ConfigDict - -class ImageContent(BaseModel): - type: str - image_url: dict - -class TextContent(BaseModel): - type: str - text: str - -class MessageContent(RootModel): - root: Union[TextContent, ImageContent] +from typing import List, Optional +from pydantic import BaseModel, ConfigDict class OpenAIChatMessage(BaseModel): role: str - content: Union[str, List[MessageContent]] + content: str | List model_config = ConfigDict(extra="allow") + class OpenAIChatCompletionForm(BaseModel): stream: bool = True model: str @@ -25,6 +15,7 @@ class OpenAIChatCompletionForm(BaseModel): model_config = ConfigDict(extra="allow") + class FilterForm(BaseModel): body: dict user: Optional[dict] = None