为Agent提供一个可以执行命令的Shell环境。
Windows下无法测试。
3.11 Filesystem中间件
这是源自deepagents(基于LangChain的另一个框架)的中间件
内置了四个工具,分别用于查看目录、读文件、写文件和改文件。
3.12 Subagent中间件
也是来自deepagents的中间件
用于便捷地创建子Agent。
4、多个中间件组合及执行顺序
问题:Middleware 可以叠加使用,那么多个中间件书写顺序重要吗?
非常重要!
比如:
![图片[1]-3.10 Shell tool中间件-大赛人网](https://www.dsrw.com/wp-content/uploads/2026/11/image-1053.png)
比如:
![图片[2]-3.10 Shell tool中间件-大赛人网](https://www.dsrw.com/wp-content/uploads/2026/11/image-1054.png)
举例:
- 代码
![图片[3]-3.10 Shell tool中间件-大赛人网](https://www.dsrw.com/wp-content/uploads/2026/11/image-1055.png)
![图片[4]-3.10 Shell tool中间件-大赛人网](https://www.dsrw.com/wp-content/uploads/2026/11/image-1056.png)
![图片[5]-3.10 Shell tool中间件-大赛人网](https://www.dsrw.com/wp-content/uploads/2026/11/image-1057.png)
2. 输出
![图片[6]-3.10 Shell tool中间件-大赛人网](https://www.dsrw.com/wp-content/uploads/2026/11/image-1058.png)
3. 分析
![图片[7]-3.10 Shell tool中间件-大赛人网](https://www.dsrw.com/wp-content/uploads/2026/11/image-1059.png)
类似洋葱模型:外层先进后出
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
















请登录后查看评论内容