feat(workflow,app): add MIME-based file handling and HTTP response files

This commit is contained in:
Eternity
2026-03-10 18:28:16 +08:00
committed by GitHub
parent cfd5c1bc93
commit 99e94b3567
10 changed files with 347 additions and 142 deletions

View File

@@ -45,11 +45,19 @@ class FileInput(BaseModel):
url: Optional[str] = Field(None, description="远程URLremote_url时必填")
file_type: Optional[str] = Field(None, description="具体文件格式如image/jpg、audio/wav、document/docx、video/mp4")
_content = None
def __init__(self, **data):
if "type" in data:
data['file_type'] = data['type']
super().__init__(**data)
def set_content(self, content: bytes):
self._content = content
def get_content(self) -> bytes | None:
return self._content
@field_validator("type", mode="before")
@classmethod
def validate_type(cls, v):