Skip to main content

aip_sdk.SdgAdapter

aip_sdk.SdgAdapter

SDG Adapter Registry top-level access.

Examples

>>> import aip_sdk as aip
>>> from mypackage import MyPipeline # subclass of SDGPipeline
>>> aip.init(base_url, api_key=api_key)
>>> adapter = aip.SdgAdapter.register(
... name="adversarial-gen",
... pipeline=MyPipeline,
... version="1.0",
... )
>>> print(adapter.id, adapter.name)
>>> adapters = aip.SdgAdapter.list()
>>> for a in adapters:
... print(a.name, a.version)

aip_sdk.SdgAdapter.aget​

async aip_sdk.SdgAdapter.aget(adapter_id: str, client: AsyncAPIClient | None = None) -> SdgAdapterInstance

Async variant of get().

Parameters

  • adapter_id str: Adapter registration ID.
  • client AsyncAPIClient | None: Optional async API client.

Returns

Raises

aip_sdk.SdgAdapter.alist​

async aip_sdk.SdgAdapter.alist(page: int = 1, per_page: int = 100, *, workspace_id: str | None = None, client: AsyncAPIClient | None = None, all_workspaces: bool = False) -> list[SdgAdapterInstance]

Async variant of list().

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

  • page int: Page number (1-indexed).
  • per_page int: Results per page.
  • workspace_id str | None: Filter to adapters registered in this workspace.
  • client AsyncAPIClient | None: Optional async API client.
  • all_workspaces bool: Read across every workspace you can access.

Returns

  • list[SdgAdapterInstance]: List of SdgAdapterInstance objects.

Raises

aip_sdk.SdgAdapter.aregister​

async aip_sdk.SdgAdapter.aregister(name: str, pipeline: Any | None = None, job_config: Any | None = None, version: str = '1.0', owner: str | None = None, *, workspace_id: str | None = None, client: AsyncAPIClient | None = None) -> SdgAdapterInstance

Async variant of register().

Exactly one of pipeline and job_config must be provided.

Parameters

  • name str: Adapter name.
  • pipeline Any | None: Pipeline class — legacy dotted-path registration. Must implement the SDGPipeline interface (run, validate_chain). Uses issubclass when aip_sdg_core is installed, otherwise falls back to duck-typing. Adapters registered this way are not runnable via run_sdg() — they only round-trip metadata.
  • job_config Any | None: aip_sdg_core.JobConfig instance — the runnable path. Adapters registered this way can be run via run_sdg().
  • version str: Version identifier (default: "1.0").
  • owner str | None: Owner/team identifier.
  • workspace_id str | None: Workspace to register the adapter in. Falls back to client.config.workspace_id (set via init() or AIP_WORKSPACE_ID) when not provided. With neither, the registration is refused rather than landing somewhere you did not choose.
  • client AsyncAPIClient | None: Optional async API client.

Returns

Raises

aip_sdk.SdgAdapter.get​

aip_sdk.SdgAdapter.get(adapter_id: str, client: APIClient | None = None) -> SdgAdapterInstance

Fetch a registered SDG adapter by ID.

Parameters

  • adapter_id str: Adapter registration ID.
  • client APIClient | None: Optional pre-configured API client.

Returns

Raises

aip_sdk.SdgAdapter.list​

aip_sdk.SdgAdapter.list(page: int = 1, per_page: int = 100, *, workspace_id: str | None = None, client: APIClient | None = None, all_workspaces: bool = False) -> list[SdgAdapterInstance]

List registered SDG adapters.

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

  • page int: Page number (1-indexed).
  • per_page int: Results per page.
  • workspace_id str | None: Filter to adapters registered in this workspace.
  • client APIClient | None: Optional pre-configured API client.
  • all_workspaces bool: Read across every workspace you can access.

Returns

  • list[SdgAdapterInstance]: List of SdgAdapterInstance objects.

Raises

aip_sdk.SdgAdapter.register​

aip_sdk.SdgAdapter.register(name: str, pipeline: Any | None = None, job_config: Any | None = None, version: str = '1.0', owner: str | None = None, *, workspace_id: str | None = None, client: APIClient | None = None) -> SdgAdapterInstance

Register a custom SDG adapter.

Exactly one of pipeline and job_config must be provided.

Parameters

  • name str: Adapter name.
  • pipeline Any | None: Pipeline class — legacy dotted-path registration. Must implement the SDGPipeline interface (run, validate_chain). Uses issubclass when aip_sdg_core is installed, otherwise falls back to duck-typing. Adapters registered this way are not runnable via run_sdg() — they only round-trip metadata.
  • job_config Any | None: aip_sdg_core.JobConfig instance — the runnable path. Adapters registered this way can be run via run_sdg().
  • version str: Version identifier (default: "1.0").
  • owner str | None: Owner/team identifier.
  • workspace_id str | None: Workspace to register the adapter in. Falls back to client.config.workspace_id (set via init() or AIP_WORKSPACE_ID) when not provided. With neither, the registration is refused rather than landing somewhere you did not choose.
  • client APIClient | None: Optional pre-configured API client.

Returns

Raises