Skip to content

Rollback to Agent Version

client.Agents.Versions.Update(ctx, uuid, body) (*AgentVersionUpdateResponse, error)
put/v2/gen-ai/agents/{uuid}/versions

To update to a specific agent version, send a PUT request to /v2/gen-ai/agents/{uuid}/versions.

ParametersExpand Collapse
uuid string
body AgentVersionUpdateParams
Uuid param.Field[string]optional

Agent unique identifier

VersionHash param.Field[string]optional

Unique identifier

ReturnsExpand Collapse
type AgentVersionUpdateResponse struct{…}
AuditHeader AgentVersionUpdateResponseAuditHeaderoptional

An alternative way to provide auth information. for internal use only.

ActorID stringoptional
formatuint64
ActorIP stringoptional
ActorUuid stringoptional
ContextUrn stringoptional
OriginApplication stringoptional
UserID stringoptional
formatuint64
UserUuid stringoptional
VersionHash stringoptional

Unique identifier

Rollback to Agent Version
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"),
  )
  version, err := client.Agents.Versions.Update(
    context.TODO(),
    `"123e4567-e89b-12d3-a456-426614174000"`,
    gradient.AgentVersionUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", version.AuditHeader)
}
{
  "audit_header": {
    "actor_id": "12345",
    "actor_ip": "example string",
    "actor_uuid": "123e4567-e89b-12d3-a456-426614174000",
    "context_urn": "example string",
    "origin_application": "example string",
    "user_id": "12345",
    "user_uuid": "123e4567-e89b-12d3-a456-426614174000"
  },
  "version_hash": "example string"
}
Returns Examples
{
  "audit_header": {
    "actor_id": "12345",
    "actor_ip": "example string",
    "actor_uuid": "123e4567-e89b-12d3-a456-426614174000",
    "context_urn": "example string",
    "origin_application": "example string",
    "user_id": "12345",
    "user_uuid": "123e4567-e89b-12d3-a456-426614174000"
  },
  "version_hash": "example string"
}