这是indexloc提供的服务,不要输入任何密码
Skip to content

kelvin-omoh/JARVIS-on-Messenger

 
 

Repository files navigation

JARVIS on Messenger

Build Status Python PEP8 Gitmoji License Gitter Contributors Beginner Issues Pull Requests Closed

Introduction

Now available on Messenger, Just A Very Very Intelligent System (JAVRIS) aims to enhance communication and support job automation.

1.2 billion people use Messenger each month as of now. Bots are ready to take over. with the introduction of Send/Receive API.

Why?

JARVIS was created with two goals in mind:

  1. To have lot's of useful features (both fun and commonly used).
  2. Making it scalable and dynamic will enable participation in this project. Anyone with a working grasp of Python can contribute because this is module-based.) This project's main objective is to make it easier to enter the open source community.

Take a look at the contributing guidelines to see how easy it is to add your own code. I'll be waiting for your pull request! 😉

A massive Thank You to all contributors, and congratulations to people who made their first open-source contribution! 🎉

Demo

A short video of how its used on Mesenger

JARVIS on Messenger Demo

Modules

Feel free to add to this list by opening an Issue/Pull Request.

Name Sample Query Source (w/ Attribution)
anime death note anime Kitsu
book anything you want book Powered by Goodreads
bye goodbye ---
coin flip a coin ---
currency usd to eur rate Fixer.io
dice roll a die ---
dictionary define comfort Words API
fact tell me a fact JARVIS
hello Hi, Jarvis! ---
help What can you do? ---
joke tell me a joke JARVIS
lyrics paradise lyrics Powered by musiXmatch
movie iron man 2 movie plot
music songs by linkin park Spotify
news latest news Powered by NewsAPI
ping ping google.com Is it up?
quote random quote JARVIS
request report a bug
request a feature
---
thanks Thank you! ---
time time in seattle TimeZoneDB API
url shorten google.com
expand http://goo.gl/7aqe
Google URL Shortener
video videos of sia YouTube
weather weather in london Info provided by OpenWeatherMap
wiki wiki html MediaWiki API
xkcd show a random xkcd comic xkcd

More sample queries can be found here.

Structure

├── modules/         # home for various features
├── modules/src/     # code goes here
├── modules/tests/   # tests go here
├── data/            # home for shared data
├── templates/       # for sending structured messages
├── CONTRIBUTING.md  # contributing guidelines
└── jarvis.py        # the main bot

Local Development / Testing

  1. Clone this repo.
  2. Operating system
  • Linux:
    a) Debian (Ubuntu, Linux Mint, etc.): sudo apt-get install python-dev libffi-dev libssl-dev
    b) Arch Linux: sudo pacman -S python2 libffi openssl
    c) Fedora: sudo yum install python-devel libffi-devel openssl-devel
  • Windows: These should already be pre-installed in your Python bundle.
  • Mac/OS X:
    a) If you install Python using brew, the relevant headers are already installed for you. In other words, you don't need python-devel.
    b)Install brew brew install pkg-config libffi export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig/` # May change with libffi version ``````pip install cffi
    c) brew install libtins
  1. Install module requirements
pip install -r requirements.txt
  1. python jarvis.py
  2. Visit the following URLs to see results:
    http://localhost:5000/process/?q=<<YOUR_QUERY>> returns the intent of the query.
    http://localhost:5000/search/?q=<<YOUR_QUERY>> returns the search result of the query.

result

result

  • The "process" endpoint returns what module the system classifies your query e.g. a dictionary query, a song search, etc. Visit the following URLs to understand the output format:
    http://localhost:5000/process/?q=tell%20me%20a%20joke
    http://localhost:5000/process/?q=time%20in%20seattle
    http://localhost:5000/process/?q=convert%2025%20usd%20to%20eur

You can mock the results for local testing by adding your queries here.

  • The "search" endpoint returns the actual bot output, which you get when you interact with the bot using that query.

Note that for the search query to work, you have to set your own key (of the module that you want to test) in config.py

If you want a public endpoint, use the below button to deploy on Heroku and fill the relevant API keys that you would like to use:

Deploy

Usage

JARVIS is at your service here.

Buy Me A Coffee Become a Patron!

TL;DR for Beginners

History

I started out with a rule-based model, but it didn't scale well so now I've shifted to Natural Language Processing. Rest assured, I'll strive to keep it as simple as possible so that you, yes you, can contribute!

If you'd like to contribute to the old model, you are welcome to do so as well. I've created a new branch legacy for this purpose. I'll be accepting Pull Requests to this branch also. 😄

P.S. If you've come this far, you might as well contribute. Looking for a place to start? Take a look at some of the low-hanging fruits!

References

About

💬 A community-driven python bot that aims to be as simple as possible to serve humans with their everyday tasks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%