Rasa_Sdk 3.17.0 (2026-06-23)
Features
-
#1314: Added streaming support to
CollectingDispatcherandActionExecutor.Custom actions can now emit responses incrementally using three new async methods on
CollectingDispatcher:stream_start()— begins a streaming response.stream_chunk(text, image, buttons, elements, attachment, json_message)— emits a response fragment; accepts the same rich-content fields asutter_message().stream_end()— ends the streaming response.
Whether actual streaming occurs is determined by the transport, not the action. The supported transports are gRPC and direct custom action execution.
On streaming transports, chunks are forwarded to the caller immediately as they are produced.
On non-streaming transports, the same action code works unchanged: chunks are accumulated
and replayed as individualutter_message()calls whenstream_end()is called, so no branching or conditional logic is needed in action code.ActionExecutor.run()accepts an optionalsink: asyncio.Queueparameter. When provided,
each streaming event (stream_start,stream_chunk,stream_end,stream_done) is placed in the queue
as the action runs. Omittingsinkkeeps the existing unary behaviour. A convenience wrapperrun_streaming(action_call, sink)is also available.The gRPC transport now implements the
WebhookStreamserver-streaming RPC, yieldingWebhookStreamEventmessages (ChunkStart,Chunk,ChunkEnd,final_result,error) as the action produces them. TheChunkproto message has been extended to carry rich content fields (image,custom,attachment,buttons,elements) in addition totext.If an action calls
stream_start()andstream_chunk()but forgets to callstream_end(), the executor closes the stream automatically and logs a warning.
TheCollectingDispatcher.is_streaming_activeproperty returnsTruewhen a stream has been opened but not yet closed. -
#1320: Added graceful barge-in support to streaming custom actions.
When a user speaks over a streaming assistant response (barge-in), the voice channel can signal the action server via the new
AckStreamChunksgRPC RPC. The action server stops producing chunks immediately and waits for the action to finish naturally so that any Rasa events (slot sets, etc.) are still returned.New
CollectingDispatcherAPI:cancel_stream()— called by the transport layer on receipt ofAckStreamChunks. Setsis_streaming_cancelledtoTrueand causes all subsequentstream_chunk()calls to be silently dropped, so the action stops producing output without needing to be forcefully interrupted.is_streaming_cancelledproperty —Trueaftercancel_stream()has been called. Action authors can optionally inspect this afterstream_end()to suppress side effects that are irrelevant when the response was cut short.
New gRPC RPC in
ActionService:AckStreamChunks(StreamChunkAck) returns (google.protobuf.Empty)— the voice channel sends theresponse_idof the active streaming response. The action server looks up the dispatcher in its internal registry, cancels the stream, and returns immediately.WebhookStreamdetects the cancellation on the next iteration, drains the internal queue until the action finishes, and yields afinal_result(containing all Rasa events) to the client.
The
response_idfield already present onChunkStart,Chunk, andChunkEndevents serves as the correlation key between the outbound stream and the inboundAckStreamChunkscall.After a barge-in,
WebhookStreamwaits up to 30 seconds for the action to finish and deliverfinal_result. The timeout can be configured via theACTION_SERVER_STREAM_BARGE_IN_TIMEOUT_SECONDSenvironment variable. If the action does not complete within that window, an emptyfinal_resultis yielded so Rasa Pro can finish the barge-in handler normally, and the task is cancelled so a hung action cannot block the stream indefinitely.