tdfs4ds.agentops.agents¶
tdfs4ds.agentops.agents
¶
Find a deployed agent in AgentOps by id, short id or name, and read its endpoint.
The Playground shows an agent as 85f752e - <name> - Version 1. Any of those
forms names it here: the full UUID, a prefix of it (6+ characters), or the
deployment name. A name reused by a terminated deployment resolves to the live
one; a reference matching several live deployments is refused with the
candidates listed, never guessed.
_UUID
module-attribute
¶
AgentOpsClient
¶
Minimal client for the endpoints a deployment needs.
Parameters¶
base_url : str, optional
Defaults to TD_AGENTOPS_BASE_URL, then the in-cluster service URL.
token : str, optional
JWT bearer token. Defaults to TDFS4DS_AGENTOPS_TOKEN. In an AI
Studio notebook this is the user_token produced by %gen_token.
register_definition
¶
Upload the zip and register an agent definition. Returns its id.
wait_definition_published
¶
Poll until the definition leaves creating. Returns its status.
create_deployment
¶
POST the deployment payload. Returns the full response body.
The payload is sent verbatim; see the module docstring on
extra_forbidden.
wait_deployment_active
¶
Poll the deployment until it settles. Returns the last body.
Emits current_step transitions rather than every poll, so a long
build reads as building -> pushing -> deploying instead of forty
identical lines.
delete_agent
¶
DELETE /agents/{id}: removes the deployment (pod, route, service).
delete_definition
¶
DELETE /agent_definitions/{id}: removes the registry entry.
get_logs
¶
Pod logs. Never raises — a missing log must not mask the real error.
resolve_agent
¶
The deployments of agents that agent names (pure).
Order: exact UUID, UUID prefix (6+ hex characters, the Playground's short id), then the deployment / definition / Kubernetes name, live deployments first. One item when the reference is unambiguous.
find_agent
¶
The one deployment agent names, as returned by GET /agents.
Raises LookupError when nothing or several deployments match.
agent_endpoint
¶
The URL of a deployed agent, found by name, id or short id.
Parameters¶
agent : str
Deployment name (e.g. 'tdfs4ds-propensity-demo'), UUID, or the short
id the Playground shows.
invoke : bool, default False
False: the agent's base URL, what deploy_to_agentops reports as
agent_url and check_deployed_agent takes. True: the /invoke
route a client POSTs a question to.
token, base_url
As for :class:AgentOpsClient (in an AI Studio notebook, %gen_token).
Raises¶
LookupError No deployment, several, or the deployment is not active (no URL to call).