Bedrock modular api#2526
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
32a5e13 to
0d2a176
Compare
0d2a176 to
1c34267
Compare
|
🔒 Entelligence AI Vulnerability Scanner ✅ No security vulnerabilities found! Your code passed our comprehensive security analysis. |
Review Summary |
| response.raise_for_status() | ||
|
|
||
| payload = response.json() | ||
| message = payload["output"]["message"]["content"][0]["text"] |
There was a problem hiding this comment.
correctness: payload["output"]["message"]["content"][0]["text"] in the Python example assumes content is a non-empty list, which will raise IndexError if the model returns an empty or missing content array.
🤖 AI Agent Prompt for Cursor/Windsurf
📋 Copy this prompt to your AI coding assistant (Cursor, Windsurf, etc.) to get help fixing this issue
In fern/03-reference/baml/clients/providers/aws-bedrock.mdx, on line 583, the code `message = payload["output"]["message"]["content"][0]["text"]` assumes that the `content` list is non-empty and contains a dict with a `text` key. This will raise an IndexError if the list is empty or missing. Please update this line to safely extract the first `text` value from the content list, or return an empty string if not present. Use a robust approach that avoids IndexError and KeyError.
tweaks debug request
1c34267 to
95514a2
Compare
|
🌿 Preview your docs: https://boundary-preview-c33daba4-ed4f-420f-a8a5-06f1e05ff657.docs.buildwithfern.com |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Modular API didn't support Bedrock because a Bedrock relies on the aws-sdk for constructing and signing requests - HTTP requests aren't naturally exposed to the user with that SDK.
To get around this, we take an intermediate object and serialize that to JSON to produce something resembling an HTTP request that users can modify.
To send the request after modification, it must be signed again. We have new docs describing this process.