This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).

Version: Main/Unreleased

RestInput Objects

class RestInput(InputChannel)

A custom http input channel.

This implementation is the basis for a custom implementation of a chat frontend. You can customize this to send messages to Rasa and retrieve responses from the assistant.


def get_metadata(request: Request) -> Optional[Dict[Text, Any]]

Extracts additional information from the incoming request.

Implementing this function is not required. However, it can be used to extract metadata from the request. The return value is passed on to the UserMessage object and stored in the conversation tracker.


  • request - incoming request with the message of the user


Metadata which was extracted from the request.


def stream_response(
on_new_message: Callable[[UserMessage], Awaitable[None]], text: Text,
sender_id: Text, input_channel: Text,
metadata: Optional[Dict[Text,
Any]]) -> Callable[[Any], Awaitable[None]]

Streams response to the client.

If the stream option is enabled, this method will be called to stream the response to the client


  • on_new_message - sanic event
  • text - message text
  • sender_id - message sender_id
  • input_channel - input channel name
  • metadata - optional metadata sent with the message


Sanic stream


def blueprint(
on_new_message: Callable[[UserMessage], Awaitable[None]]) -> Blueprint

Groups the collection of endpoints used by rest channel.

QueueOutputChannel Objects

class QueueOutputChannel(CollectingOutputChannel)

Output channel that collects send messages in a list.

(doesn't send them anywhere, just collects them).


def name(cls) -> Text

Name of QueueOutputChannel.