notice
This is documentation for Rasa Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
Version: 2.x
rasa.core.nlg.callback
nlg_response_format_spec
nlg_response_format_spec() -> Dict[Text, Any]
Expected response schema for an NLG endpoint.
Used for validation of the response returned from the NLG endpoint.
nlg_request_format
nlg_request_format(utter_action: Text, tracker: DialogueStateTracker, output_channel: Text, **kwargs: Any, ,) -> Dict[Text, Any]
Create the json body for the NLG json body for the request.
CallbackNaturalLanguageGenerator Objects
class CallbackNaturalLanguageGenerator(NaturalLanguageGenerator)
Generate bot utterances by using a remote endpoint for the generation.
The generator will call the endpoint for each message it wants to generate. The endpoint needs to respond with a properly formatted json. The generator will use this message to create a response for the bot.
generate
| async generate(utter_action: Text, tracker: DialogueStateTracker, output_channel: Text, **kwargs: Any, ,) -> Dict[Text, Any]
Retrieve a named response from the domain using an endpoint.
validate_response
| @staticmethod
| validate_response(content: Optional[Dict[Text, Any]]) -> bool
Validate the NLG response. Raises exception on failure.