Skip to main content

aip_sdk.register_sdg_adapter

aip_sdk.register_sdg_adapter(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 in a single call.

Validates the pipeline class locally against the SDGPipeline interface before calling the registration API.

Parameters

  • name str: Adapter name.
  • pipeline Any | None: Pipeline class — must implement the SDGPipeline interface (run and validate_chain methods). Uses issubclass against SDGPipeline when aip_sdg_core is installed, otherwise falls back to duck-typing.
  • job_config Any | None: aip_sdg_core.JobConfig instance.
  • version str: Version string (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

Example:

import aip_sdk as aip
from mypackage import MyPipeline # subclass of SDGPipeline

aip.init("https://aip.example.com", api_key="...")
project = aip.Project.get("my-project-id")
adapter = aip.register_sdg_adapter(
name="adversarial-gen",
pipeline=MyPipeline,
version="1.0",
workspace_id=project.workspace_id,
)
print(adapter.id, adapter.name)