Coder Social home page Coder Social logo

ironman5366 / w.i.l.l Goto Github PK

View Code? Open in Web Editor NEW
378.0 30.0 61.0 3.44 MB

A python written personal assistant

Home Page: https://willbeddow.com

License: MIT License

Python 71.90% HTML 28.10%
json-api python telegram assistant pa personal-assistant spacy ai plugins

w.i.l.l's Introduction

W.I.L.L 3.1

The W.I.L.L Project has been retired and development has stopped. Read more here: https://willbeddow.com/page/wheres-w-i-l-l

Welcome to W.I.L.L

W.I.L.L is an open source personal assistant that aims to be free, easy to use, and expandable by the user. It runs on a python based plugin framework accessible by a JSON API that let's you access it from a variety of different platforms. We've provided some platforms for you, but if you don't like any of those, you can easily create your own, or, if you want to change W.I.L.L, setup your own version

Docs: http://will.readthedocs.io

Quickstart

Use a provided platform

Signup

Before you can use W.I.L.L, you need to sign up. You can sign up for free at https://willbeddow.com/signup

Android

W.I.L.L is now available as an android app, complete with voice commands and app hookins for services like spotify and netflix! Download it now from https://play.google.com/store/apps/details?id=com.willbeddow.will

Telegram

All you have to do to use W.I.L.L on telegram is go @WillAssistantBot and click start!

Use the json api

The main W.I.L.L server, as well as the web app, is at https://willbeddow.com It runs on a flask server that provides a JSON API

Quickstart

Send a request with python

import requests
import json
#Assume that the user has already signed up
server_url = "https://willbeddow.com"
payload = dict(username="myusername", password="mypassword")
#Start the session and generate a session token. This session token will endure until you go to /end_session or the server reboots
response = requests.post(url="{0}/api/start_session".format(server_url), data=payload).json()
#{"type": "success", "text": "Authentication successful", "data": {"session_id": "aaaa-bbbb-cccc-dddd"}
session_id = response["data"]["session_id"]
#Submit a command
command_data = dict(session_id=session_id, command="What is the meaning of life?")
answer = requests.post(url="{0}/api/command".format(server_url), data=command_data).json()
#{"type": "success", "text", "42 (according to the book The Hitchhiker's Guide to the Galaxy, by Douglas Adams)", "data": {"command_id": "aaaa-bbbb-cccc-dddd_1", "command_response": "42 (according to the book The Hitchhiker's Guide to the Galaxy, by Douglas Adams)"}}
print answer["text"]
#42 (according to the book The Hitchhiker's Guide to the Galaxy, by Douglas Adams)
#End your session
requests.post(url="{0}/api/end_session".format(server_url), data={"session_id": session_id})

API Docs:

The core of the JSON API is a response object. A response object looks like this:

{"type": "success", "text": "Request successful!", "data": {}}

As you can see, each response object has three objects.

  • Type
    • The type of the response. This will be either success, error, or response
    • success indicates that a request completed successfully
    • error indicates that a request encountered an error
    • responseindicates that the request requires a response or a callback. The information for this will usually be in data
  • Text
    • The message to the user
  • Data
    • A dictionary that contains any request specific data the user should interpret

