Skip to content

List Agent Versions

client.Agents.Versions.List(ctx, uuid, query) (*AgentVersionListResponse, error)
get/v2/gen-ai/agents/{uuid}/versions

To list all agent versions, send a GET request to /v2/gen-ai/agents/{uuid}/versions.

ParametersExpand Collapse
uuid string
query AgentVersionListParams
Page param.Field[int64]optional

Page number.

PerPage param.Field[int64]optional

Items per page.

ReturnsExpand Collapse
type AgentVersionListResponse struct{…}

List of agent versions

AgentVersions []AgentVersionListResponseAgentVersionoptional

Agents

ID stringoptional

Unique identifier

formatuint64
AgentUuid stringoptional

Uuid of the agent this version belongs to

AttachedChildAgents []AgentVersionListResponseAgentVersionsAttachedChildAgentoptional

List of child agent relationships

AgentName stringoptional

Name of the child agent

ChildAgentUuid stringoptional

Child agent unique identifier

IfCase stringoptional

If case

IsDeleted booloptional

Child agent is deleted

RouteName stringoptional

Route name

AttachedFunctions []AgentVersionListResponseAgentVersionsAttachedFunctionoptional

List of function versions

Description stringoptional

Description of the function

FaasName stringoptional

FaaS name of the function

FaasNamespace stringoptional

FaaS namespace of the function

IsDeleted booloptional

Whether the function is deleted

Name stringoptional

Name of the function

AttachedGuardrails []AgentVersionListResponseAgentVersionsAttachedGuardrailoptional

List of guardrail version

IsDeleted booloptional

Whether the guardrail is deleted

Name stringoptional

Guardrail Name

Priority int64optional

Guardrail Priority

formatint64
Uuid stringoptional

Guardrail UUID

AttachedKnowledgebases []AgentVersionListResponseAgentVersionsAttachedKnowledgebaseoptional

List of knowledge base agent versions

IsDeleted booloptional

Deletet at date / time

Name stringoptional

Name of the knowledge base

Uuid stringoptional

Unique id of the knowledge base

CanRollback booloptional

Whether the version is able to be rolled back to

CreatedAt Timeoptional

Creation date

formatdate-time
CreatedByEmail stringoptional

User who created this version

CurrentlyApplied booloptional

Whether this is the currently applied configuration

Description stringoptional

Description of the agent

Instruction stringoptional

Instruction for the agent

K int64optional

K value for the agent's configuration

formatint64
MaxTokens int64optional

Max tokens setting for the agent

formatint64
ModelName stringoptional

Name of model associated to the agent version

Name stringoptional

Name of the agent

ProvideCitations booloptional

Whether the agent should provide in-response citations

RetrievalMethod APIRetrievalMethodoptional
  • RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown
  • RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite
  • RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back
  • RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries
  • RETRIEVAL_METHOD_NONE: The retrieval method is none
Accepts one of the following:
const APIRetrievalMethodRetrievalMethodUnknown APIRetrievalMethod = "RETRIEVAL_METHOD_UNKNOWN"
const APIRetrievalMethodRetrievalMethodRewrite APIRetrievalMethod = "RETRIEVAL_METHOD_REWRITE"
const APIRetrievalMethodRetrievalMethodStepBack APIRetrievalMethod = "RETRIEVAL_METHOD_STEP_BACK"
const APIRetrievalMethodRetrievalMethodSubQueries APIRetrievalMethod = "RETRIEVAL_METHOD_SUB_QUERIES"
const APIRetrievalMethodRetrievalMethodNone APIRetrievalMethod = "RETRIEVAL_METHOD_NONE"
Tags []stringoptional

Tags associated with the agent

Temperature float64optional

Temperature setting for the agent

formatfloat
TopP float64optional

Top_p setting for the agent

formatfloat
TriggerAction stringoptional

Action triggering the configuration update

VersionHash stringoptional

Version hash

Meta APIMetaoptional

Meta information about the data set

Page int64optional

The current page

formatint64
Pages int64optional

Total number of pages

formatint64
Total int64optional

Total amount of items over all pages

formatint64
List Agent Versions
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"),
  )
  versions, err := client.Agents.Versions.List(
    context.TODO(),
    `"123e4567-e89b-12d3-a456-426614174000"`,
    gradient.AgentVersionListParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", versions.AgentVersions)
}
{
  "agent_versions": [
    {
      "id": "12345",
      "agent_uuid": "123e4567-e89b-12d3-a456-426614174000",
      "attached_child_agents": [
        {
          "agent_name": "example name",
          "child_agent_uuid": "123e4567-e89b-12d3-a456-426614174000",
          "if_case": "example string",
          "is_deleted": true,
          "route_name": "example name"
        }
      ],
      "attached_functions": [
        {
          "description": "example string",
          "faas_name": "example name",
          "faas_namespace": "example name",
          "is_deleted": true,
          "name": "example name"
        }
      ],
      "attached_guardrails": [
        {
          "is_deleted": true,
          "name": "example name",
          "priority": 123,
          "uuid": "123e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "attached_knowledgebases": [
        {
          "is_deleted": true,
          "name": "example name",
          "uuid": "123e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "can_rollback": true,
      "created_at": "2023-01-01T00:00:00Z",
      "created_by_email": "example@example.com",
      "currently_applied": true,
      "description": "example string",
      "instruction": "example string",
      "k": 123,
      "max_tokens": 123,
      "model_name": "example name",
      "name": "example name",
      "provide_citations": true,
      "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN",
      "tags": [
        "example string"
      ],
      "temperature": 123,
      "top_p": 123,
      "trigger_action": "example string",
      "version_hash": "example string"
    }
  ],
  "links": {
    "pages": {
      "first": "example string",
      "last": "example string",
      "next": "example string",
      "previous": "example string"
    }
  },
  "meta": {
    "page": 123,
    "pages": 123,
    "total": 123
  }
}
Returns Examples
{
  "agent_versions": [
    {
      "id": "12345",
      "agent_uuid": "123e4567-e89b-12d3-a456-426614174000",
      "attached_child_agents": [
        {
          "agent_name": "example name",
          "child_agent_uuid": "123e4567-e89b-12d3-a456-426614174000",
          "if_case": "example string",
          "is_deleted": true,
          "route_name": "example name"
        }
      ],
      "attached_functions": [
        {
          "description": "example string",
          "faas_name": "example name",
          "faas_namespace": "example name",
          "is_deleted": true,
          "name": "example name"
        }
      ],
      "attached_guardrails": [
        {
          "is_deleted": true,
          "name": "example name",
          "priority": 123,
          "uuid": "123e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "attached_knowledgebases": [
        {
          "is_deleted": true,
          "name": "example name",
          "uuid": "123e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "can_rollback": true,
      "created_at": "2023-01-01T00:00:00Z",
      "created_by_email": "example@example.com",
      "currently_applied": true,
      "description": "example string",
      "instruction": "example string",
      "k": 123,
      "max_tokens": 123,
      "model_name": "example name",
      "name": "example name",
      "provide_citations": true,
      "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN",
      "tags": [
        "example string"
      ],
      "temperature": 123,
      "top_p": 123,
      "trigger_action": "example string",
      "version_hash": "example string"
    }
  ],
  "links": {
    "pages": {
      "first": "example string",
      "last": "example string",
      "next": "example string",
      "previous": "example string"
    }
  },
  "meta": {
    "page": 123,
    "pages": 123,
    "total": 123
  }
}