refactor: убрать onAnswer из хуков агента
- onAnswer дублировал возврат Agent::ask() — убран - остались onStep, onToolStart, onToolEnd, shouldStop - пример 14 печатает ответ из возврата ask() - 116 тестов
This commit is contained in:
1 parent
4c25111c0e
commit
204d449519
7 files changed
+15
-27
No files matched your search
+1
-1
@@ -90,7 +90,6 @@ $agent = new Agent(
|
||||
onStep: fn (int $step, int $max) => print("шаг {$step}/{$max}\n"),
|
||||
onToolStart: fn (string $name, array $args) => print("→ {$name}\n"),
|
||||
onToolEnd: fn (array $s) => print(' ' . mb_substr($s['output'], 0, 60) . "\n"),
|
||||
onAnswer: fn (string $text) => print("ответ: {$text}\n"),
|
||||
shouldStop: fn (): bool => false,
|
||||
),
|
||||
);
|
||||
@@ -118,3 +117,4 @@ $tools->add(new FinishTool());
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user