agent loop
1 | +--------+ +-------+ +---------+ |
1 | def agent_loop(query): |
首先给了一个tools的定义
1 | TOOLS = [{ |
可以看一下run_bash函数:
1 | def run_bash(command: str) -> str: |
禁掉了提权 关机 重启
所以大概步骤就是:
- send messages(user prompt) to llm
- llm response
- messages(response) added
- tools to do things
- messages(results of tool use)add
所以messages是不断更新的
- thinkblock
- textblock
- tooluseblock
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Johnny-Zhao's TechBlog!
