Class: LLM::Bedrock::RequestAdapter::Completion Private
- Inherits:
-
Object
- Object
- LLM::Bedrock::RequestAdapter::Completion
- Defined in:
- lib/llm/providers/bedrock/request_adapter/completion.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Adapts a single message to Bedrock Converse content blocks.
Bedrock Converse content blocks include:
- {text: "..."}
- {image: {format: "png", source: {bytes: "..."}}}
- {document: {format: "pdf", name: "...", source: {bytes: "..."}}}
- {toolUse: {toolUseId: "...", name: "...", input: {...}}}
- {toolResult: {toolUseId: "...", content: [{text: "..."}]}}
Instance Method Summary collapse
-
#adapt ⇒ Hash?
private
Adapts the message for the Bedrock Converse API.
-
#initialize(message) ⇒ Completion
constructor
private
A new instance of Completion.
Constructor Details
#initialize(message) ⇒ Completion
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Completion.
18 19 20 |
# File 'lib/llm/providers/bedrock/request_adapter/completion.rb', line 18 def initialize() @message = end |
Instance Method Details
#adapt ⇒ Hash?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Adapts the message for the Bedrock Converse API
25 26 27 28 29 30 31 32 33 |
# File 'lib/llm/providers/bedrock/request_adapter/completion.rb', line 25 def adapt catch(:abort) do if Hash === {role: [:role], content: adapt_content([:content])} else end end end |