Skip to content
  • Auto
  • Light
  • Dark

Add

Add Agent Route to an Agent
client.agents.routes.add(stringchildAgentUuid, RouteAddParams { body_parent_agent_uuid, child_agent_uuid, if_case, route_name } params, RequestOptionsoptions?): RouteAddResponse { child_agent_uuid, parent_agent_uuid }
post/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}

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

ParametersExpand Collapse
childAgentUuid: string
params: RouteAddParams { body_parent_agent_uuid, child_agent_uuid, if_case, route_name }
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:

route_name?: string

Body param: Name of route

ReturnsExpand Collapse
RouteAddResponse { child_agent_uuid, parent_agent_uuid }

Information about a newly linked agent

child_agent_uuid?: string

Routed agent id

parent_agent_uuid?: string

A unique identifier for the parent agent.

Add Agent Route to an Agent
import Gradient from '@digitalocean/gradient';

const client = new Gradient();

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

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