aip_sdk.run_sdg
aip_sdk.run_sdg(adapter_id: str, project_id: str | None = None, *, target_dataset_id: str | None = None, source_dataset_version_id: str | None = None, client: APIClient | None = None) -> SdgRun
Trigger an SDG run against a previously registered adapter.
The adapter must have been registered with pipeline_config; adapters
registered with the legacy pipeline_class dotted-path slot are not
runnable and are rejected with 400.
The call returns immediately (HTTP 202 Accepted) once the run has been
enqueued; processing happens asynchronously. Use SdgRun.refresh()
to poll status, or aip.get_run() to attach a full Run handle.
Parameters
adapter_idstr: ID of the registered SDG adapter to run.project_idstr | None: Optional project to attach the resulting run to. Must belong to the adapter's workspace. Strongly recommended: without it non-admin callers cannot fetch the run back viaGET /runs/{id}and the run is invisible to project-scoped run lists.target_dataset_idstr | None: Optional dataset to write the generated samples into.source_dataset_version_idstr | None: Optional dataset version to read seed samples from.clientAPIClient | None: Optional pre-configured API client.
Returns
SdgRun: SdgRun withid,status,created_at.
Raises
AdapterNotFoundError: If the adapter doesn't exist.APIError: If the adapter was registered withoutpipeline_config, or ifproject_idis unknown / not in the adapter's workspace.AuthError: If no credentials are configured.
Example:
# Authoring a JobConfig requires the SDG extra: pip install 'aip-sdk[sdg]'
import aip_sdk as aip
from aip_sdg_core import JobConfig
from aip_sdg_core.schemas.object_detection.augmentation.brightness_contrast import (
BrightnessContrastConfig,
)
aip.init("https://aip.example.com", api_key="...")
job_config = JobConfig(storage_root="/tmp/sdg")
job_config.add_node("seed", ...)
job_config.add_node("augmented", BrightnessContrastConfig(...), upstream="seed")
adapter = aip.register_sdg_adapter(name="brightness-tune", job_config=job_config)
run = aip.run_sdg(adapter_id=adapter.id, project_id="proj_…")
print(run.id, run.status)