aip_sdk.iter_runs
aip_sdk.iter_runs(project_id: str | None = None, status: RunStatus | None = None, *, metric: str | None = None, metric_config_name: str | None = None, metric_config_version: str | None = None, workspace_id: str | None = None, all_workspaces: bool = False, per_page: int = 20, client: APIClient | None = None) -> Iterator[RunSummary]
Iterate every matching run, newest first, auto-paginating — same filters as
list_runs(), walking every page instead of returning one.
Reads your session's workspace unless you name one, and raises if none is set.
Pass all_workspaces=True to read across every workspace you can access.
Parameters
project_idstr | None: Only return runs in this project.statusRunStatus | None: Only return runs in this status.metricstr | None: The metricmetric_config_name/metric_config_versionmatch against; requires at least one of them.metric_config_namestr | None: Only runs whose scoring snapshot formetricresolved this config name. Requiresmetric.metric_config_versionstr | None: Same, for config version. Requiresmetric.workspace_idstr | None: Only return runs in this workspace.all_workspacesbool: Read across every workspace you can access.per_pageint: Page size used internally for each request (1-100).clientAPIClient | None: Optional API client. Defaults to the module-level client.
Yields
RunSummaryRunSummary: each matching run, across as many pages as needed.
Raises
InvalidArgumentError: Ifper_pageis out of range, or themetric/config-filter pairing is inconsistent.AuthError: If no credentials are configured.APIError: If a listing request fails or returns a malformed response.ForbiddenError: Ifworkspace_idnames a workspace you cannot access.NoWorkspaceSelectedError: No workspace was passed, none is configured for the session, andall_workspaceswas not set. Raised at this call, before any request.
Example:
for summary in aip.iter_runs(metric="agent.custom_judge_rubric", metric_config_name="rubric_prompt_a"):
print(summary.id, summary.status)