Provide a reusable Python skill for AI agents to:
title: presentation title.slides: array of slide objects:title: slide title.content: string or list of paragraphs.image_prompt (optional): prompt for image generation.ppt_path: source .pptx path.replace_rules:text_replace: dictionary for text replacement.image_replace: dictionary for image replacement strategy..pptx file path.new_ppt_path: new .pptx output path.replace_log: replacement details grouped by slide.main.py: external API for agent calls and demo entry.ppt_generator.py: PPT creation.ppt_editor.py: PPT text/image replacement.image_service.py: image generation abstraction (mock + extension points).utils.py: logging and path helpers.from ppt_skill.main import create_ppt, update_ppt
slides = [
{
"title": "Brazil Overview",
"content": ["Brazil is the largest country in South America."],
"image_prompt": "Brazil skyline and national flag",
}
]
ppt_path = create_ppt(title="Brazil Briefing", slides=slides)
result = update_ppt(
ppt_path=ppt_path,
replace_rules={
"text_replace": {"Brazil": "Chile"},
"image_replace": {"__all__": {"prompt": "Chile skyline and national flag"}},
},
)
print(result["new_ppt_path"])
generate_image() uses mock backend by default.共 1 个版本