Bug Description
If a message handler needs to stream part of the response, then show an AdaptiveCard, then stream more of the response, there is no supported SDK API to manage stream lifecycle when interleaving content types. Calling ctx.stream.close() and then ctx._activity_sender.create_stream(ctx.conversation_ref) to create a new stream works, but requires accessing the private _activity_sender property of ctx. A public method on ctx to create a new stream would avoid the need to access the private property.
Steps to Reproduce
No error, but code potentially breaks if private details of the SDK change in a future version.
Expected Behavior
A public API such as ctx.new_stream() would close the old stream if it hasn't already been closed and open a new stream.
Actual Behavior
Application must call ctx._activity_sender.create_stream(ctx.conversation_ref) which involves accessing a private property.
SDK Version
2.0.12
Python Version
3.12.12
Additional Context
This pattern is essential for conversational AI workflows where a bot needs to display structured data (e.g., an AdaptiveCard) to confirm a user selection or approve usage of a tool while streaming a long-form text response.
Bug Description
If a message handler needs to stream part of the response, then show an
AdaptiveCard, then stream more of the response, there is no supported SDK API to manage stream lifecycle when interleaving content types. Callingctx.stream.close()and thenctx._activity_sender.create_stream(ctx.conversation_ref)to create a new stream works, but requires accessing the private_activity_senderproperty ofctx. A public method onctxto create a new stream would avoid the need to access the private property.Steps to Reproduce
No error, but code potentially breaks if private details of the SDK change in a future version.
Expected Behavior
A public API such as
ctx.new_stream()would close the old stream if it hasn't already been closed and open a new stream.Actual Behavior
Application must call
ctx._activity_sender.create_stream(ctx.conversation_ref)which involves accessing a private property.SDK Version
2.0.12
Python Version
3.12.12
Additional Context
This pattern is essential for conversational AI workflows where a bot needs to display structured data (e.g., an AdaptiveCard) to confirm a user selection or approve usage of a tool while streaming a long-form text response.