Class: RubyAmazonBedrock::PayloadBuilders::Base
- Inherits:
-
Object
- Object
- RubyAmazonBedrock::PayloadBuilders::Base
- Defined in:
- lib/bedrock_runtime/payload_builders/base.rb
Overview
Base class serves as an abstract class for payload builders. It provides the basic structure and enforces the implementation of certain methods in derived classes.
Direct Known Subclasses
Ai21Labs::Base, Amazon::Base, Amazon::TitanImageGeneratorV1, Anthropic::Base, Cohere::CommandBase, Cohere::EmbedBase, Meta::Base, StabilityAi::Base
Instance Method Summary collapse
-
#build ⇒ Hash
Abstract method to build the payload.
-
#initialize(prompt, options = {}) ⇒ Base
constructor
Initializes a new instance of the Base class.
-
#model_id ⇒ String
Abstract method to retrieve the model ID.
-
#parameters ⇒ Hash
Abstract method to set the model parameters to be sent in the request.
-
#type ⇒ Symbol
Abstract method to retrieve the model type.
Constructor Details
#initialize(prompt, options = {}) ⇒ Base
Initializes a new instance of the Base class.
13 14 15 16 |
# File 'lib/bedrock_runtime/payload_builders/base.rb', line 13 def initialize(prompt, = {}) @prompt = prompt @options = end |
Instance Method Details
#build ⇒ Hash
Abstract method to build the payload.
21 22 23 |
# File 'lib/bedrock_runtime/payload_builders/base.rb', line 21 def build raise NotImplementedError end |
#model_id ⇒ String
Abstract method to retrieve the model ID.
28 29 30 |
# File 'lib/bedrock_runtime/payload_builders/base.rb', line 28 def model_id raise NotImplementedError end |
#parameters ⇒ Hash
Abstract method to set the model parameters to be sent in the request.
35 36 37 |
# File 'lib/bedrock_runtime/payload_builders/base.rb', line 35 def parameters raise NotImplementedError end |
#type ⇒ Symbol
Abstract method to retrieve the model type.
41 42 43 |
# File 'lib/bedrock_runtime/payload_builders/base.rb', line 41 def type :text end |