Class: PromptBuilder::Serializers::Converse::Request
- Defined in:
- lib/prompt_builder/serializers/converse/request.rb
Overview
Request serializer for the Amazon Bedrock Converse API format.
Unsupported Open Responses features
These session fields are not supported and are silently omitted from the serialized output:
-
background— background/async mode is not supported on the Converse endpoint -
frequency_penalty— not supported by the Converse API -
include— response-field inclusion is an Open Responses-only concept -
max_tool_calls— per-request tool-call caps are not supported -
parallel_tool_calls— parallel tool call control is not supported -
presence_penalty— not supported by the Converse API -
prompt_cache_key/prompt_cache_retention— explicit prompt cache keys are not supported -
reasoning— extended thinking is not supported on the Converse endpoint -
safety_identifier— no equivalent user-safety field on the Converse endpoint -
store— server-side response storage is not supported -
stream— SSE streaming is handled outside the Converse request payload -
stream_options— stream event options are not supported -
top_logprobs— log probability output is not supported -
truncation— server-side context truncation is not supported
Partially supported session fields (unsupported keys/values are omitted):
-
metadata— only scalar values are forwarded torequestMetadata; Hash/Array values are omitted -
text— only format.type == “json_schema” is supported
Tool choice restrictions:
-
tool_choice: “none” has no Converse representation and is omitted
Input content restrictions:
-
Reasoningitems are silently skipped -
RefusalContentis dropped silently (a parsed response refusal can stay in session history without breaking subsequent request_payload calls) -
OutputText.annotationsandOutputText.logprobsare dropped silently -
InputImagecontent is only supported in user messages (assistant images are omitted) -
InputImage.detailandInputImage.file_idare silently ignored -
InputFilecontent is only supported in user messages (assistant files are omitted) -
InputFile.file_idis silently ignored -
InputVideocontent is only supported in user messages (assistant videos are omitted) -
InputImagerequires base64dataor an S3 URI (s3://...); content with a public URL is omitted -
InputFilerequires base64file_dataor an S3 URI; format is detected from the filename orfile_urlextension -
InputVideorequires an S3 URI (s3://...); a non-S3 URL is omitted -
Tool (
FunctionCallOutput) results support text, image, document, and video content; other content is omitted
Features in Converse not available through Open Responses
The following Converse parameters cannot be set through the Open Responses canonical format:
-
stopSequences— custom stop sequences -
Guardrail policies (
guardrailConfig) -
Per-model passthrough fields (
additionalModelRequestFields) -
Requested provider response fields (
additionalModelResponseFieldPaths) -
Cross-region routing via inference profiles
-
performanceConfiglatency settings beyondserviceTier -
Prompt management variables (
promptVariables) -
Prompt caching markers (
cachePoint)
Constant Summary collapse
- IMAGE_MEDIA_TYPE_FORMATS =
{ "image/jpeg" => "jpeg", "image/jpg" => "jpeg", "image/png" => "png", "image/gif" => "gif", "image/webp" => "webp" }.freeze
- IMAGE_URL_EXTENSION_FORMATS =
{ "jpg" => "jpeg", "jpeg" => "jpeg", "png" => "png", "gif" => "gif", "webp" => "webp" }.freeze
- DOCUMENT_FILENAME_EXTENSION_FORMATS =
{ "pdf" => "pdf", "csv" => "csv", "doc" => "doc", "docx" => "docx", "xls" => "xls", "xlsx" => "xlsx", "html" => "html", "htm" => "html", "txt" => "txt", "md" => "md", "markdown" => "md" }.freeze
- VIDEO_URL_EXTENSION_FORMATS =
{ "mkv" => "mkv", "mov" => "mov", "mp4" => "mp4", "webm" => "webm", "flv" => "flv", "mpeg" => "mpeg", "mpg" => "mpeg", "wmv" => "wmv", "3gp" => "three_gp" }.freeze