Strands BidiAgent support Nova 2 Sonic expert tool#2873
Closed
lanazhang wants to merge 0 commit into
Closed
Conversation
chaynabors
requested review from
a team and
opieter-aws
and removed request for
a team
July 9, 2026 15:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds Expert Tool support to
BidiNovaSonicModel, enabling bring-your-own-LLM reasoning while Nova Sonic handles ASR and TTS.New module:
strands/experimental/bidi/expert_tool/ExpertToolReasoner— protocol for custom reasoning implementationsBedrockConverseReasoner— built-in reasoner wrapping any Bedrock Converse model with automatic tool calling loopsStrandsAgentReasoner— wraps any Strands Agent as a reasoner (OpenAI, Gemini, Ollama, etc.)ExpertToolConfig— advanced configuration (streaming strategy, interruption callbacks, fallback messages)_ExpertToolManager— internal lifecycle manager handling content containers, streaming, barge-in cancellation, and error recoveryChanges to
BidiNovaSonicModel:reasonerparameter (shorthand) andexpert_toolparameter (advanced config)promptStartwhen reasoner is configuredtoolUseevents and routes to manager instead of agent loopstop()Related Issues
N/A
Documentation PR
NA
Type of Change
New feature
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce new warnings.
90 unit tests covering config, reasoner (protocol compliance, message conversion, tool calling loops, streaming, error handling), manager (invocation lifecycle, barge-in cancellation, content flags, event helpers), and nova_sonic integration (init validation, spec injection, event interception, stop cleanup)
All 31 existing
test_nova_sonic.pytests continue to passManual end-to-end testing with Qwen3 32B, Nova 2 Lite, and Claude Sonnet as reasoning LLMs — verified multi-turn conversation, tool calling, and barge-in handling
I ran
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.