deeppavlov.skills.rasa_skill

class deeppavlov.skills.rasa_skill.rasa_skill.RASASkill(path_to_models: str, **kwargs)[source]

RASASkill lets you to wrap RASA Agent as a Skill within DeepPavlov environment.

The component requires path to your RASA models (folder with timestamped tar.gz archieves) as you use in command rasa run -m models –enable-api –log-file out.log

async rasa_confident_response_decorator(rasa_agent, text_message, sender_id)[source]
Parameters
  • rasa_agent – rasa.core.agent.Agent instance

  • text_message – str with utterance from user

  • sender_id – id of the user

Returns: None or tuple with str and float, where first element is a message and second is

confidence

async rasa_handle_text_verbosely(rasa_agent, text_message, sender_id)[source]

This function reimplements RASA’s rasa.core.agent.Agent.handle_text method to allow to retrieve message responses with confidence estimation altogether.

It reconstructs with merge RASA’s methods: https://github.com/RasaHQ/rasa_core/blob/master/rasa/core/agent.py#L401 https://github.com/RasaHQ/rasa_core/blob/master/rasa/core/agent.py#L308 https://github.com/RasaHQ/rasa/blob/master/rasa/core/processor.py#L327

This required to allow RASA to output confidences with actions altogether (Out of the box RASA does not support such use case).

Parameters
  • rasa_agent – rasa.core.agent.Agent instance

  • text_message – str with utterance from user

  • sender_id – id of the user

Returns: None or
tuple where first element is a list of messages dicts, the second element is a list

of confidence scores for all actions (it is longer than messages list, because some actions does not produce messages)