feat(05-02): add ArchiveInput and ArchiveOutput schemas
- Add ArchiveInput with content_dir, analysis_file, content_type fields - Add ArchiveOutput with archive_file, skipped, platform fields - Update PipelineConfig default steps to include archive step
This commit is contained in:
+37
-2
@@ -397,15 +397,50 @@ class PipelineConfig(BaseModel):
|
|||||||
"""Pipeline configuration
|
"""Pipeline configuration
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
steps: Steps to execute in order (default: parse, download, asr, analyze)
|
steps: Steps to execute in order (default: parse, download, asr, analyze, archive)
|
||||||
output_dir: Base output directory
|
output_dir: Base output directory
|
||||||
skip_completed: Skip completed steps (default True)
|
skip_completed: Skip completed steps (default True)
|
||||||
max_retries: Max retries per step (default 3)
|
max_retries: Max retries per step (default 3)
|
||||||
"""
|
"""
|
||||||
steps: List[str] = Field(
|
steps: List[str] = Field(
|
||||||
default_factory=lambda: ["parse", "download", "asr", "analyze"],
|
default_factory=lambda: ["parse", "download", "asr", "analyze", "archive"],
|
||||||
description="Steps to execute in order"
|
description="Steps to execute in order"
|
||||||
)
|
)
|
||||||
output_dir: Optional[Path] = Field(None, description="Base output directory")
|
output_dir: Optional[Path] = Field(None, description="Base output directory")
|
||||||
skip_completed: bool = Field(default=True, description="Skip completed steps")
|
skip_completed: bool = Field(default=True, description="Skip completed steps")
|
||||||
max_retries: int = Field(default=3, description="Max retries per step")
|
max_retries: int = Field(default=3, description="Max retries per step")
|
||||||
|
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Archive Schemas (Phase 5)
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
class ArchiveInput(StepInput):
|
||||||
|
"""Archive 步骤输入
|
||||||
|
|
||||||
|
继承 StepInput 的基础字段,添加归档特定字段。
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
content_dir: 内容目录路径(中间目录)
|
||||||
|
analysis_file: 分析报告 md 文件路径
|
||||||
|
content_type: 内容类型
|
||||||
|
"""
|
||||||
|
content_dir: str = Field(..., min_length=1, description="Content directory path (intermediate)")
|
||||||
|
analysis_file: str = Field(..., min_length=1, description="Path to analysis Markdown file")
|
||||||
|
content_type: str = Field(..., min_length=1, description="Content type (video, article, etc.)")
|
||||||
|
|
||||||
|
|
||||||
|
class ArchiveOutput(StepOutput):
|
||||||
|
"""Archive 步骤输出
|
||||||
|
|
||||||
|
继承 StepOutput 的基础字段,添加归档特定字段。
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
archive_file: 归档后的文件路径
|
||||||
|
skipped: 是否跳过(已有相同文件)
|
||||||
|
platform: 平台名称
|
||||||
|
"""
|
||||||
|
archive_file: str = Field(default="", description="Path to archived file")
|
||||||
|
skipped: bool = Field(default=False, description="Whether archiving was skipped")
|
||||||
|
platform: str = Field(default="", description="Platform name")
|
||||||
|
|||||||
Reference in New Issue
Block a user