Class: Anthropic::Resources::Beta::Agents::Versions

Inherits:
Object
  • Object
show all
Defined in:
lib/anthropic/resources/beta/agents/versions.rb,
sig/anthropic/resources/beta/agents/versions.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Versions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Versions.

Parameters:



51
52
53
# File 'lib/anthropic/resources/beta/agents/versions.rb', line 51

def initialize(client:)
  @client = client
end

Instance Method Details

#list(agent_id, limit: nil, page: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaManagedAgentsAgent>

List Agent Versions

Some parameter documentations has been truncated, see Models::Beta::Agents::VersionListParams for more details.

Parameters:

  • agent_id (String)

    Path param: Path parameter agent_id

  • limit (Integer)

    Query param: Maximum results per page. Default 20, maximum 100.

  • page (String)

    Query param: Opaque pagination cursor.

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Header param: Optional header to select the Workspace for this request. The valu

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/anthropic/resources/beta/agents/versions.rb', line 30

def list(agent_id, params = {})
  query_params = [:limit, :page]
  parsed, options = Anthropic::Beta::Agents::VersionListParams.dump_request(params)
  query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :get,
    path: ["v1/agents/%1$s/versions?beta=true", agent_id],
    query: query,
    headers: parsed.except(*query_params).transform_keys(
      betas: "anthropic-beta",
      workspace_id: "anthropic-workspace-id"
    ),
    page: Anthropic::Internal::PageCursor,
    model: Anthropic::Beta::BetaManagedAgentsAgent,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end