Skip to content

Commit 219e53f

Browse files
authored
Set citations field for Bedrock PDFs (#2547)
1 parent 109612a commit 219e53f

File tree

4 files changed

+51
-63
lines changed

4 files changed

+51
-63
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
branches:
2020
- gofix2
2121
- cursor/implement-collector-clear-and-update-docs-7c67
22+
- greg/bedrock-pdf-citations
2223
concurrency:
2324
# No suffix specified - in reusable workflows we need a statically-defined suffix
2425
# to prevent workflow_call workflows from triggering a concurrency deadlock

engine/Cargo.lock

Lines changed: 44 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/baml-runtime/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ aws-config = { version = "=1.5.3", default-features = false, features = [] }
135135
# https://github.com/awslabs/aws-sdk-rust/issues/1263
136136
# same goes for aws-config.
137137
# Potential migration https://docs.aws.amazon.com/sdk-for-rust/latest/dg/http.html#tlsProviders
138-
aws-sdk-bedrockruntime = { version = "=1.76.0", default-features = false, features = [
138+
aws-sdk-bedrockruntime = { version = "=1.106.0", default-features = false, features = [
139139

140140
] }
141141
colored = { workspace = true, default-features = false, features = [
@@ -170,7 +170,7 @@ aws-config = "=1.5.3"
170170
# https://github.com/awslabs/aws-sdk-rust/issues/1263
171171
# same goes for aws-config.
172172
# Potential migration https://docs.aws.amazon.com/sdk-for-rust/latest/dg/http.html#tlsProviders
173-
aws-sdk-bedrockruntime = { version = "=1.76.0", default-features = false, features = [
173+
aws-sdk-bedrockruntime = { version = "=1.106.0", default-features = false, features = [
174174
] }
175175
axum = "0.7.5"
176176
axum-extra = { version = "0.9.3", features = ["erased-json", "typed-header"] }

engine/baml-runtime/src/internal/llm_client/primitive/aws/aws_client.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use aws_sdk_bedrockruntime::{
1616
self as bedrock,
1717
config::{Intercept, StalledStreamProtectionConfig},
1818
operation::converse::ConverseOutput,
19+
types::CitationsConfig,
1920
Client as BedrockRuntimeClient,
2021
};
2122
use aws_smithy_json::serialize::JsonObjectWriter;
@@ -1083,6 +1084,9 @@ impl AwsClient {
10831084
.set_source(Some(bedrock::types::DocumentSource::Bytes(Blob::new(
10841085
url_media.url.as_bytes().to_vec(),
10851086
))))
1087+
.set_citations(Some(
1088+
CitationsConfig::builder().set_enabled(Some(true)).build()?,
1089+
))
10861090
.build()
10871091
.context("Failed to build Pdf document block")?,
10881092
))

0 commit comments

Comments
 (0)