API Methods:

  • /api/new_user
    • Requires the following parameters in the request
    • first_name
    • last_name
    • username
    • password (the password will laster be encrypted by bcrypt in the databsae)
    • email
    • default_plugin (It's usually best just to submit search for this)
  • /api/start_session
    • Takes username and password and returns a session_id in data
  • /api/command
    • Takes session_id and command and returns command_response in data
  • /api/end_session Takes a session_id and ends it
  • /api/get_updates
    • Takes a session_id and returns all pending updates and notifications
  • /api/get_sessions
    • Takes a username and password and returns all active sessions
  • /api/check_session
    • Takes a session_id and returns a boolean

Events framework

W.I.L.L has a customizable events framework that allows you to pass events and notifications that will be asynchronously pushed to the user. At the moment W.I.L.L offers three classes of events, two of which endure between reboots of the server

  • notification
    • A pending notification to the user. Unlike the rest of the notifications, as well as being available from /api/get_updates, a notification is also pushed to the user in various ways, including email, telegram, and text. Information about which of these the user has enabled is stored in a JSON array in the database
    • Endures between server updates
  • url
    • A url that will be opened, the contents of the page pushed to the updates for /api/get_updates
    • Endures between server updates
  • function
    • A function object that will be run, the result pushed to the updates for /api/get_updates
    • Does not endure between server updates, as a python func object cannot be stored between runs

An event object is defined by 5 keys:

  • type
    • The type of the event, notification, url, or function
  • username
    • The username of the user who the event belongs to
  • value
    • The data of the event. In a notification event it's the notification text, it's the url in a url event, and the func object in a function event
  • time
    • The time when the event should be run in Unix epoch time.
    • Can be generated with the builtin time module like so:
   import time
   #The current epoch time
   current_time = time.time()
   #Set the time for a minute
   event_activation_time = current_time+60
  • uid
    • A modified uuid object providing a unique identifier for the event
    • Generated with tools.get_event_uid(type) where type is the type key explained above

w.i.l.l's People

Contributors

brenttaylor avatar ironman5366 avatar jfr311 avatar narzeja avatar vms20591 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

w.i.l.l's Issues

Log handeling

Is there a reason you're using your own logging functionality over the python supplied "logging" module? Should cut down your code significantly and it's more fault tolerant and less error prone.

I'd be happy to change it over. :)

will.conf example in dev branch

I know it's been a while but I've been off working on other projects. Decided to check back in today and I'm surprised to see a complete rewrite...with most of the same problems as the original had. :) Lots of dangling file pointers, no adherence to the KISS principle, no data validation, etc. A lot of this is rather important.

So, trying to get involved again and there is no example of a proper "will.conf" file. That needs to be there!

Cleaning up the personality file

I'd be happy to help, if you'd tell me what the format of personality.txt is and what the personality file is supposed to be doing.

I understand it has something to do with the greetings, I just can't figure out if its dependant on what you say to the bot or some other internal state of things.

What is the goal of WILL? What's the purpose?

First and foremost, this isn't criticism. This is an attempt at an open conversation as to what we're actually trying to achieve so we're all working toward the same vision/goals.

I'm sitting here sort of looking at the history of WILL, what's been done and what features exist and what not. It's very fragmented with several restarts and that almost always is due to not enough thought, upfront, as to what the end goal is. What are we trying to achieve?

A lot of time has been spent on parsing, be it the original naive parsing or the NLP that has been worked on in the dev branch, but we haven't actually added any real useful features to WILL. I think this stems from not having any clearly defined goals. Those end goals will shape our initial infrastructure, and while I'm not happy about it, I expect after we've figured this all out we'll need another rewrite.

So, what are we trying to achieve? Yes, we're working on a virtual assistant, but what do we want this assistant to actually do? How do we want WILL to augment our lives?

So here's the big questions I think:

  1. What exactly do we want WILL to do? Keep track of appointments? Track packages? Our To-do list? IoT stuff?
  2. What is our interface for this? Built into the desktop like Cortana? iOS/Android support? Strictly via a chat app? As a web page?

Can't find the Slack token.

I looked in the account settings and notification settings, but it's not there. Do I have to configure a custom API integration?

Program doesn't exit on Ctrl+C

@ironman5366 The main script doesn't exit even after issuing Ctrl+C and noticed that the thread used to execute Slack rtm reader wasn't marked as daemon.

W.I.L.L/main.py


logs.write("Debug value is {0}".format(debugval), 'working')
logs.write("Connecting to rtm socket", 'trying')
t = threading.Thread(target=slack)
t.start()
logs.write("Starting flask server on localhost", 'trying')
print app.run(debug=debugval, use_reloader=False)

Setting the thread as daemon would fix the issue.

PEP8

The code base doesn't adhere to a good number of the PEP8 standards and it really should. It gives everyone, especially code contributors, a style guide they can adhere too. Especially if they are using a linter (and it looks like you're using IDEA, so you absolutely have a PEP8 linter).

