stop_whenで停止ヘルパーを組み合わせます:
has_tool_call(...) と finish_reason_is(...) があります。コストやトークンで制限する場合も、報告される使用量に依存するため、ステップ数または時間の上限を設定してください。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Pythonエージェントの作業を、ステップ数、トークン、コスト、時間、ツール、終了理由で制限します。
stop_whenで停止ヘルパーを組み合わせます:
stop_when = [
step_count_is(12),
max_tokens_used(40_000),
max_cost(2),
max_duration(60_000),
]
has_tool_call(...) と finish_reason_is(...) があります。コストやトークンで制限する場合も、報告される使用量に依存するため、ステップ数または時間の上限を設定してください。