BoundaryML/baml · error
not yet implemented
Error message
not yet implemented
What it means
This panic comes from a Rust `todo!()` in media_to_content_block_json when converting a chat media part for AWS Bedrock modular (Converse) requests. When the media content is a local file reference (BamlMediaContent::File), the AWS path has no implementation, so it panics with "not yet implemented" instead of returning a graceful error. It is a library limitation, not a problem with your model config.
Source
Thrown at engine/baml-runtime/src/internal/llm_client/primitive/aws/aws_client.rs:82
},
json_body,
tracingv2::storage::storage::BAML_TRACER,
JsonBodyInput, RenderCurlSettings, RuntimeContext,
};
// Strip the MIME type prefix ("type/subtype" -> "subtype").
fn strip_mime_prefix(mime: &str) -> &str {
mime.split_once('/').map(|(_, s)| s).unwrap_or(mime)
}
fn media_to_content_block_json(media: &BamlMedia) -> Result<serde_json::Value> {
let content_block = {
let mut obj = Map::new();
if let Some(mime) = media.mime_type.as_deref() {
obj.insert("format".into(), json!(strip_mime_prefix(mime)));
}
let source = match &media.content {
BamlMediaContent::File(media_file) => todo!(),
BamlMediaContent::Url(url) => {
let parsed = Url::parse(&url.url).with_context(|| {
format!("Invalid S3 URI for AWS Bedrock video source: {url}")
})?;
if parsed.scheme() != "s3" {
anyhow::bail!("AWS Bedrock requires s3:// URIs, but got: {}", url.url);
}
// unimplemented!("make sure the test works")
json!({
"s3Location": {
"uri": url.url,
}
})
}
BamlMediaContent::Base64(base64) => json!({
"bytes": base64.base64,View on GitHub (pinned to bd85ce9dee)
Solutions
- Pass the media as a base64 data URL (e.g. data:image/png;base64,...) or an https:// URL rather than a local file path.
- Set resolve_media_urls / media resolution options so BAML inlines file media into base64 before reaching the AWS client.
- If you need file media on Bedrock, file an issue with BAML to implement BamlMediaContent::File in aws_client.rs, or patch the match arm to base64-encode the file.
Example fix
// before media b "baml://./video.mp4" // after media b "data:video/mp4;base64,AAAAIGZ0eXBpc29t..."
Defensive patterns
Strategy: validation
Validate before calling
if media.content is a local file reference:
# resolve to base64 before sending to aws-bedrock
media = to_base64_data_url(media) Type guard
def is_bedrock_safe_media(media) -> bool:
c = media['content']
return isinstance(c, dict) and ('base64' in c or str(c.get('url','')).startswith(('s3://', 'data:'))) Prevention
- Always pass media as base64 data URLs or s3:// URIs for aws-bedrock clients
- Keep local-file media confined to providers that support file references
- Check BAML release notes for Bedrock multimodal file support before upgrading prompts
When it happens
Trigger: Calling chat/stream_chat on an aws-bedrock client whose rendered message contains a media part (image/pdf/video/audio) loaded from a local File (e.g. baml './file.png' or file:// content) instead of a URL or base64 payload.
Common situations: Developers testing Bedrock multimodal (e.g. Nova video) prompts with media referenced from local disk; CI environments where media was expected to be resolved to base64 but stayed as a file reference.
Related errors
- exprs that evaluate to lambda
- AWS Bedrock requires s3:// URIs, but got: {}
- AWS Bedrock only supports text system blocks, but got {other
- Invalid client property. Should have been a aws-bedrock prop
- AWS Bedrock modular streaming is not supported. Use non-stre
AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12).
Data as JSON: /api/errors/6de86311d23b46ed.
Report an issue: GitHub.