Summary
The Braintrust Rust SDK has no instrumentation for aws-sdk-polly, AWS's official Rust SDK crate for Amazon Polly, AWS's text-to-speech (speech synthesis) generative-audio service. Braintrust's own OpenAI integration already documents tracing OpenAI's Speech (text-to-speech) API as a first-class audio-generation capability, but no Braintrust SDK instruments Polly, the AWS equivalent hosted service.
What is missing
aws_sdk_polly::Client exposes these execution-oriented operations (per https://docs.rs/aws-sdk-polly/latest/aws_sdk_polly/client/struct.Client.html):
synthesize_speech — the core generation call: converts input text or SSML into a synthesized audio stream using a specified voice/engine/output format. Direct analog of OpenAI's audio.speech.create.
start_speech_synthesis_task — asynchronous speech generation for long-form text, writing output audio to S3.
start_speech_synthesis_stream — bidirectional streaming synthesis session (text/control events in, audio events out) for low-latency generative-audio use cases (e.g. voice agents).
get_speech_synthesis_task / list_speech_synthesis_tasks — status/result retrieval for async synthesis jobs.
None of this is wired into the SDK:
- No usage extraction path —
extract_openai_usage()/extract_anthropic_usage() in src/extractors.rs parse a JSON usage object with token counts. Polly's SynthesizeSpeechOutput returns a raw audio Blob (e.g. MP3/PCM/OGG bytes) plus a request_characters header — no token-usage concept at all — so neither extractor applies, and there is no character-based usage/cost extractor for Polly's per-character billing model.
- No stream/span wrapper —
BraintrustStream/wrap_stream_with_span() (src/stream.rs) require an async Stream<Item = Result<Value, E>> deserializing OpenAI Chat-Completions-shaped JSON chunks. Polly's start_speech_synthesis_stream returns a bidirectional audio-event stream with no JSON/choices structure, structurally incompatible with the existing helper.
- No audio-generation span type — there is no equivalent of a "speech synthesis span" (input text, voice/engine parameters, output audio reference, character count) anywhere in
src/types.rs.
Library significance
Weekly downloads
Weekly downloads: 3,227 (as of 2026-08-12; https://crates.io/api/v1/crates/aws-sdk-polly/downloads)
Methodology: exact sum of the crates.io downloads API's daily version_downloads entries (summed across all versions publishing downloads on a given day) plus meta.extra_downloads entries, for the complete 7-day window 2026-08-06 through 2026-08-12 inclusive (checked on 2026-08-17; more recent days were excluded due to crates.io's daily-aggregation lag). Per-day combined totals: 08-06: 502; 08-07: 506; 08-08: 328; 08-09: 173; 08-10: 382; 08-11: 579; 08-12: 757. Sum = 3,227. 90-day recent_downloads reported directly by crates.io: 51,327 (consistent with this weekly figure, ≈3.9K/week average).
Braintrust docs status
supported for the underlying capability class (text-to-speech), but not_found for Polly/AWS specifically. Checked https://www.braintrust.dev/docs/integrations/ai-providers/openai directly on 2026-08-17: the Python span-coverage table lists "Audio APIs (audio captured as an attachment)" as covering "Transcription, Translation, Speech" — confirming Braintrust already treats speech synthesis (OpenAI's audio.speech.create) as a traced, in-scope generative-audio capability. Neither Amazon Polly nor any AWS speech-synthesis service is mentioned on https://www.braintrust.dev/docs/integrations/ai-providers (AWS Bedrock is the only AWS entry listed) or https://www.braintrust.dev/docs/integrations/ai-providers/bedrock.
Relationship to existing issues
Upstream sources
Braintrust docs sources
Local repo files inspected
src/extractors.rs — extract_openai_usage() and extract_anthropic_usage() both operate on token-usage JSON; no character-based usage extractor for Polly's Blob-typed audio response
src/stream.rs — BraintrustStream::aggregate()/wrap_stream_with_span() require a Stream<Item = Result<Value, E>> deserializing OpenAI-shaped chunks; incompatible with Polly's bidirectional audio-event stream
src/types.rs — no speech-synthesis/audio-generation span fields (voice, engine, output format, character count)
src/lib.rs — public API exports; no Polly/AWS speech references
Cargo.toml — no aws-sdk-polly dependency
- Full local codebase search for
polly, synthesize_speech, SpeechSynthesis — zero results
Summary
The Braintrust Rust SDK has no instrumentation for
aws-sdk-polly, AWS's official Rust SDK crate for Amazon Polly, AWS's text-to-speech (speech synthesis) generative-audio service. Braintrust's own OpenAI integration already documents tracing OpenAI'sSpeech(text-to-speech) API as a first-class audio-generation capability, but no Braintrust SDK instruments Polly, the AWS equivalent hosted service.What is missing
aws_sdk_polly::Clientexposes these execution-oriented operations (per https://docs.rs/aws-sdk-polly/latest/aws_sdk_polly/client/struct.Client.html):synthesize_speech— the core generation call: converts input text or SSML into a synthesized audio stream using a specified voice/engine/output format. Direct analog of OpenAI'saudio.speech.create.start_speech_synthesis_task— asynchronous speech generation for long-form text, writing output audio to S3.start_speech_synthesis_stream— bidirectional streaming synthesis session (text/control events in, audio events out) for low-latency generative-audio use cases (e.g. voice agents).get_speech_synthesis_task/list_speech_synthesis_tasks— status/result retrieval for async synthesis jobs.None of this is wired into the SDK:
extract_openai_usage()/extract_anthropic_usage()insrc/extractors.rsparse a JSONusageobject with token counts. Polly'sSynthesizeSpeechOutputreturns a raw audioBlob(e.g. MP3/PCM/OGG bytes) plus arequest_charactersheader — no token-usage concept at all — so neither extractor applies, and there is no character-based usage/cost extractor for Polly's per-character billing model.BraintrustStream/wrap_stream_with_span()(src/stream.rs) require an asyncStream<Item = Result<Value, E>>deserializing OpenAI Chat-Completions-shaped JSON chunks. Polly'sstart_speech_synthesis_streamreturns a bidirectional audio-event stream with no JSON/choicesstructure, structurally incompatible with the existing helper.src/types.rs.Library significance
aws-sdk-rustmonorepo (https://github.com/awslabs/aws-sdk-rust), published by the "AWS SDK Rust Bot"1.113.0Weekly downloads
Weekly downloads: 3,227 (as of 2026-08-12; https://crates.io/api/v1/crates/aws-sdk-polly/downloads)
Methodology: exact sum of the crates.io downloads API's daily
version_downloadsentries (summed across all versions publishing downloads on a given day) plusmeta.extra_downloadsentries, for the complete 7-day window 2026-08-06 through 2026-08-12 inclusive (checked on 2026-08-17; more recent days were excluded due to crates.io's daily-aggregation lag). Per-day combined totals: 08-06: 502; 08-07: 506; 08-08: 328; 08-09: 173; 08-10: 382; 08-11: 579; 08-12: 757. Sum = 3,227. 90-dayrecent_downloadsreported directly by crates.io: 51,327 (consistent with this weekly figure, ≈3.9K/week average).Braintrust docs status
supported for the underlying capability class (text-to-speech), but not_found for Polly/AWS specifically. Checked https://www.braintrust.dev/docs/integrations/ai-providers/openai directly on 2026-08-17: the Python span-coverage table lists "Audio APIs (audio captured as an attachment)" as covering "Transcription, Translation, Speech" — confirming Braintrust already treats speech synthesis (OpenAI's
audio.speech.create) as a traced, in-scope generative-audio capability. Neither Amazon Polly nor any AWS speech-synthesis service is mentioned on https://www.braintrust.dev/docs/integrations/ai-providers (AWS Bedrock is the only AWS entry listed) or https://www.braintrust.dev/docs/integrations/ai-providers/bedrock.Relationship to existing issues
Upstream sources
aws-sdk-pollyon crates.io: https://crates.io/crates/aws-sdk-pollyBraintrust docs sources
Local repo files inspected
src/extractors.rs—extract_openai_usage()andextract_anthropic_usage()both operate on token-usage JSON; no character-based usage extractor for Polly'sBlob-typed audio responsesrc/stream.rs—BraintrustStream::aggregate()/wrap_stream_with_span()require aStream<Item = Result<Value, E>>deserializing OpenAI-shaped chunks; incompatible with Polly's bidirectional audio-event streamsrc/types.rs— no speech-synthesis/audio-generation span fields (voice, engine, output format, character count)src/lib.rs— public API exports; no Polly/AWS speech referencesCargo.toml— noaws-sdk-pollydependencypolly,synthesize_speech,SpeechSynthesis— zero results