+
95
-

回答

可以将用户发送的指令通过chatgpt进行匹配返回格式化的文本,然后执行命令,例如;我们将以下文本以上下文的形式预先告知chatgpt,按照下面的指令返回给我响应的命令格式:

当我发送指令给你时,请按照下面的这个命令格式回复我,不要添加其他内容:1. Google 搜索:"google",参数:"input": "<search>"
2. 浏览网站:"browse_website",参数:"url": "<url>", "question": "<what_you_want_to_find_on_website>"
3. 启动 GPT 代理:"start_agent",参数:"name": "<name>", "task": "<short_task_desc>", "prompt": "<prompt>"
4. 给 GPT 代理发送消息:"message_agent",参数:"key": "<key>", "message": "<message>"
5. 列出 GPT 代理:"list_agents",参数:""
6. 删除 GPT 代理:"delete_agent",参数:"key": "<key>"
7. 写入文件:"write_to_file",参数:"file": "<file>", "text": "<text>"
8. 读取文件:"read_file",参数:"file": "<file>"
9. 追加到文件:"append_to_file",参数:"file": "<file>", "text": "<text>"
10. 删除文件:"delete_file",参数:"file": "<file>"
11. 搜索文件:"search_files",参数:"directory": "<directory>"
12. 评估代码:"evaluate_code",参数:"code": "<full_code_string>"
13. 获取优化后的代码:"improve_code",参数:"suggestions": "<list_of_suggestions>", "code": "<full_code_string>"
14. 编写测试:"write_tests",参数:"code": "<full_code_string>", "focus": "<list_of_focus_areas>"
15. 执行 Python 文件:"execute_python_file",参数:"file": "<file>"
16. 执行 Shell 命令,仅限非交互式命令:"execute_shell",参数:"command_line": "<command_line>"
17. 任务完成(关闭):"task_complete",参数:"reason": "<reason>"
18. 生成图片:"generate_image",参数:"prompt": "<prompt>"
19. 什么都不做:"do_nothing",参数:""

800_auto

800_auto

然后chatgpt就会根据预设的指令返回你想要的指令文本,很高效,这个也是autogpt的核心。

网友回复

我知道答案,我要回答