Skip to content
  • Auto
  • Light
  • Dark

Update

Update Agent Route for an Agent
client.agents.routes.update(stringchildAgentUuid, RouteUpdateParams { body_parent_agent_uuid, child_agent_uuid, if_case, 2 more } params, RequestOptionsoptions?): RouteUpdateResponse { child_agent_uuid, parent_agent_uuid, rollback, uuid }
put/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}

To update an agent route for an agent, send a PUT request to /v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}.

ParametersExpand Collapse
childAgentUuid: string
params: RouteUpdateParams { body_parent_agent_uuid, child_agent_uuid, if_case, 2 more }
body_parent_agent_uuid?: string

Body param: A unique identifier for the parent agent.

child_agent_uuid?: string

Body param: Routed agent id

if_case?: string

Body param: Describes the case in which the child agent should be used

route_name?: string

Body param: Route name

uuid?: string

Body param: Unique id of linkage

ReturnsExpand Collapse
RouteUpdateResponse { child_agent_uuid, parent_agent_uuid, rollback, uuid }

Information about an updated linkage

child_agent_uuid?: string

Routed agent id

parent_agent_uuid?: string

A unique identifier for the parent agent.

rollback?: boolean
uuid?: string

Unique id of linkage

Update Agent Route for an Agent
import Gradient from '@digitalocean/gradient';

const client = new Gradient();

const route = await client.agents.routes.update('"123e4567-e89b-12d3-a456-426614174000"', {
  path_parent_agent_uuid: '"123e4567-e89b-12d3-a456-426614174000"',
});

console.log(route.child_agent_uuid);
{
  "child_agent_uuid": "123e4567-e89b-12d3-a456-426614174000",
  "parent_agent_uuid": "123e4567-e89b-12d3-a456-426614174000",
  "rollback": true,
  "uuid": "123e4567-e89b-12d3-a456-426614174000"
}
Returns Examples
{
  "child_agent_uuid": "123e4567-e89b-12d3-a456-426614174000",
  "parent_agent_uuid": "123e4567-e89b-12d3-a456-426614174000",
  "rollback": true,
  "uuid": "123e4567-e89b-12d3-a456-426614174000"
}