Class: LLM::Bedrock::Models
- Inherits:
-
Object
- Object
- LLM::Bedrock::Models
- Defined in:
- lib/llm/providers/bedrock/models.rb
Overview
The Models class provides a model object for interacting with [AWS Bedrock’s ListFoundationModels API]( docs.aws.amazon.com/bedrock/latest/APIReference/API_ListFoundationModels.html).
Unlike the Converse API (which lives on ‘bedrock-runtime.<region>.amazonaws.com`), the models endpoint lives on the control plane at `bedrock.<region>.amazonaws.com`. This class manages its own HTTP connection since the provider’s transport is pinned to the runtime host.
Instance Method Summary collapse
-
#all(**params) ⇒ LLM::Response
List all foundation models available in the configured region.
- #initialize(provider) ⇒ LLM::Bedrock::Models constructor
Constructor Details
#initialize(provider) ⇒ LLM::Bedrock::Models
25 26 27 |
# File 'lib/llm/providers/bedrock/models.rb', line 25 def initialize(provider) @provider = provider end |
Instance Method Details
#all(**params) ⇒ LLM::Response
Note:
This calls AWS Bedrock’s ListFoundationModels API which returns all models available in the region, not just the ones the current account is subscribed to.
List all foundation models available in the configured region.
40 41 42 43 |
# File 'lib/llm/providers/bedrock/models.rb', line 40 def all(**params) host = credentials.host handle_response http(host).request(build_request(host, params)) end |