notice
This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).
rasa.core.channels.rest
RestInput Objects
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.
get_metadata
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.
Arguments:
request
- incoming request with the message of the user
Returns:
Metadata which was extracted from the request.
stream_response
Streams response to the client.
If the stream option is enabled, this method will be called to stream the response to the client
Arguments:
on_new_message
- sanic eventtext
- message textsender_id
- message sender_idinput_channel
- input channel namemetadata
- optional metadata sent with the message
Returns:
Sanic stream
blueprint
Groups the collection of endpoints used by rest channel.
QueueOutputChannel Objects
Output channel that collects send messages in a list.
(doesn't send them anywhere, just collects them).
name
Name of QueueOutputChannel.