Skip to content

Commit 1ea0943

Browse files
feat: Align Task Filtering by Status with status Field
1 parent 10e4187 commit 1ea0943

File tree

3 files changed

+32
-29
lines changed

3 files changed

+32
-29
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-890b9140b139df6307d175ff31cba0bf14d703887bee2f0a8db9f5bffc78e11d.yml
3-
openapi_spec_hash: 7131a3daffe4f5b67bc1c7ccec06d961
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-3a9488448292a0736b08b2d6427e702eaf7106d86345ca2e65b64bed4398b036.yml
3+
openapi_spec_hash: 5ff2781dcc11a0c9aa353f5cb14bcc16
44
config_hash: 9d52be5177b2ede4cb0633c04f4cc4ef

src/resources/tasks.ts

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -226,25 +226,18 @@ export class Tasks extends APIResource {
226226
}
227227

228228
/**
229-
* Get a paginated list of all AI agent tasks for the authenticated user.
229+
* Get a paginated list of all Browser Use Agent tasks for the authenticated user.
230230
*
231-
* AI agent tasks are the individual jobs that your agents perform within a
232-
* session. Each task represents a specific instruction or goal that the agent
231+
* Browser Use Agent tasks are the individual jobs that your agents perform within
232+
* a session. Each task represents a specific instruction or goal that the agent
233233
* works on, such as filling out a form, extracting data, or navigating to specific
234234
* pages.
235235
*
236-
* You can control what data is included for each task:
237-
*
238-
* - Task steps: Detailed actions the agent took
239-
* - User uploaded files: Files you provided for the task
240-
* - Output files: Files generated by the agent during the task
241-
*
242236
* Returns:
243237
*
244-
* - A paginated list of agent tasks
245-
* - Total count of tasks
238+
* - A paginated list of Browser Use Agent tasks
239+
* - Total count of Browser Use Agent tasks
246240
* - Page information for navigation
247-
* - Optional detailed data based on your parameters
248241
*/
249242
list(
250243
query: TaskListParams | null | undefined = {},
@@ -417,9 +410,10 @@ export interface TaskItemView {
417410
/**
418411
* Enumeration of possible task execution states
419412
*
420-
* Attributes: STARTED: Task has been started and is currently running PAUSED: Task
421-
* execution has been temporarily paused (can be resumed) STOPPED: Task execution
422-
* has been stopped (cannot be resumed) FINISHED: Task has completed successfully
413+
* Attributes: STARTED: Task has been started and is currently running. PAUSED:
414+
* Task execution has been temporarily paused (can be resumed) FINISHED: Task has
415+
* finished and the agent has completed the task. STOPPED: Task execution has been
416+
* manually stopped (cannot be resumed).
423417
*/
424418
status: TaskStatus;
425419

@@ -439,11 +433,12 @@ export interface TaskItemView {
439433
/**
440434
* Enumeration of possible task execution states
441435
*
442-
* Attributes: STARTED: Task has been started and is currently running PAUSED: Task
443-
* execution has been temporarily paused (can be resumed) STOPPED: Task execution
444-
* has been stopped (cannot be resumed) FINISHED: Task has completed successfully
436+
* Attributes: STARTED: Task has been started and is currently running. PAUSED:
437+
* Task execution has been temporarily paused (can be resumed) FINISHED: Task has
438+
* finished and the agent has completed the task. STOPPED: Task execution has been
439+
* manually stopped (cannot be resumed).
445440
*/
446-
export type TaskStatus = 'started' | 'paused' | 'stopped' | 'finished';
441+
export type TaskStatus = 'started' | 'paused' | 'finished' | 'stopped';
447442

448443
/**
449444
* View model for representing a single step in a task's execution
@@ -514,9 +509,10 @@ export interface TaskView {
514509
/**
515510
* Enumeration of possible task execution states
516511
*
517-
* Attributes: STARTED: Task has been started and is currently running PAUSED: Task
518-
* execution has been temporarily paused (can be resumed) STOPPED: Task execution
519-
* has been stopped (cannot be resumed) FINISHED: Task has completed successfully
512+
* Attributes: STARTED: Task has been started and is currently running. PAUSED:
513+
* Task execution has been temporarily paused (can be resumed) FINISHED: Task has
514+
* finished and the agent has completed the task. STOPPED: Task execution has been
515+
* manually stopped (cannot be resumed).
520516
*/
521517
status: TaskStatus;
522518

@@ -701,14 +697,19 @@ export interface TaskUpdateParams {
701697
}
702698

703699
export interface TaskListParams {
700+
after?: string | null;
701+
702+
before?: string | null;
703+
704704
/**
705-
* Enumeration of possible task filters
705+
* Enumeration of possible task execution states
706706
*
707-
* Attributes: STARTED: All started tasks PAUSED: All paused tasks STOPPED: All
708-
* stopped tasks FINISHED: All finished tasks SUCCESSFUL: All successful tasks
709-
* UNSUCCESSFUL: All unsuccessful tasks
707+
* Attributes: STARTED: Task has been started and is currently running. PAUSED:
708+
* Task execution has been temporarily paused (can be resumed) FINISHED: Task has
709+
* finished and the agent has completed the task. STOPPED: Task execution has been
710+
* manually stopped (cannot be resumed).
710711
*/
711-
filterBy?: 'started' | 'paused' | 'stopped' | 'finished' | 'successful' | 'unsuccessful' | null;
712+
filterBy?: TaskStatus | null;
712713

713714
pageNumber?: number;
714715

tests/api-resources/tasks.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ describe('resource tasks', () => {
8787
await expect(
8888
client.tasks.list(
8989
{
90+
after: '2019-12-27T18:11:19.117Z',
91+
before: '2019-12-27T18:11:19.117Z',
9092
filterBy: 'started',
9193
pageNumber: 1,
9294
pageSize: 1,

0 commit comments

Comments
 (0)