Feature add new eventstream implementation to support bedrockruntime#InvokeModelWithBidirectionalStream aka bidi#3319
Open
Feature add new eventstream implementation to support bedrockruntime#InvokeModelWithBidirectionalStream aka bidi#3319
Conversation
…nvokeModelWithBidirectionalStream
…does not have any
lucix-aws
approved these changes
Feb 11, 2026
Contributor
|
Approved pending fixing the test failures (looks just like some compile issue, I imagine it's a minor miss). |
Contributor
|
there are conflicts apparently |
… other PR is merged
Man, it's been a while since I've struggled so much with merge conflicts </3
The integration test workflow is using a different build system, so it doesn't "checkout" smithy-go, making this whole step pointless. This reverts commit 3c84b14.
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.
Change the codegen for EventStreams in Go
Expands on #3236, closes #3156
Sample diff for an existing operation can be seen at #3320
What was the problem
Some operations (notoriously
bedrockagentruntime#invokeModelWithBidirectionalStream) don't return a response immediately, and rather wait for more input from the user before returning a response. Our generated code didn't handle this, and kept waiting forever for a response from the server. This is also a problem withq#Chat, which will be addressed on a separate PR.This PR changes code generation so we return control to the caller without waiting for a response from the server.
What are the major things changing
res.GetInitialReply(). Output objects contain onlyeventStreamandinitialReplyobjects.client.Operation()completes before the middleware stack finishes executing, and it's only after that the middleware completes execution.Goals of the PR
InitialReplychannelHow do I review this PR?
The PR should be reviewed alongside aws/smithy-go#626, which contains the other side of codegen.
What are the different event stream operations?
There are different dimensions of event stream operations
The existing operations that do this are
protocoltest.InputStream,protocoltest#InputStreamWithInitialRequest,protocoltest#DuplexStreamWithDistinctStreamss3#SelectObjectContent,sagemakerruntime#InvokeEndpointWithResponseStream,bedrockagentcore#InvokeCodeInterpreter,bedrockruntime#ConverseStream,bedrockruntime#InvokeModelWithResponseStream,bedrockagentruntime#InvokeAgent,bedrockagentruntime#InvokeFlow,bedrockagentruntime#InvokeInlineAgent,bedrockagentruntime#OptimizePrompt,bedrockagentruntime#RetrieveAndGenerateStream,iotsitewise#InvokeAssistant,lambda#InvokeWithResponseStream,protocoltest#OutputStream,protocoltest#OutputStreamWithInitialResponsecloudwatchlogs#GetLogObject,cloudwatchlogs#StartLiveTail,kinesis#SubscribeToShardlexruntimev2#StartConversation,transcribestreaming#StartCallAnalyticsStreamTranscription,transcribestreaming#StartMedicalScribeStream,transcribestreaming#StartMedicalStreamTranscription,transcribestreaming#StartStreamTranscription,protocoltest#DuplexStream,,protocoltest#DuplexStreamWithInitialMessages`qbusiness#Chat,bedrockruntime#InvokeModelWithBidirectionalStream