Skip to content

Update Agent Route for an Agent

client.Agents.Routes.Update(ctx, parentAgentUuid, childAgentUuid, body) (*AgentRouteUpdateResponse, error)
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
parentAgentUuid string
childAgentUuid string
body AgentRouteUpdateParams
ChildAgentUuid param.Field[string]optional

Routed agent id

IfCase param.Field[string]optional

Describes the case in which the child agent should be used

ParentAgentUuid param.Field[string]optional

A unique identifier for the parent agent.

RouteName param.Field[string]optional

Route name

Uuid param.Field[string]optional

Unique id of linkage

ReturnsExpand Collapse
type AgentRouteUpdateResponse struct{…}

Information about an updated linkage

ChildAgentUuid stringoptional

Routed agent id

ParentAgentUuid stringoptional

A unique identifier for the parent agent.

Rollback booloptional
Uuid stringoptional

Unique id of linkage

Update Agent Route for an Agent
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := gradient.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  route, err := client.Agents.Routes.Update(
    context.TODO(),
    `"123e4567-e89b-12d3-a456-426614174000"`,
    `"123e4567-e89b-12d3-a456-426614174000"`,
    gradient.AgentRouteUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", route.ChildAgentUuid)
}
{
  "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"
}