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.
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 builds a matching
transport for the control-plane host from the provider's current
transport class.
Instance Method Summary collapse
- #initialize(provider) ⇒ LLM::Bedrock::Models constructor
-
#all(**params) ⇒ LLM::Response
List all foundation models available in the configured region.
Constructor Details
#initialize(provider) ⇒ LLM::Bedrock::Models
26 27 28 |
# File 'lib/llm/providers/bedrock/models.rb', line 26 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.
41 42 43 44 45 46 |
# File 'lib/llm/providers/bedrock/models.rb', line 41 def all(**params) host = credentials.host req = build_request(host, params) res = build_transport(host).request(req, owner: self) handle_response(res) end |