Use Cases¶
These pages show how the Amorphic SDK APIs fit together: authenticate, work with datasets, attach AI resources, and update platform roles. The snippets use the same client setup, API classes, and model objects as the rest of this documentation.
What you will find¶
Building with datasets — Get a dataset registered and loaded so it is ready for queries or as an AI source.
AI features — Put a dataset behind a Bedrock knowledge base with a shared guardrail policy, then tear those resources down.
Platform roles — Grant a user access under a platform role (or adjust who manages it).
Authentication¶
The same client setup as Quickstart is enough for the snippets on these pages. Fetch the API host, role id, and PAT token from SSM (or another token source documented in AmorphicApiClient).
import certifi
import boto3
from openapi_client.amorphic_api_client import AmorphicApiClient
from openapi_client.api.datasets_api import DatasetsApi
ssm = boto3.client('ssm')
api_gw_url = ssm.get_parameter(
Name='adp/amorphic/config/apigwurl',
WithDecryption=False,
)['Parameter']['Value']
role_id = ssm.get_parameter(
Name='adp/amorphic/config/roleid',
WithDecryption=False,
)['Parameter']['Value']
client = AmorphicApiClient.create_with_auth(
host=api_gw_url,
role_id=role_id,
ssl_ca_cert=certifi.where(),
ssm_parameter='adp/amorphic/config/pattoken',
)
datasets_api = DatasetsApi(client)
For local development and other token sources, see Quickstart.