Bedrock Runtime API: Problems with hot versus cold flows #1579
Unanswered
jg-develop
asked this question in
Q&A
Replies: 1 comment 7 replies
-
Hi @jg-develop, we haven't tested hot flows with our event streaming APIs yet. I've been able to reproduce your results with the code samples you provided and I'm digging into what it'll take to properly support hot flows. I'll post back here when I have an update. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am struggling getting the Nova Sonic API to work. Is there any example Kotlin code available to show me the right patterns to use? I'm trying to use the Kotlin SDK on Android, and using the Java sample as a guide, but struggling. I have a problem with Flows versus MutableSharedFlows. The following code works, but isn't what I need. I need to change the Flow to a MutableSharedFlow to be able to emit new values in the future as the conversation with bedrock progresses. But when I use a MutableSharedFlow, it doesn't work.
When I call invokeModelWithBidirectionalStream above, I see lots of HTTP traffic and the SDK doing its stuff. Whereas the code below doesn't do anything:
Even though I have replay set in the hot flow, it doesn't work, and I have tried wrapping code in launch, and making sure the emit is called after collect by using onSubscription. And I have put delays in the code. In all cases the AWS SDK doesn't perform any HTTP transactions, whereas it does with the cold flow? I have also tried callbackFlows etc, and still no success.
Any help would be gratefully received.
Beta Was this translation helpful? Give feedback.
All reactions