A few examples of issues:

  • Tabs over spaces
  • Improper spacing between sections of code (two lines separating imports from code, two lines separating functions/classes, etc).

There's actually a lot more, but it's all pretty easily changed. I can work on it before #3 if you'd like.

Error 2: Appid missing

`[20:18:34]:

\ / | | |
\ / | | |
\ / | | |
\ /\ / | | |
\ / \ / | | |
/ / | ------------ ------------

[20:18:34]: Debug value is True
[20:18:34]: Connecting to rtm socket
[20:18:34]: Starting flask server on localhost
[20:18:34]: In slack function in new thread

  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
    Exception in thread Thread-1:
    Traceback (most recent call last):
    File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
    File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(_self.__args, *_self.__kwargs)
    File "main.py", line 35, in slack
    message = sc.rtm_read()
    File "/home/ryan/.local/lib/python2.7/site-packages/slackclient/_client.py", line 28, in rtm_read
    json_data = self.server.websocket_safe_read()
    File "/home/ryan/.local/lib/python2.7/site-packages/slackclient/_server.py", line 110, in websocket_safe_read
    data += "{0}\n".format(self.websocket.recv())
    AttributeError: 'NoneType' object has no attribute 'recv'

[20:18:40]: Command is
[20:18:40]: Analyzing content in command
[20:18:40]: Analyzed command content
[20:18:40]: Trying to load plugin modules
[20:18:40]: In plugin loader
[20:18:40]: plugindir is ['plugins', ['open', 'execute', 'autoremote', 'search', 'youtube'], []]
[20:18:40]: Plugin is open
[20:18:40]: Loading plugin open
[20:18:40]: plugin.json file path should be plugins/open/plugin.json
[20:18:40]: Loaded plugin open
[20:18:40]: Plugin is execute
[20:18:40]: Loading plugin execute
[20:18:40]: plugin.json file path should be plugins/execute/plugin.json
[20:18:40]: Loaded plugin execute
[20:18:40]: Plugin is autoremote
[20:18:40]: Loading plugin autoremote
[20:18:40]: plugin.json file path should be plugins/autoremote/plugin.json
[20:18:40]: Loaded plugin autoremote
[20:18:40]: Plugin is search
[20:18:40]: Loading plugin search
[20:18:40]: plugin.json file path should be plugins/search/plugin.json
[20:18:40]: Loaded plugin search
[20:18:40]: Plugin is youtube
[20:18:40]: Loading plugin youtube
[20:18:40]: plugin.json file path should be plugins/youtube/plugin.json
[20:18:40]: Loaded plugin youtube
[20:18:40]: Successfully loaded plugin modules
[20:18:40]: Using the intent module to parse the command
[20:18:40]: Analyzing word
[20:18:40]: Checking to see if the word is a plugin
[20:18:40]: Full plugin is {'open': [{u'name': u'open'}, {u'type': u'exec'}, {u'require': [u'command']}, {u'pos': u'verb'}, {u'returns': u'completion'}, {u'synonyms': []}, {u'questiontriggers': u'none'}, {u'firstword': u'no'}, {u'structure': u'xdg-open command'}]}
[20:18:40]: Plugin name is open
[20:18:40]: Plugin values are [{u'name': u'open'}, {u'type': u'exec'}, {u'require': [u'command']}, {u'pos': u'verb'}, {u'returns': u'completion'}, {u'synonyms': []}, {u'questiontriggers': u'none'}, {u'firstword': u'no'}, {u'structure': u'xdg-open command'}]
[20:18:40]: Checking dictionary {u'name': u'open'}
[20:18:40]: Checking dictionary {u'type': u'exec'}
[20:18:40]: Checking dictionary {u'require': [u'command']}
[20:18:40]: Checking dictionary {u'pos': u'verb'}
[20:18:40]: Checking dictionary {u'returns': u'completion'}
[20:18:40]: Checking dictionary {u'synonyms': []}
[20:18:40]: Found synonyms dictionary
[20:18:40]: The command does not match the plugin name
[20:18:40]: Full plugin is {'execute': [{u'name': u'execute'}, {u'type': u'exec'}, {u'require': [u'command']}, {u'pos': u'verb'}, {u'returns': u'completion'}, {u'synonyms': []}, {u'questiontriggers': u'none'}, {u'firstword': u'no'}, {u'structure': u'command'}]}
[20:18:40]: Plugin name is execute
[20:18:40]: Plugin values are [{u'name': u'execute'}, {u'type': u'exec'}, {u'require': [u'command']}, {u'pos': u'verb'}, {u'returns': u'completion'}, {u'synonyms': []}, {u'questiontriggers': u'none'}, {u'firstword': u'no'}, {u'structure': u'command'}]
[20:18:40]: Checking dictionary {u'name': u'execute'}
[20:18:40]: Checking dictionary {u'type': u'exec'}
[20:18:40]: Checking dictionary {u'require': [u'command']}
[20:18:40]: Checking dictionary {u'pos': u'verb'}
[20:18:40]: Checking dictionary {u'returns': u'completion'}
[20:18:40]: Checking dictionary {u'synonyms': []}
[20:18:40]: Found synonyms dictionary
[20:18:40]: The command does not match the plugin name
[20:18:40]: Full plugin is {'autoremote': [{u'name': u'autoremote'}, {u'type': u'python'}, {u'file': u'autoremote.py'}, {u'function': u'main'}, {u'require': [u'command']}, {u'pos': u'verb'}, {u'returns': u'completion'}, {u'synonyms': []}, {u'questiontriggers': u'none'}, {u'firstword': u'no'}]}
[20:18:40]: Plugin name is autoremote
[20:18:40]: Plugin values are [{u'name': u'autoremote'}, {u'type': u'python'}, {u'file': u'autoremote.py'}, {u'function': u'main'}, {u'require': [u'command']}, {u'pos': u'verb'}, {u'returns': u'completion'}, {u'synonyms': []}, {u'questiontriggers': u'none'}, {u'firstword': u'no'}]
[20:18:40]: Checking dictionary {u'name': u'autoremote'}
[20:18:40]: Checking dictionary {u'type': u'python'}
[20:18:40]: Checking dictionary {u'file': u'autoremote.py'}
[20:18:40]: Checking dictionary {u'function': u'main'}
[20:18:40]: Checking dictionary {u'require': [u'command']}
[20:18:40]: Checking dictionary {u'pos': u'verb'}
[20:18:40]: Checking dictionary {u'returns': u'completion'}
[20:18:40]: Checking dictionary {u'synonyms': []}
[20:18:40]: Found synonyms dictionary
[20:18:40]: The command does not match the plugin name
[20:18:40]: Full plugin is {'search': [{u'name': u'search'}, {u'type': u'python'}, {u'require': [u'command']}, {u'pos': u'verb'}, {u'file': u'search.py'}, {u'function': u'main'}, {u'returns': u'answer'}, {u'synonyms': [u'google']}, {u'questiontriggers': u'any'}, {u'firstword': u'yes'}]}
[20:18:40]: Plugin name is search
[20:18:40]: Plugin values are [{u'name': u'search'}, {u'type': u'python'}, {u'require': [u'command']}, {u'pos': u'verb'}, {u'file': u'search.py'}, {u'function': u'main'}, {u'returns': u'answer'}, {u'synonyms': [u'google']}, {u'questiontriggers': u'any'}, {u'firstword': u'yes'}]
[20:18:40]: Checking dictionary {u'name': u'search'}
[20:18:40]: Checking dictionary {u'type': u'python'}
[20:18:40]: Checking dictionary {u'require': [u'command']}
[20:18:40]: Checking dictionary {u'pos': u'verb'}
[20:18:40]: Checking dictionary {u'file': u'search.py'}
[20:18:40]: Checking dictionary {u'function': u'main'}
[20:18:40]: Checking dictionary {u'returns': u'answer'}
[20:18:40]: Checking dictionary {u'synonyms': [u'google']}
[20:18:40]: Found synonyms dictionary
[20:18:40]: Checking synonym google
[20:18:40]: The command does not match the plugin name
[20:18:40]: Full plugin is {'youtube': [{u'name': u'youtube'}, {u'type': u'python'}, {u'require': [u'command']}, {u'firstword': u'yes'}, {u'pos': u'verb'}, {u'file': u'youtube.py'}, {u'function': u'main'}, {u'returns': u'completion'}, {u'synonyms': []}, {u'questiontriggers': u'none'}]}
[20:18:40]: Plugin name is youtube
[20:18:40]: Plugin values are [{u'name': u'youtube'}, {u'type': u'python'}, {u'require': [u'command']}, {u'firstword': u'yes'}, {u'pos': u'verb'}, {u'file': u'youtube.py'}, {u'function': u'main'}, {u'returns': u'completion'}, {u'synonyms': []}, {u'questiontriggers': u'none'}]
[20:18:40]: Checking dictionary {u'name': u'youtube'}
[20:18:40]: Checking dictionary {u'type': u'python'}
[20:18:40]: Checking dictionary {u'require': [u'command']}
[20:18:40]: Checking dictionary {u'firstword': u'yes'}
[20:18:40]: Checking dictionary {u'pos': u'verb'}
[20:18:40]: Checking dictionary {u'file': u'youtube.py'}
[20:18:40]: Checking dictionary {u'function': u'main'}
[20:18:40]: Checking dictionary {u'returns': u'completion'}
[20:18:40]: Checking dictionary {u'synonyms': []}
[20:18:40]: Found synonyms dictionary
[20:18:40]: The command does not match the plugin name
[20:18:40]: Checking to see if word is a question word
[20:18:40]: Checking against question word Who
[20:18:40]: Checking against possible question word Who
[20:18:40]: Checking against possible question word Where
[20:18:40]: Checking against possible question word When
[20:18:40]: Checking against possible question word Why
[20:18:40]: Checking against possible question word What
[20:18:40]: Checking against possible question word Which
[20:18:40]: Checking against possible question word How
[20:18:40]: Checking against possible question word Who's
[20:18:40]: Checking against possible question word Where's
[20:18:40]: Checking against possible question word When's
[20:18:40]: Checking against possible question word Why's
[20:18:40]: Checking against possible question word What's
[20:18:40]: Checking against possible question word Which's
[20:18:40]: Checking against possible question word How's
[20:18:40]: Checking against possible question word Is
[20:18:40]: Checking against possible question word Are
[20:18:40]: Checking against possible question word Am
[20:18:40]: Checking against possible question word Was
[20:18:40]: Checking against possible question word Were
[20:18:40]: Checking against possible question word Will
[20:18:40]: Checking against possible question word Do
[20:18:40]: Checking against possible question word Does
[20:18:40]: Checking against possible question word Did
[20:18:40]: Checking against possible question word Have
[20:18:40]: Checking against possible question word Had
[20:18:40]: Checking against possible question word Has
[20:18:40]: Checking against possible question word Can
[20:18:40]: Checking against possible question word Could
[20:18:40]: Checking against possible question word Should
[20:18:40]: Checking against possible question word Shall
[20:18:40]: Checking against possible question word May
[20:18:40]: Checking against possible question word Might
[20:18:40]: Checking against possible question word Would
[20:18:40]: Command not found
[20:18:40]: Parsed the command
[20:18:40]: Parse function returned the error notfound
[20:18:40]: The error means that the command was not recognized
[20:18:40]: Using the search plugin on the command phrase
[20:18:40]: Trying to find search plugin
[20:18:40]: Found search plugin
[20:18:40]: Executing plugin {'search': [{u'name': u'search'}, {u'type': u'python'}, {u'require': [u'command']}, {u'pos': u'verb'}, {u'file': u'search.py'}, {u'function': u'main'}, {u'returns': u'answer'}, {u'synonyms': [u'google']}, {u'questiontriggers': u'any'}, {u'firstword': u'yes'}]}
[20:18:40]: Looking for type dictionary
[20:18:40]: Checking dictionary {u'name': u'search'}
[20:18:40]: Checking dictionary {u'type': u'python'}
[20:18:40]: Found dictionary type
[20:18:40]: Plugin type is python
[20:18:40]: Looking for firstword dictionary
[20:18:40]: Checking dictionary {u'name': u'search'}
[20:18:40]: Checking dictionary {u'type': u'python'}
[20:18:40]: Checking dictionary {u'require': [u'command']}
[20:18:40]: Checking dictionary {u'pos': u'verb'}
[20:18:40]: Checking dictionary {u'file': u'search.py'}
[20:18:40]: Checking dictionary {u'function': u'main'}
[20:18:40]: Checking dictionary {u'returns': u'answer'}
[20:18:40]: Checking dictionary {u'synonyms': [u'google']}
[20:18:40]: Checking dictionary {u'questiontriggers': u'any'}
[20:18:40]: Checking dictionary {u'firstword': u'yes'}
[20:18:40]: Found dictionary firstword
[20:18:40]: Checking to get the name of the python file
[20:18:40]: Looking for file dictionary
[20:18:40]: Checking dictionary {u'name': u'search'}
[20:18:40]: Checking dictionary {u'type': u'python'}
[20:18:40]: Checking dictionary {u'require': [u'command']}
[20:18:40]: Checking dictionary {u'pos': u'verb'}
[20:18:40]: Checking dictionary {u'file': u'search.py'}
[20:18:40]: Found dictionary file
[20:18:40]: Trying to import python file search.py
[20:18:40]: Import path is plugins/search/search.py
[20:18:40]: Imported python plugin
[20:18:40]: Looking for function dictionary
[20:18:40]: Checking dictionary {u'name': u'search'}
[20:18:40]: Checking dictionary {u'type': u'python'}
[20:18:40]: Checking dictionary {u'require': [u'command']}
[20:18:40]: Checking dictionary {u'pos': u'verb'}
[20:18:40]: Checking dictionary {u'file': u'search.py'}
[20:18:40]: Checking dictionary {u'function': u'main'}
[20:18:40]: Found dictionary function
[20:18:40]: Looking for require dictionary
[20:18:40]: Checking dictionary {u'name': u'search'}
[20:18:40]: Checking dictionary {u'type': u'python'}
[20:18:40]: Checking dictionary {u'require': [u'command']}
[20:18:40]: Found dictionary require
[20:18:40]: In main, query is:
going into wolfram search
[20:18:40]: in wolfram search
[20:18:40]:
/usr/local/lib/python2.7/dist-packages/wolframalpha/init.py:15: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if not error:
[20:18:40]: Error 2: Appid missing
127.0.0.1 - - [26/Feb/2016 20:18:40] "GET / HTTP/1.1" 200 -
`

