添加新的工具功能和测试覆盖:

- 注册 `LsTool` 和 `BashTool` 工具,支持目录操作和命令执行
- 增强工具调用逻辑,添加日志记录以提升调试能力
- 增加 `ToolRegistry` 和 `RunLoop` 的增量累积与排序优化
- 完善单元测试覆盖新工具的执行与行为验证
This commit is contained in:
2025-12-23 17:26:27 +08:00
parent 78875ec3eb
commit 71226c255b
11 changed files with 721 additions and 25 deletions

View File

@@ -2,7 +2,9 @@
namespace App\Services\Tool;
use App\Services\Tool\Tools\BashTool;
use App\Services\Tool\Tools\GetTimeTool;
use App\Services\Tool\Tools\LsTool;
/**
* Tool 注册表:管理已注册工具与 OpenAI 兼容的声明。
@@ -21,6 +23,8 @@ class ToolRegistry
{
$tools = $tools ?? [
new GetTimeTool(),
new LsTool(),
new BashTool(),
];
$this->tools = [];