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

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

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:



43
44
45
# File 'lib/anthropic/resources/beta/agents/versions.rb', line 43

def initialize(client:)
  @client = client
end

Instance Method Details

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

List Agent Versions

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.

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

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/anthropic/resources/beta/agents/versions.rb', line 25

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"),
    page: Anthropic::Internal::PageCursor,
    model: Anthropic::Beta::BetaManagedAgentsAgent,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end