I might be missing a module but I don't know which one.

Running on Ubuntu 15.10

Error in intent.py: intent.parse is returning None

You're using a lot of very broad exception handling throughout the application (which is not a good thing) and is making this rather difficult to debug. I believe I have all modules required installed (I'm working on a requirements.txt for pip freeze) however nothing worked and I kept getting the error "'NoneType' object has no attribute 'keys'" via the log with no other information, not even a line number.

By removing the try/catch block at lines 55-87 in main.py (though the code within the block was left in tact) I was able to at least figure out what's going on. Here's the traceback:

127.0.0.1 - - [25/Feb/2016 17:53:29] "GET /?context=command&command=Test HTTP/1.1" 500 - Traceback (most recent call last): File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1836, in __call__ return self.wsgi_app(environ, start_response) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1820, in wsgi_app response = self.make_response(self.handle_exception(e)) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1403, in handle_exception reraise(exc_type, exc_value, tb) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1461, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "C:\Users\btayl\Projects\WILL.git\main.py", line 80, in main if parsed.keys()[0]=="execute": AttributeError: 'NoneType' object has no attribute 'keys'

It looks like the call to "intent.parse" on line 77 is returning None. It's possible I'm missing a module that needs to be installed, but as mentioned, due to the over reaching exception handling I'm not getting so much as an error that a module can't be found.

