Skip to content

feat(speech): generate bidi streaming methods and add integration test - #6477

Draft
suzmue wants to merge 1 commit into
googleapis:mainfrom
suzmue:speech-v2-bidi
Draft

feat(speech): generate bidi streaming methods and add integration test#6477
suzmue wants to merge 1 commit into
googleapis:mainfrom
suzmue:speech-v2-bidi

Conversation

@suzmue

@suzmue suzmue commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Enable bidirectional streaming support for Google Cloud Speech v2 by setting include_bidi_streaming_methods: true in librarian.yaml and regenerating the crate.

Add a live integration test for Speech::streaming_recognize() that streams 4KB chunks from the public hello.wav sample, verifies bidirectional streaming lifecycle and half-closing, and validates that the transcribed text contains "hello".

@product-auto-label product-auto-label Bot added the api: speech Issues related to the Speech-to-Text API. label Aug 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request enables bidirectional streaming for the google-cloud-speech-v2 crate, adding generated prost models, conversion helpers, and the streaming_recognize client method. It also introduces an integration test to verify the streaming functionality. The feedback recommends optimizing the integration test by using Bytes::slice to stream audio chunks without copying data, thereby avoiding unnecessary allocations.

Comment thread tests/integration/src/speech.rs Outdated
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.38%. Comparing base (90d13cb) to head (83fc6d9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6477      +/-   ##
==========================================
- Coverage   96.38%   96.38%   -0.01%     
==========================================
  Files         298      298              
  Lines       84328    84328              
==========================================
- Hits        81283    81281       -2     
- Misses       3045     3047       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suzmue
suzmue force-pushed the speech-v2-bidi branch 2 times, most recently from ffda18b to 9a1b9da Compare August 19, 2026 23:42
Enable bidirectional streaming support for Google Cloud Speech v2 by
setting include_bidi_streaming_methods: true in librarian.yaml, updating
the librarian version, and regenerating the crate.

Add a live integration test for Speech::streaming_recognize() that streams
4KB chunks from the public hello.wav sample, verifies bidirectional
streaming lifecycle and half-closing, and validates that the transcribed text
contains "hello".

@coryan coryan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

drive-by


<!-- Code generated by sidekick. DO NOT EDIT. -->

**WARNING:** some RPCs have no corresponding Rust function to call them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

// limitations under the License.

pub mod error_details;
#[cfg(google_cloud_unstable_gapic_streaming)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changes in the README and using a #[cfg()] to get all the features is slightly odd.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree 100%.

I plan to hold onto this change until after the release, so we don't make the README updates and will then have the config flags removed before the release that makes those updates.

.await
.inspect_err(anydump)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please create a separate tests/* directory for the bidi streaming tests? I would rather not pile up the dependencies even more.

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

Labels

api: speech Issues related to the Speech-to-Text API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants