@@ -54,6 +54,7 @@ def create(
5454 task : str ,
5555 agent_id : str | Omit = omit ,
5656 browser_settings : run_create_params .BrowserSettings | Omit = omit ,
57+ pause_when : str | Omit = omit ,
5758 result_schema : Dict [str , object ] | Omit = omit ,
5859 variables : Dict [str , run_create_params .Variables ] | Omit = omit ,
5960 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -78,6 +79,12 @@ def create(
7879 browser_settings: Browser configuration for the agent's session. When omitted, runner defaults
7980 apply.
8081
82+ pause_when: Optional description of when the agent should pause and wait for input from your
83+ application (e.g. a verification code, an approval, or an answer from another
84+ system). When set, the agent is given a `pause` tool; calling it transitions the
85+ run to `PAUSED` (the agent's request is the trailing `pause` tool call in the
86+ run's messages) until it is resumed via the resume endpoint.
87+
8188 result_schema: An optional [JSON Schema](https://json-schema.org/specification) object. If
8289 provided, the agent will aim to return a `result` that conforms to this schema
8390 when the run completes. Overrides the referenced agent's default `resultSchema`
@@ -103,6 +110,7 @@ def create(
103110 "task" : task ,
104111 "agent_id" : agent_id ,
105112 "browser_settings" : browser_settings ,
113+ "pause_when" : pause_when ,
106114 "result_schema" : result_schema ,
107115 "variables" : variables ,
108116 },
@@ -157,7 +165,7 @@ def list(
157165 end_at : Union [str , datetime ] | Omit = omit ,
158166 limit : int | Omit = omit ,
159167 start_at : Union [str , datetime ] | Omit = omit ,
160- status : Literal ["PENDING" , "RUNNING" , "COMPLETED" , "FAILED" , "STOPPED" , "TIMED_OUT" ] | Omit = omit ,
168+ status : Literal ["PENDING" , "RUNNING" , "COMPLETED" , "FAILED" , "STOPPED" , "TIMED_OUT" , "PAUSED" ] | Omit = omit ,
161169 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
162170 # The extra values given here take precedence over values defined on the client or passed to this method.
163171 extra_headers : Headers | None = None ,
@@ -192,6 +200,8 @@ def list(
192200 - `FAILED` - agent has failed the run
193201 - `STOPPED` - run was stopped by the user
194202 - `TIMED_OUT` - run exceeded maximum time
203+ - `PAUSED` - run is paused awaiting input from the caller; the agent's request
204+ is the trailing `pause` tool call in the run's messages
195205
196206 extra_headers: Send extra headers
197207
@@ -310,6 +320,7 @@ async def create(
310320 task : str ,
311321 agent_id : str | Omit = omit ,
312322 browser_settings : run_create_params .BrowserSettings | Omit = omit ,
323+ pause_when : str | Omit = omit ,
313324 result_schema : Dict [str , object ] | Omit = omit ,
314325 variables : Dict [str , run_create_params .Variables ] | Omit = omit ,
315326 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -334,6 +345,12 @@ async def create(
334345 browser_settings: Browser configuration for the agent's session. When omitted, runner defaults
335346 apply.
336347
348+ pause_when: Optional description of when the agent should pause and wait for input from your
349+ application (e.g. a verification code, an approval, or an answer from another
350+ system). When set, the agent is given a `pause` tool; calling it transitions the
351+ run to `PAUSED` (the agent's request is the trailing `pause` tool call in the
352+ run's messages) until it is resumed via the resume endpoint.
353+
337354 result_schema: An optional [JSON Schema](https://json-schema.org/specification) object. If
338355 provided, the agent will aim to return a `result` that conforms to this schema
339356 when the run completes. Overrides the referenced agent's default `resultSchema`
@@ -359,6 +376,7 @@ async def create(
359376 "task" : task ,
360377 "agent_id" : agent_id ,
361378 "browser_settings" : browser_settings ,
379+ "pause_when" : pause_when ,
362380 "result_schema" : result_schema ,
363381 "variables" : variables ,
364382 },
@@ -413,7 +431,7 @@ async def list(
413431 end_at : Union [str , datetime ] | Omit = omit ,
414432 limit : int | Omit = omit ,
415433 start_at : Union [str , datetime ] | Omit = omit ,
416- status : Literal ["PENDING" , "RUNNING" , "COMPLETED" , "FAILED" , "STOPPED" , "TIMED_OUT" ] | Omit = omit ,
434+ status : Literal ["PENDING" , "RUNNING" , "COMPLETED" , "FAILED" , "STOPPED" , "TIMED_OUT" , "PAUSED" ] | Omit = omit ,
417435 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
418436 # The extra values given here take precedence over values defined on the client or passed to this method.
419437 extra_headers : Headers | None = None ,
@@ -448,6 +466,8 @@ async def list(
448466 - `FAILED` - agent has failed the run
449467 - `STOPPED` - run was stopped by the user
450468 - `TIMED_OUT` - run exceeded maximum time
469+ - `PAUSED` - run is paused awaiting input from the caller; the agent's request
470+ is the trailing `pause` tool call in the run's messages
451471
452472 extra_headers: Send extra headers
453473
0 commit comments