Class: Anthropic::Resources::Beta::Models
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Models
- Defined in:
- lib/anthropic/resources/beta/models.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Models
constructor
private
A new instance of Models.
-
#list(after_id: nil, before_id: nil, limit: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Beta::BetaModelInfo>
Some parameter documentations has been truncated, see Models::Beta::ModelListParams for more details.
-
#retrieve(model_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaModelInfo
Get a specific model.
Constructor Details
#initialize(client:) ⇒ Models
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 Models.
74 75 76 |
# File 'lib/anthropic/resources/beta/models.rb', line 74 def initialize(client:) @client = client end |
Instance Method Details
#list(after_id: nil, before_id: nil, limit: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Beta::BetaModelInfo>
Some parameter documentations has been truncated, see Models::Beta::ModelListParams for more details.
List available models.
The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/anthropic/resources/beta/models.rb', line 57 def list(params = {}) parsed, = Anthropic::Beta::ModelListParams.dump_request(params) query_params = [:after_id, :before_id, :limit] @client.request( method: :get, path: "v1/models?beta=true", query: parsed.slice(*query_params), headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"), page: Anthropic::Internal::Page, model: Anthropic::Beta::BetaModelInfo, options: ) end |
#retrieve(model_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaModelInfo
Get a specific model.
The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/anthropic/resources/beta/models.rb', line 23 def retrieve(model_id, params = {}) parsed, = Anthropic::Beta::ModelRetrieveParams.dump_request(params) @client.request( method: :get, path: ["v1/models/%1$s?beta=true", model_id], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::BetaModelInfo, options: ) end |