🎨 OpenClaw Multi-Modal Skills

多模态Skills——让Agent不只是"嘴炮",还能"看、听、读"

功能介绍

世界上有一种Agent,它只会打字聊天。然后有一种Agent,它能看懂你发的截图、听懂你录的语音、读完你的PDF——这就是多模态Agent。

OpenClaw的Multi-Modal Skills让Agent突破了纯文本的边界。图片理解、音频转录、视频分析、文档解析,一个Skill全部搞定。就像给AI装上了"眼睛、耳朵和阅读器"。

💡 支持的模态:图片(JPG/PNG/WebP)、音频(MP3/WAV)、视频(MP4)、文档(PDF/DOCX/PPTX/XLSX)、网页(HTML)。

图片理解Skills

图片分析

# SKILLS/image_analyzer.md
name: image_analyzer
description: 分析图片内容、提取文字、识别物体

inputs:
  - name: image
    type: image
    formats: [jpg, png, webp, gif]
    max_size: 20MB
    
capabilities:
  - object_detection   # 物体检测
  - ocr               # 文字识别
  - scene_understanding  # 场景理解
  - chart_reading     # 图表数据提取
  
output:
  type: structured
  fields:
    - description: string
    - objects: array
    - text_content: string  # OCR结果
    - metadata: object

使用示例

# 用户发送截图让Agent分析
User: "帮我分析这张架构图,列出所有组件和依赖关系"

Agent: 
  [调用 image_analyzer]
  → 检测到6个组件: API Gateway, Auth Service, User Service...
  → 识别到依赖关系: Gateway → Auth → User
  → 提取到3处标注文字
  
  分析结果:
  1. 架构模式: 微服务 + API Gateway
  2. 核心组件: 6个
  3. 潜在问题: Auth Service是单点故障风险

文档解析Skills

多格式文档处理

# SKILLS/document_parser.md
name: document_parser
description: 解析各种文档格式,提取结构化内容

inputs:
  - name: document
    type: file
    formats: [pdf, docx, pptx, xlsx, epub]
    max_size: 50MB
    
capabilities:
  - text_extraction    # 文本提取
  - table_extraction   # 表格提取
  - image_extraction   # 图片提取
  - metadata_extraction  # 元数据提取
  - structure_analysis  # 结构分析
  
advanced:
  pdf:
    ocr_fallback: true  # 扫描件自动OCR
    layout_analysis: true  # 版面分析
  xlsx:
    sheet_range: "all"
    include_formulas: true

实战:解析PDF报告

# 用户上传PDF让Agent总结
User: [上传 quarterly_report.pdf] "总结这份季度报告"

Agent:
  [调用 document_parser]
  → 提取到: 28页, 12个图表, 3个表格
  → 结构: Executive Summary → Revenue → Products → Outlook
  
  📊 季度报告摘要:
  
  📈 营收: $42.3M (同比+23%)
  👥 用户: 1.2M (环比+15%)
  💰 利润率: 18.5% (同比+2.1pp)
  🚀 亮点: AI产品线增长87%
  ⚠️ 风险: 宏观经济不确定性

音频转录Skills

# SKILLS/audio_transcriber.md
name: audio_transcriber
description: 音频转录、翻译、摘要

inputs:
  - name: audio
    type: audio
    formats: [mp3, wav, m4a, ogg, flac]
    max_size: 100MB
    max_duration: 3600  # 最长1小时
    
capabilities:
  - transcription       # 转录
  - translation         # 翻译
  - speaker_diarization # 说话人分离
  - sentiment_analysis  # 情感分析
  - summarization       # 摘要

output:
  format: markdown
  include_timestamps: true
  include_speakers: true

视频分析Skills

# SKILLS/video_analyzer.md
name: video_analyzer
description: 视频内容理解、关键帧提取、场景分割

inputs:
  - name: video
    type: video
    formats: [mp4, webm, mov]
    max_size: 500MB
    max_duration: 600  # 最长10分钟

pipeline:
  - step: extract_keyframes
    interval: 5s  # 每5秒提取一帧
    
  - step: analyze_frames
    model: gpt-4o  # 多模态模型分析每帧
    
  - step: transcribe_audio
    if_has_audio: true
    
  - step: generate_summary
    combine: [frames_analysis, audio_transcript]

output:
  type: structured
  fields:
    - summary: string
    - scenes: array
    - key_moments: array
    - transcript: string

多模态组合使用

# 组合多种模态的Skill
name: content_creator
description: 多模态内容创作工具

workflow:
  - step: analyze_image
    input: user_uploaded_image
    output: image_description, style_tags
    
  - step: generate_text
    input: image_description, user_prompt
    model: gpt-4o
    output: article_draft
    
  - step: create_audio
    input: article_draft
    output: narration_audio
    
  - step: generate_video
    inputs: [original_image, narration_audio]
    output: short_video

# 用户只需要一句话:
# "把这张产品图做成短视频"
# Agent自动完成: 图片分析 → 文案生成 → 配音 → 视频合成

最佳实践

⚠️ 踩坑实录:用户上传了200MB的PDF,Agent直接OOM了。教训:永远在Skill入口处校验文件大小,超大文件要提前拒绝或分片处理。

相关链接

#多模态 #图片理解 #音频转录 #文档解析 #OpenClaw