pub struct ListTasksRequest {
pub context_id: Option<String>,
pub status: Option<TaskState>,
pub page_size: Option<u32>,
pub page_token: Option<String>,
pub history_length: Option<u32>,
pub status_timestamp_after: Option<String>,
pub metadata: BTreeMap<String, Value>,
}Expand description
A typed ListTasks request. Wire form:
{
"contextId": "ctx-1",
"status": "working",
"pageSize": 50,
"pageToken": "...",
"historyLength": 10,
"statusTimestampAfter": "2025-01-01T00:00:00Z",
"metadata": { ... }
}All fields are optional. A request with
no filters and no pagination serialises
to {} on the wire.
Fields§
§context_id: Option<String>Filter tasks by context id. A request with a context id is a request for the tasks within that context; a request with no context id is a request across all contexts (subject to the agent’s policy).
status: Option<TaskState>Filter tasks by status. A request with a status is a request for the tasks in that state; a request with no status is a request across all states.
page_size: Option<u32>The maximum number of tasks to return. A request with no page size lets the agent choose (the spec’s default is 50, capped at 100).
page_token: Option<String>A page token received from a
previous ListTasksResponse. The
agent uses it to continue from the
last page.
history_length: Option<u32>The maximum number of history messages to include in each task’s history. A request with no history length lets the agent choose.
status_timestamp_after: Option<String>Filter tasks whose status was
updated after the provided
timestamp. The format is ISO 8601
(e.g. "2025-01-01T00:00:00Z").
metadata: BTreeMap<String, Value>Per-request metadata.
Implementations§
Source§impl ListTasksRequest
impl ListTasksRequest
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Starts a new empty request. Use
with_context_id,
with_status,
with_page_size,
with_page_token,
with_history_length,
and
with_status_timestamp_after
to set the optional fields.
Sourcepub fn with_context_id(self, context_id: impl Into<String>) -> Self
pub fn with_context_id(self, context_id: impl Into<String>) -> Self
Sets the context id filter.
Sourcepub const fn with_status(self, status: TaskState) -> Self
pub const fn with_status(self, status: TaskState) -> Self
Sets the status filter.
Sourcepub const fn with_page_size(self, page_size: u32) -> Self
pub const fn with_page_size(self, page_size: u32) -> Self
Sets the page size.
Sourcepub fn with_page_token(self, page_token: impl Into<String>) -> Self
pub fn with_page_token(self, page_token: impl Into<String>) -> Self
Sets the page token.
Sourcepub const fn with_history_length(self, length: u32) -> Self
pub const fn with_history_length(self, length: u32) -> Self
Sets the history length.
Sourcepub fn with_status_timestamp_after(self, timestamp: impl Into<String>) -> Self
pub fn with_status_timestamp_after(self, timestamp: impl Into<String>) -> Self
Sets the status timestamp filter.