onEventコールバックを渡します。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
PHPエージェントの実行、モデルのターン、ツール、一時停止、完了を監視します。
onEventコールバックを渡します。
$result = $agent->run(
input: $prompt,
client: $client,
onEvent: function (array $event): void {
$logger->info("agent event", [
"type" => $event["type"],
"run_id" => $event["run_id"],
"details" => $event["details"] ?? [],
]);
}
);