Skip to main content

Rasa Connector for Yandex Dialogs.

Project description

Rasa Connector for Yandex Dialogs.

Installing

$ pip install rasa-alice

Usage

URL: /webhooks/alice/webhook

credentials.yml

rasa_alice.AliceInput:

domain.yml

templates:
  utter_text:
    - text: "Здравствуйте! Это мы, хороводоведы."

  utter_text_custom:
    - custom:
        text: "Здравствуйте! Это мы, хороводоведы."
        tts: "Здравствуйте! Это мы, хоров+одо в+еды."
        end_session: true # false by default

  utter_text_with_buttons:
    - text: 'Hello'
      buttons:
      - title: 'Надпись на кнопке'
        url: 'https://example.com/'
        hide: true

  utter_big_image:
    - custom:
        text: "Здравствуйте! Это мы, хороводоведы."
        card:
          type: "BigImage"
          image_id: "1027858/46r960da47f60207e924"
          title: "Заголовок для изображения"
          description: "Описание изображения."
          button:
            text: "Надпись на кнопке"
            url: "http://example.com/"

  utter_items_list:
    - custom:
        text: "Здравствуйте! Это мы, хороводоведы."
        card:
          type: "ItemsList"
          header:
            text: "Заголовок галереи изображений"
          items:
            - image_id: "<image_id>"
              title: "Заголовок для изображения."
              description: "Описание изображения."
              button:
                text: "Надпись на кнопке"
                url: "http://example.com/"

The original request is stored in metadata, you can use it in custom actions:

class ActionHelloWorld(Action):

  def name(self) -> Text:
      return "action_hello_world"

  def run(self, dispatcher: CollectingDispatcher,
          tracker: Tracker,
          domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

      events = tracker.current_state()['events']
      user_events = []
      for e in events:
          if e['event'] == 'user':
              user_events.append(e)
      original_request = user_events[-1]['metadata']

      payload = original_request['request']['payload']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rasa-alice, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size rasa_alice-0.1.1-py3-none-any.whl (4.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size rasa-alice-0.1.1.tar.gz (4.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page