Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
验证最终输出、重试模型请求,并检查已完成的 PHP 运行。
$agent = AgentSdk::createAgent(new AgentDefinition(
id: "research-agent",
model: "openai/gpt-5.4-nano",
modelRetry: new ModelRetryConfig(
maxRetries: 3,
baseDelayMs: 500,
maxDelayMs: 4000
)
));
$result = $agent->run(input: $prompt, client: $client);
echo $result->output;
echo $result->run->status;
echo $result->usage["total_tokens"];
echo $result->usage["cost"];
使用[停止条件](./agent-sdk-stop-conditions)强制执行预算,并参考[错误与故障排查](./agent-sdk-observability)选择可恢复故障的处理方式。