Class: PromptBuilder::Serializers::Converse::Response
- Defined in:
- lib/prompt_builder/serializers/converse/response.rb
Overview
Response parser for the Amazon Bedrock Converse API format.
Constant Summary collapse
- RESPONSE_ID_HEADER =
The response id header set by Bedrock (the AWS request metadata id).
"x-amzn-requestid"
Class Method Summary collapse
-
.parse_response(hash, headers: nil) ⇒ PromptBuilder::Response
Parse a Converse response into a PromptBuilder::Response.
Methods inherited from Base
Class Method Details
.parse_response(hash, headers: nil) ⇒ PromptBuilder::Response
Parse a Converse response into a PromptBuilder::Response. The
Converse API does not include a response id in the body; Bedrock
returns it in the request metadata headers, so the id is read
from headers when they are given.
23 24 25 26 |
# File 'lib/prompt_builder/serializers/converse/response.rb', line 23 def parse_response(hash, headers: nil) check_error_response!(hash) deserialize_response(hash, headers) end |