Here's what I've got so far (note, some of these are dependencies for other modules, such as flask):

  • beautifulsoup4 (4.4.1)
  • Flask (0.10.1)
  • itsdangerous (0.24)
  • Jinja2 (2.8)
  • MarkupSafe (0.23)
  • nltk (3.1)
  • pip (7.1.2)
  • python-dateutil (2.4.2)
  • requests (2.9.1)
  • setuptools (18.2)
  • six (1.10.0)
  • slackclient (0.18.0)
  • termcolor (1.1.0)
  • textblob (0.11.1)
  • websocket-client (0.35.0)
  • Werkzeug (0.11.4)
  • wheel (0.24.0)
  • wikipedia (1.4.0)
  • wolframalpha (2.2)

Anything missing?

plugin.json format

I'm working on a proposal for a change in how we handle python plugins. In the meantime I'm doing a general refactoring of the plugin code for cleanup purposes. There's a lot of unnecessary code and practically no error or validation checking.

One thing I notice is the actual format for plugin.json files. Is there a reason the plugin.json format is a list of dicts with single key value pairs? This only makes parsing more complicated and much harder to validate.

Here's an example from the search plugin.json:

[
  {"name": "search"},
  {"type": "python"},
  {"require": ["command"]},
  {"pos": "verb"},
  {"file": "search.py"},
  {"function": "main"},
  {"returns": "answer"},
  {"synonyms": ["google"]},
  {"questiontriggers": "any"},
  {"firstword":"yes"}
]

