anbeime/skill / skills/historical-interview-scripts/historical-interview-scripts
historical-interview-scripts
Verified自媒体创作者在策划历史名人访谈短视频时,当需要融合古今反差与网络热梗打造爆款,使用本技能可自动生成包含吸睛标题、主持人串词与爆笑问答的完整结构化脚本,轻松产出高传播力的趣味短视频文案。
scripts/tools/external_tools.py
View on GitHub#!/usr/bin/env python3
"""
外部工具封装
"""
from .base_agent import BaseAgent
from typing import Dict, List, Any, Optional
import os
class ExternalToolsManager(BaseAgent):
"""外部工具管理器"""
def __init__(self, llm_client, memory_manager):
super().__init__("external_tools_manager", llm_client, memory_manager)
def generate_image(self, prompt: str, style: str = 'cartoon', output_path: Optional[str] = None) -> str:
"""
生成图片
Args:
prompt: 提示词
style: 图片风格
output_path: 输出路径
Returns:
str: 生成图片的路径
"""
self.log(f"开始生成图片...")
# 模拟图片生成(实际使用时替换为真实API调用)
# 使用OpenAI DALL-E、Midjourney或Stable Diffusion
if output_path is None:
output_path = f"./output/images/generated_{len(os.listdir('./output/images')) if os.path.exists('./output/images') else 0}.png"
# 创建输出目录
os.makedirs(os.path.dirname(output_path), exist_ok=True)
self.log(f" - 使用风格:{style}")
self.log(f" - 输出路径:{output_path}")
# 模拟生成
self.log(f"✓ 完成:图片已生成")
return output_path
def generate_audio(self, text: str, voice_config: Dict, output_path: Optional[str] = None) -> str:
"""
生成音频
Args:
text: 文本内容
voice_config: 音色配置
output_path: 输出路径
Returns:
str: 生成音频的路径
"""
self.log(f"开始生成音频...")
# 模拟音频生成(实际使用时替换为真实API调用)
# 使用Azure TTS、Google TTS或AWS Polly
if output_path is None:
output_path = f"./output/audio/generated_{len(os.listdir('./output/audio')) if os.path.exists('./output/audio') else 0}.mp3"
# 创建输出目录
os.makedirs(os.path.dirname(output_path), exist_ok=True)
self.log(f" - 文本长度:{len(text)}字")
self.log(f" - 音色:{voice_config.get('name', 'default')}")
self.log(f" - 输出路径:{output_path}")
# 模拟生成
self.log(f"✓ 完成:音频已生成")
return output_path
def edit_video(self, storyboards: List[Dict], audio_configs: List[Dict], output_path: Optional[str] = None) -> str:
"""
剪辑视频
Args:
storyboards: 分镜列表
audio_configs: 音频配置列表
output_path: 输出路径
Returns:
str: 生成视频的路径
"""
self.log(f"开始剪辑视频...")
# 模拟视频剪辑(实际使用时替换为真实API调用)
# 使用FFmpeg或MoviePy
if output_path is None:
output_path = f"./output/videos/final_video_{len(os.listdir('./output/videos')) if os.path.exists('./output/videos') else 0}.mp4"
# 创建输出目录
os.makedirs(os.path.dirname(output_path), exist_ok=True)
# 计算总时长
total_duration = sum(sb['duration'] for sb in storyboards)
self.log(f" - 分镜数量:{len(storyboards)}")
self.log(f" - 音频数量:{len(audio_configs)}")
self.log(f" - 总时长:{total_duration}秒")
self.log(f" - 输出路径:{output_path}")
# 模拟剪辑
self.log(f"✓ 完成:视频已剪辑完成")
return output_path
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |