datarobot_genai.dragent.deployment_urls
deployment_urls
Shared URL construction utilities for DataRobot deployment endpoints.
These helpers are the single source of truth for the URL patterns used to reach
a DataRobot-hosted A2A agent and to look up its agent card from the central
registry. Both the server side (advertising its own URL in the agent card) and
the client side (deriving the RPC base URL from a deployment_id) use these
functions so that the patterns stay in sync automatically.
resolve_datarobot_endpoint
Return the effective DataRobot API endpoint from the environment.
Checks environment variables in priority order:
DATAROBOT_PUBLIC_API_ENDPOINT— preferred for externally reachable URLs (on-prem deployments often setDATAROBOT_ENDPOINTto an internal k8s address whileDATAROBOT_PUBLIC_API_ENDPOINTholds the public URL).DATAROBOT_ENDPOINT— standard SDK variable.- Built-in default (
https://app.datarobot.com/api/v2) whenrequireis False.
Parameters
require:
When True, raises :class:ValueError if neither env var is set.
When False (default), falls back to the built-in default endpoint.
Returns
str | None
The resolved endpoint string, or None only when require is
False and both env vars are unset (returns the default instead,
so in practice this always returns a non-None value when
require=False).
Raises
ValueError
If require=True and neither DATAROBOT_PUBLIC_API_ENDPOINT nor
DATAROBOT_ENDPOINT is set.
Source code in datarobot_genai/dragent/deployment_urls.py
build_deployment_a2a_url
Construct the A2A direct-access URL for a DataRobot deployment.
Parameters
endpoint:
DataRobot API endpoint base URL, e.g. https://app.datarobot.com/api/v2.
A trailing slash is stripped before composing the URL.
deployment_id:
The DataRobot deployment ID.
Returns
str
A URL of the form {endpoint}/deployments/{deployment_id}/directAccess/a2a/.
Source code in datarobot_genai/dragent/deployment_urls.py
build_deployment_agent_card_url
Construct the agent card registry URL for a DataRobot deployment.
Parameters
endpoint:
DataRobot API endpoint base URL, e.g. https://app.datarobot.com/api/v2.
A trailing slash is stripped before composing the URL.
deployment_id:
The DataRobot deployment ID.
Returns
str
A URL of the form {endpoint}/deployments/{deployment_id}/agentCard/.
Source code in datarobot_genai/dragent/deployment_urls.py
build_workload_a2a_url
Construct the A2A URL for a DataRobot workload.
Parameters
endpoint:
DataRobot API endpoint base URL, e.g. https://app.datarobot.com/api/v2.
A trailing slash is stripped before composing the URL.
workload_id:
The DataRobot workload ID.
Returns
str
A URL of the form {endpoint}/endpoints/workloads/{workload_id}/a2a/.
Source code in datarobot_genai/dragent/deployment_urls.py
build_workload_agent_card_url
Construct the agent card URL for a DataRobot workload.
Parameters
endpoint:
DataRobot API endpoint base URL, e.g. https://app.datarobot.com/api/v2.
A trailing slash is stripped before composing the URL.
workload_id:
The DataRobot workload ID.
Returns
str
A URL of the form {endpoint}/workloads/{workload_id}/agentCard/.
Source code in datarobot_genai/dragent/deployment_urls.py
build_agent_cards_registry_url
Construct the URL for the central agent card registry.
The central registry lists all agent cards within the user's organisation (tenant context) and requires only API-token authentication, not the per-agent AuthZ that the agent's own card endpoint demands.
Parameters
endpoint:
DataRobot API endpoint base URL, e.g. https://app.datarobot.com/api/v2.
A trailing slash is stripped before composing the URL.
Returns
str
A URL of the form {endpoint}/agentCards/.