feat: 添加专栏文章处理支持

- kb_workflow.py: 添加内容类型判断函数
  - is_video_content(): 判断视频内容
  - is_text_content(): 判断文字内容(专栏/问答)
  - is_image_content(): 判断图片内容
  - get_content_handler(): 获取处理方式

- SKILL.md: 完善条件分支逻辑
  - 添加内容类型判断表格
  - 添加专栏文章处理流程说明
  - 添加专栏文章的步骤4.2处理指南
  - 更新子技能清单,添加专栏文章命令
This commit is contained in:
2026-02-16 21:07:26 +08:00
parent 3dc8d246d0
commit 09618f52c5
2 changed files with 116 additions and 0 deletions
+47
View File
@@ -33,6 +33,53 @@ CONTENT_AGENTS = {
}
# ==================== 内容类型判断 ====================
# 需要下载视频/字幕的内容类型
VIDEO_CONTENT_TYPES = {"video"}
# 需要提取文字的内容类型
TEXT_CONTENT_TYPES = {"article", "zhuanlan", "question", "answer"}
# 需要下载图片的内容类型
IMAGE_CONTENT_TYPES = {"note"}
def is_video_content(content_type: str) -> bool:
"""判断是否为视频内容类型"""
return content_type in VIDEO_CONTENT_TYPES
def is_text_content(content_type: str) -> bool:
"""判断是否为文字内容类型(专栏、文章、问答等)"""
return content_type in TEXT_CONTENT_TYPES
def is_image_content(content_type: str) -> bool:
"""判断是否为图片内容类型(小红书等)"""
return content_type in IMAGE_CONTENT_TYPES
def get_content_handler(content_type: str) -> str:
"""
获取内容处理方式
Returns:
"video" - 需要下载视频/字幕
"text" - 需要提取文字
"image" - 需要下载图片
"unknown" - 未知类型
"""
if is_video_content(content_type):
return "video"
elif is_text_content(content_type):
return "text"
elif is_image_content(content_type):
return "image"
else:
return "unknown"
# ==================== 工具函数 ====================
def extract_platform(filename: str) -> str: