aip_sdk.iter_test_plan_versions
aip_sdk.iter_test_plan_versions(ref: str, *, workspace_id: str | None = None, per_page: int = 100, client: APIClient | None = None) -> Iterator[TestPlanSummary]
Iterate every published version of one test plan, newest first, auto-paginating.
Parameters
refstr: The plan whose history to read — its name, or theidof any of its versions.workspace_idstr | None: Workspace the plan belongs to. Falls back to the client's configured workspace.per_pageint: Page size used internally for each request (1-100).clientAPIClient | None: Explicit API client. Uses the default client when omitted.
Yields
TestPlanSummary: Each published version, newest first, as aTestPlanSummary, exactly once even acrossTestPlanSummary: a concurrent publish. A version published after the walk starts is not part of it.
Raises
NoWorkspaceSelectedError: No workspace was given and the client has none configured. Raised at this call, before any request.InvalidArgumentError:refis empty or contains/, orper_pageis out of range. Raised at this call, before any request.TestPlanNotFoundError: Nothing in this workspace answers toref.AuthError: Credentials are missing, invalid, or expired.ForbiddenError: The caller is not a member of the workspace.ResponseParseError: A platform response did not match the shape this SDK version expects, usually because the platform is newer and upgrading resolves it; or a page repeated a cursor this walk had already followed, which stops the walk.APIError: Any other error from the platform.
Examples
import aip_sdk as aip
for record in aip.iter_test_plan_versions("toxicity-baseline", workspace_id="ws_001"):
print(record.version, record.created_at)