feat(04-02): add DownloadInput and DownloadOutput schemas

TDD GREEN phase:
- DownloadInput extends StepInput with content_dir and content_type
- DownloadOutput extends StepOutput with metadata_file, content_file, title, author, duration
- Supports video, article, answer, zhuanlan content types
- All schema validation tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 23:18:29 +08:00
parent 9d5c3ffc48
commit 1e012366e1
+37
View File
@@ -273,3 +273,40 @@ class ParseOutput(StepOutput):
content_id: str = Field(..., description="Extracted content ID")
resolved_url: str = Field(..., description="Resolved URL after short link expansion")
original_url: str = Field(..., description="Original URL provided by user")
# =============================================================================
# Download Schemas (Phase 04)
# =============================================================================
class DownloadInput(StepInput):
"""Download 步骤输入
继承 StepInput 的基础字段,添加下载特定字段。
Attributes:
content_dir: 保存下载内容的目录路径
content_type: 内容类型 (video, article, answer, zhuanlan)
"""
content_dir: str = Field(..., min_length=1, description="Directory to save downloaded content")
content_type: str = Field(..., min_length=1, description="Content type (video, article, answer, zhuanlan)")
class DownloadOutput(StepOutput):
"""Download 步骤输出
继承 StepOutput 的基础字段,添加下载特定字段。
Attributes:
metadata_file: 元数据 JSON 文件路径
content_file: 内容文件路径 (视频/音频或文本)
title: 内容标题
author: 内容作者
duration: 视频内容的时长(秒),仅视频有值
"""
metadata_file: str = Field(..., description="Path to metadata JSON file")
content_file: str = Field(..., description="Path to content file (video/audio or text)")
title: str = Field(..., description="Content title")
author: str = Field(..., description="Content author")
duration: Optional[int] = Field(None, description="Duration for video content in seconds")