I think this is likely a better approach:

{
  "name": "search",
  "type": "python",
  "require": ["command"],
  "pos": "verb",
  "file": "search.py",
  "function": "main",
  "returns": "answer",
  "synonyms": ["google"],
  "questiontriggers": "any",
  "firstword": "yes"
}

Any complaints with making this change?

html parsing

I should let it be known that on the google searches that is W.I.L.L's last resort so to speak, parsing is horrible. The very basic solution implemented now is just an example of what I want it to be at some point in the future. If anybody is skilled in parsing html, let me know and we can work on this together. Otherwise I'll see what I can do, but it's not my area of expertise.

Answers are displayed correctly in the terminal, but not sent to slack.

So I finally managed to get it working, and it seems to be finding the answers without error. However, whenever I ask it a question in Slack, it gives me 4 InsecurePlatformWarnings and then says the channel is not found:

[11:25:51]: In google search with query: Who is Obama
[11:25:52]: wiki_bool is true
[11:25:52]: in skwiki
[11:25:52]: Barack Obama
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
[11:25:55]: result fetched
[11:25:55]: Barack Hussein Obama II (US /brk husen obm/; born August 4, 1961) is an American politician serving as the 44th President of the United States, the first African American to hold the office. Born in Honolulu, Hawaii, Obama is a graduate of Columbia University and Harvard Law School, where he served as president of the Harvard Law Review.

