Git Product home page Git Product logo

rasa-alice's Introduction

rasa-alice

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']

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.