Skip to main content

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

  • ref str: The plan whose history to read — its name, or the id of any of its versions.
  • workspace_id str | None: Workspace the plan belongs to. Falls back to the client's configured workspace.
  • per_page int: Page size used internally for each request (1-100).
  • client APIClient | None: Explicit API client. Uses the default client when omitted.

Yields

  • TestPlanSummary: Each published version, newest first, as a TestPlanSummary, exactly once even across
  • TestPlanSummary: 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: ref is empty or contains /, or per_page is out of range. Raised at this call, before any request.
  • TestPlanNotFoundError: Nothing in this workspace answers to ref.
  • 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)