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
25 26 27 |
# File 'lib/llm/providers/anthropic/models.rb', line 25 def initialize(provider) @provider = provider end |
Instance Method Details
#all(**params) ⇒ LLM::Response
List all models
41 42 43 44 45 46 |
# File 'lib/llm/providers/anthropic/models.rb', line 41 def all(**params) query = URI.encode_www_form(params) req = Net::HTTP::Get.new("/v1/models?#{query}", headers) res = execute(request: req) LLM::Response.new(res).extend(LLM::Anthropic::Response::Enumerable) end |