{"record":{"id":"e596d600251bf662","repo":"BoundaryML/baml","slug":"aws-bedrock-modular-streaming-is-not-supported-use-non","errorCode":null,"errorMessage":"AWS Bedrock modular streaming is not supported. Use non-streaming modular requests.","messagePattern":"AWS Bedrock modular streaming is not supported\\. Use non-streaming modular requests\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/internal/llm_client/primitive/aws/aws_client.rs","lineNumber":427,"sourceCode":"        }\n\n        if !self.properties.additional_model_request_fields.is_empty() {\n            let addl = serde_json::to_value(&self.properties.additional_model_request_fields)?;\n            root.insert(\"additionalModelRequestFields\".into(), addl);\n        }\n\n        Ok(root)\n    }\n\n    pub async fn build_modular_http_request(\n        &self,\n        ctx: &RuntimeContext,\n        chat_messages: &[RenderedChatMessage],\n        stream: bool,\n        request_id: HttpRequestId,\n    ) -> Result<HTTPRequest> {\n        if stream {\n            anyhow::bail!(\n                \"AWS Bedrock modular streaming is not supported. Use non-streaming modular requests.\"\n            );\n        }\n\n        let region = self.properties.region.clone().unwrap_or_else(|| {\n            ctx.env_vars()\n                .get(\"AWS_REGION\")\n                .cloned()\n                .unwrap_or_default()\n        });\n\n        if region.is_empty() {\n            anyhow::bail!(\n                \"AWS region is required to build modular request. Set it in the client options or via AWS_REGION.\"\n            );\n        }\n\n        let body_string = serde_json::to_string(&serde_json::Value::Object(","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/internal/llm_client/primitive/aws/aws_client.rs#L409-L445","documentation":"build_modular_http_request constructs a non-streaming Converse HTTP request for the Bedrock modular API path, and it explicitly rejects stream=true by bailing with this message. Streaming responses for this request path were simply not implemented, so the client fails fast instead of sending a request Bedrock would reject or hang on.","triggerScenarios":"Calling stream_chat (or any streaming entry point) on an aws-bedrock client that is configured to use the modular request-building path.","commonSituations":"Developers adding streaming to a Bedrock-based prompt after using non-streaming chat; UI code that always calls the streaming API regardless of provider support.","solutions":["Use the non-streaming chat API (BAML function call without stream) for this aws-bedrock client.","Branch in your application code: call stream_chat only for providers that support it, falling back to chat for Bedrock modular clients.","Check for a newer BAML version that adds Bedrock modular streaming support, or file/upvote an issue."],"exampleFix":"// before\nlet stream = baml_client.stream.MyFunction(ctx, args)\n// after\nlet res = baml_client.MyFunction(ctx, args) // non-streaming for aws-bedrock modular","handlingStrategy":"fallback","validationCode":"if provider == 'aws-bedrock':\n    use streaming = False  # modular path rejects stream=True","typeGuard":null,"tryCatchPattern":"try:\n    result = stream_chat(...)\nexcept Exception as e:\n    if 'modular streaming is not supported' in str(e):\n        result = chat(...)  # fallback to non-streaming\n    else:\n        raise","preventionTips":["Feature-detect streaming support per provider before calling stream_chat","Default aws-bedrock modular clients to non-streaming calls","Track BAML releases for modular streaming support"],"tags":["aws","bedrock","streaming","unsupported","modular"],"backgroundTag":"unsupported-operation","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}