mirror of
https://github.com/open-webui/pipelines
synced 2025-05-10 07:30:47 +00:00
24 lines
490 B
Python
24 lines
490 B
Python
from typing import List, Optional
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class OpenAIChatMessage(BaseModel):
|
|
role: str
|
|
content: str | List
|
|
|
|
model_config = ConfigDict(extra="allow")
|
|
|
|
|
|
class OpenAIChatCompletionForm(BaseModel):
|
|
stream: bool = True
|
|
model: str
|
|
messages: List[OpenAIChatMessage]
|
|
|
|
model_config = ConfigDict(extra="allow")
|
|
|
|
|
|
class FilterForm(BaseModel):
|
|
body: dict
|
|
user: Optional[dict] = None
|
|
model_config = ConfigDict(extra="allow")
|