Class: LLM::Anthropic::Models
- Inherits:
-
Object
- Object
- LLM::Anthropic::Models
- Defined in:
- lib/llm/providers/anthropic/models.rb
Overview
The LLM::Anthropic::Models class provides a model object for interacting with Anthropic's models API. The models API allows a client to query Anthropic for a list of models that are available for use with the Anthropic API.
Instance Method Summary collapse
-
#initialize(provider)
⇒ LLM::Anthropic::Files constructor
Returns a new Models object.
-
#all(**params) ⇒
LLM::Response
List all models.
Constructor Details
#initialize(provider) ⇒ LLM::Anthropic::Files
Returns a new Models object
24 25 26 |
# File 'lib/llm/providers/anthropic/models.rb', line 24 def initialize(provider) @provider = provider end |
Instance Method Details
#all(**params) ⇒ LLM::Response
List all models
40 41 42 43 44 45 46 |
# File 'lib/llm/providers/anthropic/models.rb', line 40 def all(**params) query = URI.encode_www_form(params) req = Net::HTTP::Get.new("/v1/models?#{query}", headers) res, span = execute(request: req, operation: "request") res = ResponseAdapter.adapt(res, type: :enumerable) finish_trace(operation: "request", res:, span:) end |