Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

Rubbisheep
Copy link

功能概述

添加了新的 PPTMaker 角色,能够生成基于 LaTeX Beamer 的演示文稿。PPTMaker 通过协调 LatexGeneratorActionValidatorAction 两个 Action,实现了一个迭代式生成-验证流程,能够逐步构建并优化 LaTeX 演示文稿内容。

主要特性

  • 基于 LaTeX Beamer 的演示文稿:生成包含完整结构、数学公式和适当格式的专业演示文稿
  • 迭代优化:通过生成和验证的循环过程,持续改进内容质量
  • 自动验证:验证器能判断内容是否满足要求,并提供改进建议
  • 提前终止:当内容质量达到要求时,自动结束生成过程
  • 文件导出:自动将生成的 LaTeX 内容保存到工作区目录

实现细节

  • 新增两个 Action 类:LatexGeneratorActionValidatorAction
  • 创建了 PPTMaker 角色类,继承自 RoleZero
  • 实现了固定的工具执行序列和最大步骤限制
  • 包含文件保存功能,可将结果导出为 .md 文件
  • 使用 LLM 的相关提示词已添加到 metagpt.prompts.PPTmaker 模块

使用示例

from metagpt.roles.PPTmaker import PPTMaker
from metagpt.schema import Message

async def create_presentation():
    maker = PPTMaker()
    prompt = """
    1. Lecture slide:
    I am a lecturer. I am teaching the machine learning coure for research students. Please generate latex code for lecture slide for different reinforcement learning algorithms.
    Note that:
    1). Note that the lecture duration is 2 hour, so we need to generate 30 pages.
    2). for each reinforcement learning algorithms, the slide should include motivation, problem and intuitive solution and detailed math equations.
    3). Please make sure the the lecture have a good self-contain.
    """
    response = await maker.run(Message(content=prompt))
    print(response) 

计划改进

  • 添加更多格式化选项以支持不同的演示风格
  • 添加更多自定义选项,如颜色主题、布局等
  • 增加latex渲染引擎直接输出pdf
  • 在验证阶段启用视觉验证,避免生成乱码或格式错误

相关文件

  • metagpt/roles/PPTmaker.py - 主要实现
  • metagpt/prompts/PPTmaker.py - 提示词定义

metagpt/roles/PPTmaker.py Outdated Show resolved Hide resolved
metagpt/roles/PPTmaker.py Outdated Show resolved Hide resolved
metagpt/roles/PPTmaker.py Outdated Show resolved Hide resolved
@stellaHSR
Copy link
Collaborator

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.