Skip to content

Chapter4.2.3:代码错误 #579

Description

@zk1047740032

1. 遇到问题的章节 / Affected Chapter

Chapter4.2.3

2. 问题类型 / Issue Type

代码错误 / Code Error

3. 具体问题描述 / Problem Description

逻辑优化:ReAct.py文件/“REACT_PROMPT_TEMPLATE = """
请注意,你是一个有能力调用外部工具的智能助手...”这一段应该以“system”角色发送给大模型,现在是以“user”角色发送的;

4. 问题重现材料 / Reproduction Materials

SYSTEM_PROMPT_TEMPLATE = """
你是一个有能力调用外部工具的智能助手

可调用工具如下:
{tools}

请严格按照以下格式进行回应:

Thought: 你的思考过程,用于分析问题、拆解任务和规划下一步行动。
Action: 你决定采取的行动。必须是以下格式之一:
- `{{tool_name}}[{{tool_input}}]`: 调用一个可用工具。
- `Finish[最终答案]`: 当你认为已经获得最终答案时。
- 当你收集到足够的信息,能够回答用户的最终问题时,你必须在Action:字段后使用 Finish[最终答案] 来输出最终答案。
"""

USER_PROMPT_TEMPLATE = """
现在,请开始解决以下问题:
Question: {question}
History: {history}
"""

5. 补充信息 / Additional Information

No response

确认事项 / Verification

  • 我已阅读过相关章节的文档 / I have read the relevant chapter documentation
  • 我已搜索过现有的Issues,确认此问题未被报告 / I have searched existing Issues and confirmed this hasn't been reported
  • 我已尝试过基本的故障排除(如重启、重新安装依赖等) / I have tried basic troubleshooting (restart, reinstall dependencies, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions