Class: Anthropic::Models::ModelListParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/anthropic/models/model_list_params.rb,
sig/anthropic/models/model_list_params.rbs

Overview

See Also:

  • Anthropic::Resources::Models#list

Defined Under Namespace

Modules: Lifecycle

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize ⇒ ModelListParams

Returns a new instance of ModelListParams.

Parameters:

  • after_id: (String)
  • before_id: (String)
  • lifecycle: (::Array[Anthropic::Models::ModelListParams::lifecycle])
  • limit: (Integer)
  • workspace_id: (String)
  • request_options: (Anthropic::request_opts)


39
40
41
42
43
44
45
46
# File 'sig/anthropic/models/model_list_params.rbs', line 39

def initialize: (
  ?after_id: String,
  ?before_id: String,
  ?lifecycle: ::Array[Anthropic::Models::ModelListParams::lifecycle],
  ?limit: Integer,
  ?workspace_id: String,
  ?request_options: Anthropic::request_opts
) -> void

Instance Attribute Details

#after_id ⇒ String?

ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

Parameters:

  • (String)

Returns:

  • (String, nil)


15
# File 'lib/anthropic/models/model_list_params.rb', line 15

optional :after_id, String

#before_id ⇒ String?

ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

Parameters:

  • (String)

Returns:

  • (String, nil)


22
# File 'lib/anthropic/models/model_list_params.rb', line 22

optional :before_id, String

#lifecycle ⇒ Array<Symbol, Anthropic::Models::ModelListParams::Lifecycle>?

Filter the list to models in any of the given lifecycle stages (active, deprecated, or retired). Up to 3 values. When omitted, the list contains the active and deprecated models; retired models appear only when retired is requested explicitly.

Parameters:

  • (::Array[Anthropic::Models::ModelListParams::lifecycle])

Returns:



31
32
# File 'lib/anthropic/models/model_list_params.rb', line 31

optional :lifecycle,
-> { Anthropic::Internal::Type::ArrayOf[enum: Anthropic::ModelListParams::Lifecycle] }

#limit ⇒ Integer?

Number of items to return per page.

Defaults to 20. Ranges from 1 to 1000.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


40
# File 'lib/anthropic/models/model_list_params.rb', line 40

optional :limit, Integer

#workspace_id ⇒ String?

Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).

Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

Parameters:

  • (String)

Returns:

  • (String, nil)


51
# File 'lib/anthropic/models/model_list_params.rb', line 51

optional :workspace_id, String

Instance Method Details

#to_hash ⇒ { after_id: String, before_id: String, lifecycle: ::Array[Anthropic::Models::ModelListParams::lifecycle], limit: Integer, workspace_id: String, request_options: Anthropic::RequestOptions }

Returns:

  • ({ after_id: String, before_id: String, lifecycle: ::Array[Anthropic::Models::ModelListParams::lifecycle], limit: Integer, workspace_id: String, request_options: Anthropic::RequestOptions })


48
49
50
51
52
53
54
55
# File 'sig/anthropic/models/model_list_params.rbs', line 48

def to_hash: -> {
  after_id: String,
  before_id: String,
  lifecycle: ::Array[Anthropic::Models::ModelListParams::lifecycle],
  limit: Integer,
  workspace_id: String,
  request_options: Anthropic::RequestOptions
}