Skip to content

Bedrock modular api#2526

Merged
imalsogreg merged 1 commit into
canaryfrom
greg/modular-bedrock
Sep 26, 2025
Merged

Bedrock modular api#2526
imalsogreg merged 1 commit into
canaryfrom
greg/modular-bedrock

Conversation

@imalsogreg
Copy link
Copy Markdown
Contributor

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.

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
promptfiddle Canceled Canceled Sep 26, 2025 11:59pm

@entelligence-ai-pr-reviews
Copy link
Copy Markdown

🔒 Entelligence AI Vulnerability Scanner

No security vulnerabilities found!

Your code passed our comprehensive security analysis.


@entelligence-ai-pr-reviews
Copy link
Copy Markdown

Review Summary

response.raise_for_status()

payload = response.json()
message = payload["output"]["message"]["content"][0]["text"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@github-actions
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 0% with 156 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rc/internal/llm_client/primitive/aws/aws_client.rs 0.00% 144 Missing ⚠️
engine/baml-runtime/src/lib.rs 0.00% 12 Missing ⚠️

📢 Thoughts on this report? Let us know!

@imalsogreg imalsogreg added this pull request to the merge queue Sep 26, 2025
Merged via the queue into canary with commit 42dfef3 Sep 26, 2025
23 of 25 checks passed
@imalsogreg imalsogreg deleted the greg/modular-bedrock branch September 26, 2025 23:58
@github-actions
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant