Giter VIP home page Giter VIP logo

pyssistant's Introduction

๐Ÿ Pyssistant ๐Ÿ

Pyssistant is designed to be an conversational interface builder. With some simples lines of code you can create a simple assistente to perform actions to you

How to use

The first step to create an assistant with pyssistant is to import its dependencies, as shown in the following line

from pyssistant.dialog import Dialog

Then you'll have to create your dialog list, containing the commands and its answers.

features = []
features.append(feature("report", function=get_report))
features.append(feature("bye", answer="See you later :)", function=get_bye))

You may use a string type answer or even a function by means of "answer" and "function" parameters, if you are attributing to both of those parameters the "answer" parameter will be printed when the command is found in the inputted command, just like the function in the "function" parameter will be executed. Now that you have created your dialog list is needed to create a dialog itself.

dialog = Dialog(features)

You are also able to insert new commands to your list directly from Dialog object

dialog.add_dialog("hello", answer="Hi, how can i help you? :)")

Ok, now you have everything setted up, you just have to start listening! There two ways to start listening:

  • You may listen only a single command as in:
dialog.listen_once()
  • You may keep listening in loop as in:
dialog.start_listening()
  • It is also possible to set a keyword, the program will be "sleeping" while you don't say the keyword defined in the function wait_call
dialog.wait_call("hello")

In this example once the word "hello" is said the function listen once will be called

You may also let it listening in background, it will be listening in loop, once any of the commands is said its respective answer will be returned, when the answer is finished it will keep listening to you, waiting for the next command

dialog.listen_in_background()

to see the full exemple click here

dependencies

Extra information

  • This project is being built using python 2.7 ๐Ÿ
  • suggestions are always welcome :)
  • It's important to say that for now pyssistant only look for the specific word that was defined as command in the spoken sentence, we're still working to make pyssistant more intelligent :)

pyssistant's People

Contributors

lucasfrota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.