[11:25:55]: Found answer Barack Hussein Obama II (US /brk husen obm/; born August 4, 1961) is an American politician serving as the 44th President of the United States, the first African American to hold the office. Born in Honolulu, Hawaii, Obama is a graduate of Columbia University and Harvard Law School, where he served as president of the Harvard Law Review. , returning it
127.0.0.1 - - [04/Mar/2016 11:25:55] "GET /?context=command&command=Who%20is%20Obama HTTP/1.1" 200 -
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
{"ok":false,"error":"channel_not_found"}

Everything else is working fine, it's getting the queries from slack correctly, it just isn't sending them back. What could be the problem?

Proposing a PR to fix a few small typos

Issue Type

[x] Bug (Typo)

Steps to Replicate and Expected Behaviour

  • Examine README.md, index.rst and observe databsae, however expect to see database.
  • Examine README.md, index.rst and observe laster, however expect to see later.
  • Examine core/plugins/weather.py and observe infromation, however expect to see information.
  • Examine core/plugin_handler.py and observe adminstrator, however expect to see administrator.

Notes

Semi-automated issue generated by
https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

To avoid wasting CI processing resources a branch with the fix has been
prepared but a pull request has not yet been created. A pull request fixing
the issue can be prepared from the link below, feel free to create it or
request @timgates42 create the PR. Alternatively if the fix is undesired please
close the issue with a small comment about the reasoning.

