AgentDefinition.StopWhen で停止ヘルパーを組み合わせます。
HasToolCall(...) と FinishReasonIs(...) provide event-based limits. トークン数やコストの上限を使う場合も、使用量の報告に依存するため、ステップ数または実行時間の上限を設定してください。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
.NETエージェントの作業をステップ数、トークン数、コスト、時間、ツール、終了理由で制限します。
AgentDefinition.StopWhen で停止ヘルパーを組み合わせます。
StopWhen = new[]
{
AgentSdk.StepCountIs(12),
AgentSdk.MaxTokensUsed(40_000),
AgentSdk.MaxCost(2),
AgentSdk.MaxDuration(TimeSpan.FromMinutes(1)),
};
HasToolCall(...) と FinishReasonIs(...) provide event-based limits. トークン数やコストの上限を使う場合も、使用量の報告に依存するため、ステップ数または実行時間の上限を設定してください。