Skip to content

Commit

Permalink
Pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
waynehamadi committed Aug 29, 2023
1 parent 4d73475 commit b2b82fa
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
32 changes: 32 additions & 0 deletions rfcs/2-Pagination-RFC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# List tasks, artifacts and steps in a paginated way.

| Feature name | Support Pagination |
| :------------ |:-----------------------------------------|
| **Author(s)** | Merwane Hamadi ([email protected]) |
| **RFC PR:** | [PR 53](https://github.com/e2b-dev/agent-protocol/pull/53) |
| **Updated** | 2023-08-28 |
| **Obsoletes** | |

## Summary

We just want to be able to list tasks, artifacts and steps in a paginated way.

## Motivation

Every app needs this. It's not really farfetched

## Agent Builders Benefit

- They can paginate their tasks, steps and artifacts.

## Design Proposal

Query parameters for now.

### Alternatives Considered
- query parameter is the simplest, leanest design. We can add more later (body, headers, etc) => let's start lean.
- for now, we won't add the pages in the response of the requests, this is another RFC.

### Compatibility

- This is backwards compatible. We're just adding things.
81 changes: 81 additions & 0 deletions schemas/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,27 @@ paths:
get:
operationId: listAgentTasksIDs
summary: List all tasks that have been created for the agent.
parameters:
- name: current_page
in: query
description: Page number
required: false
schema:
type: integer
format: int32
default: 1
minimum: 1
example: 2
- name: page_size
in: query
description: Number of items per page
required: false
schema:
type: integer
format: int32
default: 10
minimum: 1
example: 25
responses:
'200':
description: Returned list of agent's task IDs.
Expand Down Expand Up @@ -94,6 +115,26 @@ paths:
x-postman-variables:
- type: load
name: task_id
- name: current_page
in: query
description: Page number
required: false
schema:
type: integer
format: int32
default: 1
minimum: 1
example: 2
- name: page_size
in: query
description: Number of items per page
required: false
schema:
type: integer
format: int32
default: 10
minimum: 1
example: 25
responses:
'200':
description: Returned list of agent's steps for the specified task.
Expand Down Expand Up @@ -200,6 +241,26 @@ paths:
x-postman-variables:
- type: load
name: task_id
- name: current_page
in: query
description: Page number
required: false
schema:
type: integer
format: int32
default: 1
minimum: 1
example: 2
- name: page_size
in: query
description: Number of items per page
required: false
schema:
type: integer
format: int32
default: 10
minimum: 1
example: 25
responses:
'200':
description: Returned the list of artifacts for the task.
Expand Down Expand Up @@ -283,6 +344,25 @@ paths:
- agent
components:
schemas:
Pagination:
type: object
properties:
total_items:
description: Total number of items.
type: integer
example: 42
total_pages:
description: Total number of pages.
type: integer
example: 97
current_page:
description: Current_page page number.
type: integer
example: 1
page_size:
description: Number of items per page.
type: integer
example: 25
TaskStepsListResponse:
description: A list of step IDs for the task
type: array
Expand Down Expand Up @@ -399,6 +479,7 @@ components:
description: Input prompt for the step.
type: string
example: Write the words you receive to the file 'output.txt'.
nullable: true
additional_input:
$ref: '#/components/schemas/StepInput'
Step:
Expand Down

0 comments on commit b2b82fa

Please sign in to comment.