-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Have you read the docs? Agents SDK docs – YES
Have you searched for related issues? Others may have had similar requests – YES
Describe the feature
It would be helpful to have a max_time
parameter for the run() and run_streamed() methods, allowing users to automatically terminate runs that exceed a specified duration.
While this functionality is straightforward for users to implement manually, it would be convenient to have it built into the SDK.
Proposed behavior:
-
If
run_time
>max_time
, raise a TimeoutError (some relevant err). -
For streaming runs:
max_time
counts seconds before the first token is received. -
For runs:
max_time
counts seconds before theRunResult
is returned.
I've noticed over the past several days that runs have generally been taking longer, and I had to implement my own timeout logic. A built-in option would be clutch! Just some thoughts...