https://github.com/timgates42/W.I.L.L/pull/new/bugfix_typos

Thanks.

Plugin creation testers wanted

I recently added a plugin creation utility (plugincreate.py). It's a bit rough, but I'm really excited about this feature and it's improvement so I'm looking for testers. Please try it out, let me know what you think, and report any bugs, ideas, and impressions.

Keys/Tokens should be consolidated into a single config file

You have a lot of different API's in use here, most of which need their own Token or API key. To get this running it's an exercise in running through most of the code base to find where to even enter them. The slack token for example is in main.py. Others are in text based config files scattered all over the place.

We should consolidate all of this into a single file.

Increasing greetings

Hello!
I'm new here, and was exploring around, when I observed that 'personality.txt' and 'personality.py' have greetings specific to a certain time of the day.
I feel that maybe an addition of the day could be made, which can incorporate sentences such as, 'How is your Sunday going?', or 'TGIF! What are your plans for tonight?'
This can increase the number of sentences W.I.L.L. can greet with!

Again, I am new here and have just observed this, please guide me in the correct direction if I am going wrong! :)

W.I.L.L is currently down

Hello!

First off, I wanted to say that I really like this project and the goals you have for W.I.L.L.

I have been using it to develop a free messaging service for people in areas without internet (integrated via sms) - we recently launched and currently have about ~500 users. I noticed yesterday that the service had gone down, and I was wondering what happened / if you will be hosting it again in the near future.

Thanks again!

WolframAlpha error: invalid appid

Whenever I ask a question, I get this:

/usr/local/lib/python2.7/dist-packages/wolframalpha/__init__.py:15: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if not error:
[15:54:51]: Error 1: Invalid appid
127.0.0.1 - - [03/Mar/2016 15:54:51] "GET /?context=command&command=Who%20is%20ObamaHTTP/1.1" 200 -
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:120:``InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
{"ok":false,"error":"channel_not_found"}

What could be the cause?

WILL multiplies instead of adding.

I entered "What is 3 + 3", and it gave me 9. I entered "What is 22 + 22", and it gave me 484. This should be simple to clear up, right?

requirements file missing

@ironman5366 First I would like to say its a very good work ๐Ÿ‘

The requirements file seems to be missing and if you happen to have one push it to the repo would be helpful. I am going the hard way of installing all the missing modules :D :D

Simple addition doesn't work

I recently signed up and tried math functions like 2 + 3. Simple addition does not work. It interprets it as multiplication and gives the answer 6.

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.