wit-ai / pywit Goto Github PK
View Code? Open in Web Editor NEWPython library for Wit.ai
License: Other
Python library for Wit.ai
License: Other
Hello,
please make a new release for version bot version 4.0.0
Thanks!
This is the error
What’s the weather in San Francisco?
2016-05-17 18:22:55,482 - wit.wit - INFO - Executing merge
2016-05-17 18:22:57,068 - wit.wit - INFO - Executing action fetch-weather
Traceback (most recent call last):
File "quickstart.py", line 44, in
client.interactive()
File "build/bdist.macosx-10.11-x86_64/egg/wit/wit.py", line 151, in interactive
File "build/bdist.macosx-10.11-x86_64/egg/wit/wit.py", line 125, in run_actions
File "build/bdist.macosx-10.11-x86_64/egg/wit/wit.py", line 118, in __run_actions
File "build/bdist.macosx-10.11-x86_64/egg/wit/wit.py", line 118, in __run_actions
File "build/bdist.macosx-10.11-x86_64/egg/wit/wit.py", line 90, in __run_actions
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 8: ordinal not in range(128)
When parsing user utterance defined by "User says..." in Stories (Beta) which has no entities, the I bump into exception KeyError: 'entities'
(See details in the log at the end.)
at line https://github.com/wit-ai/pywit/blob/master/wit/wit.py#L101
If I am not mistaken the solution can be simple:
Instead of this line
context = self.actions['merge'](session_id, dict(context), rst['entities'], user_message)
use this one
context = self.actions['merge'](session_id, dict(context), rst.get('entities', {}), user_message)
oplatek@mb:master:bot$ ./bot.py
> Hi
Starting new HTTPS connection (1): api.wit.ai
2016-06-14 10:31:26,487 - wit.wit - INFO - Executing merge
Msg: Hi
Entities: {}
Context updated ctx:
{}
Starting new HTTPS connection (1): api.wit.ai
2016-06-14 10:31:27,431 - wit.wit - INFO - Executing say with: In arms, sir
User In arms, sir
Starting new HTTPS connection (1): api.wit.ai
2016-06-14 10:31:28,498 - wit.wit - INFO - Executing action arm
Call arming Angee func
2016-06-14 10:31:28,498 - wit.wit - WARNING - missing context - did you forget to return it?
Starting new HTTPS connection (1): api.wit.ai
2016-06-14 10:31:29,933 - wit.wit - INFO - Executing say with: In arms, sir
User In arms, sir
Starting new HTTPS connection (1): api.wit.ai
2016-06-14 10:31:30,933 - wit.wit - INFO - Executing merge
Traceback (most recent call last):
File "./bot.py", line 41, in <module>
client.interactive()
File "/Users/oplatek/Library/Python/2.7/lib/python/site-packages/wit/wit.py", line 152, in interactive
context = self.run_actions(session_id, message, context, max_steps)
File "/Users/oplatek/Library/Python/2.7/lib/python/site-packages/wit/wit.py", line 126, in run_actions
message)
File "/Users/oplatek/Library/Python/2.7/lib/python/site-packages/wit/wit.py", line 119, in __run_actions
user_message)
File "/Users/oplatek/Library/Python/2.7/lib/python/site-packages/wit/wit.py", line 119, in __run_actions
user_message)
File "/Users/oplatek/Library/Python/2.7/lib/python/site-packages/wit/wit.py", line 119, in __run_actions
user_message)
File "/Users/oplatek/Library/Python/2.7/lib/python/site-packages/wit/wit.py", line 119, in __run_actions
user_message)
File "/Users/oplatek/Library/Python/2.7/lib/python/site-packages/wit/wit.py", line 98, in __run_actions
rst['entities'], user_message)
KeyError: 'entities'
Dependency issue while building the file in Windows.
Unable to retrieve libwit_32_linux.a
Hi guys, first of all thank you for your amazing tool ! :)
I've been playing with it a bit and I have a weird bug I think with the pywit api, I can't get any entities it is all empty. In the log part of the wit admin I have this message : intent(null)=default_intent. Do you have any hint ?
Best regards.
Way.
There has to be a clearer explanation on how to actually get the responses from the bot.
The whole point is for a dev to be able to use it just like I could the chat client in the story editor when I first try this with some hardcoded examples.
There has to be a real quickstart to return JUST the hardcoded responses of the bot with messages so that the bot acts as a sort of classifier for when someone is first using this platform.
client = Wit(access_token, actions)
# simple example, no context supplied, start of conversation
resp = client.converse('yolo-42', 'why are there blue skies?', {})
print(resp)
{'msg': 'Why would I know that? For I am a robot', 'entities': {}, 'confidence': 0.2954891524491307, 'type': 'msg'}
It extracts no entities from the incoming message, and returns just the output without anything to update the context with. Something like this I think would help a lot of people who are using it for the first time.
HI! I was able to install the python wit library on my UDOO Quad board (http://shop.udoo.org/usa/product/udoo-quad.html). However, when I try to import the wit library, I get this error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /usr/local/lib/python2.7/dist-packages/wit.so: undefined symbol: CRYPTO_memcmp
Any thoughts on why?
Hey there.
Using this behind an HTTP/HTTPS proxy gives a problem.
Using pyCharm and latest Python.
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02F206D0>: Failed to establish a new connection: [WinError 10060] ...
Any chance you could implement something similar to what has been done with the node API here?
When tried running template.py throws error TypeError: 'dict' object is not callable, so I changed the line to client = Wit([access_token, actions]) and then it shows error for client.run_actions(session_id, 'your message', {}) AttributeError: 'Wit' object has no attribute 'run_actions'.
The same error for client.interactive() in quickstart.py
I am trying to using wit toolkit for my own application, but it turned to be unconnected by either entrance below.
I have no use for actions
and just want to do:
client = Wit(token)
resp = client.message('hello')
print resp
Why can't I do this? Please remove the mandate for actions.
How to run the quickstart.py, it's throwing an error
/Library/Python/2.7/site-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
/Library/Python/2.7/site-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
Executing merge
/Library/Python/2.7/site-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
Executing say with: I will need an Api to give you the weather information in London!
I will need an Api to give you the weather information in London!
/Library/Python/2.7/site-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
Hello,
i got errors when running the quickstart.py example file using Python 2.7.6 (Ubuntu 14.04) in an virtualenv.
pip install wit
leads to:
pip (8.1.1)
requests (2.9.1)
setuptools (20.9.0)
simplejson (3.8.2)
wheel (0.29.0)
wit (3.4.0)
Running python quickstart.py
leads to:
/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-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
/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-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
Executing merge
/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-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
Traceback (most recent call last):
File "quickstart.py", line 41, in <module>
client.run_actions(session_id, 'weather in London', {})
File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 108, in run_actions
message)
File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 103, in __run_actions
user_message)
File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 67, in __run_actions
rst = self.converse(session_id, message, context)
File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 61, in converse
return req(self.access_token, 'POST', '/converse', params, json=context)
File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 23, in req
' (' + rsp.reason + ')')
wit.wit.WitError: Wit responded with status: 404 (Not Found)
Before i was using wit (2.0) with requests (1.2.0) which works fine. I think a newer version of requests causes the SSL warnings.
Running on OS X 10.10 with python 2.7. Code is here
formats: no handler for given file type `alsa'
[wit] couldn't open input device using alsa. Trying with coreaudio...
[wit] initialized recording device
[wit] rate: 44100, channels: 2, encoding: SOX_ENCODING_SIGN2, bits_per_sample: 32, opposite_endian: SoxFalse
[wit] ready. state=recording
[wit] received true
[wit] failed to stream audio to server: broken pipe (Broken pipe)
[wit] ready. state=idle
[wit] null string pointer, doing nothing
[wit] error while sending: Some([0, 38, 0, 38, 0, 38, 0, 38, 0, 28, 0, 28, 0, 9, 0, 9, 255, 247, 255, 247, 255, 232, 255, 232, 255, 234, 255, 234, 255, 241, 255, 241, 255, 243, 255, 243, 255, 238, 255, 238, 255, 224, 255, 224, 255, 224, 255, 224, 255, 247, 255, 247, 0, 32, 0, 32, 0, 65, 0, 65, 0, 74, 0, 74, 0, 57, 0, 57, 0, 29, 0, 29, 0, 21, 0, 21, 0, 29, 0, 29, 0, 34, 0, 34, 0, 28, 0, 28, 255, 255, 255, 255, 255, 220, 255, 220, 255, 196, 255, 196])
[wit] done
[wit] stopping mic
I'm unable to run the example code. I already have an app that includes the new story feature. I still get the following error:
Traceback (most recent call last): File "examples\quickstart.py", line 44, in <module> client.interactive() File "C:\Python34\lib\site-packages\wit\wit.py", line 152, in interactive context = self.run_actions(session_id, message, context, max_steps) File "C:\Python34\lib\site-packages\wit\wit.py", line 126, in run_actions message) File "C:\Python34\lib\site-packages\wit\wit.py", line 119, in __run_actions user_message) File "C:\Python34\lib\site-packages\wit\wit.py", line 83, in __run_actions rst = self.converse(session_id, message, context) File "C:\Python34\lib\site-packages\wit\wit.py", line 75, in converse resp = req(self.access_token, 'POST', '/converse', params, json=context) File "C:\Python34\lib\site-packages\wit\wit.py", line 28, in req ' (' + rsp.reason + ')') wit.wit.WitError: Wit responded with status: 404 (Not Found)
rsp.reason()
isn't showing anything. I'm using the server-access token as the only command line argument. Can anyone please specify what I'm doing wrong?
I believe the message endpoint should accept context for stuff like timezone. I don't think it's supported here.
$ sudo python setup.py install
running install
running build
running build_ext
building 'wit' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ilibwit/include -I/usr/include/python2.7 -c pywit.c -o build/temp.linux-x86_64-2.7/pywit.o
pywit.c:18:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
static PyObject *pywit_close()
^
pywit.c:57:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
static PyObject *pywit_voice_query_stop()
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/pywit.o -Llibwit/lib -lwit -lrt -lsox -lssl -lcrypto -ldl -lpthread -lrt -lgcc_s -lpthread -lc -lm -o build/lib.linux-x86_64-2.7/wit.so
/usr/bin/ld: cannot find -lsox
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
We should build every commit and run test cases.
Any plans for python3 support? Documentation mentioned 2.7. Nevertheless, I went ahead and installed it in python3 but got error while running a test script
Traceback (most recent call last): File "test_wit.py", line 1, in <module> import wit ImportError: /usr/local/lib/python3.4/dist-packages/wit.cpython-34m.so: undefined symbol: Py_InitModule
Hello,
I am using wit.ai to develop a facebook messenger bot.
While testing the bot, I first made a script in wit.ai and later tried to run this in the facebook app.
When I run the script in wit.ai the bot returns the right answers to my questions. ( Yes when I say Yes and No when I say No.
In python it does however not do the same. It returns sometimes a stop action and sometimes even the opposite answer.
The only thing I can think of is that wit.ai does not accept the story, it however does run the story in the website.
Thanks in advance!
There's an inconsistent use of tabs and spaces in setup.py.
Line 12 uses tabs, the rest uses spaces.
I send over a query and I get back the stack trace
Traceback (most recent call last):
File "bot.py", line 74, in
client.interactive()
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 162, in interactive
context = self.run_actions(session_id, message, context, max_steps)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 134, in run_actions
return self.__run_actions(session_id, message, context, max_steps, verbose)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 125, in __run_actions
return self.__run_actions(session_id, None, context, i - 1, verbose)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 85, in __run_actions
json = self.converse(session_id, message, context, verbose)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 79, in converse
resp = req(self.logger, self.access_token, 'POST', '/converse', params, json=context)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 31, in req
' (' + rsp.reason + ')')
wit.wit.WitError: Wit responded with status: 400 (Bad Request)
Any help? Seems to be the wit code?
Hi - I followed all the instructions for the quickstart tutorial. I can run the bot on the console. However, when I run quickstart.py from command line, I get the below errors. Could you help me resolve this?
File "quickstart.py", line 46, in
client.interactive()
File "/Users/adavani/anaconda/lib/python2.7/site-packages/wit/wit.py", line 152, in interactive
context = self.run_actions(session_id, message, context, max_steps)
File "/Users/adavani/anaconda/lib/python2.7/site-packages/wit/wit.py", line 126, in run_actions
message)
File "/Users/adavani/anaconda/lib/python2.7/site-packages/wit/wit.py", line 106, in __run_actions
context = self.actions[rst['action']](session_id, dict%28context%29)
TypeError: get_forecast() takes exactly 1 argument (2 given)
I'm following the London/Weather quickstart example. Instead of the Node invocation, I am using pywit. I am getting this error, I don't know how to resolve:
Traceback (most recent call last):
File "quickstart.py", line 44, in <module>
client.run_actions(session_id, 'weather in London', {})
File "/Users/delip/miniconda2/envs/ceye/lib/python2.7/site-packages/wit/wit.py", line 63, in run_actions
rst = self.converse(session_id, message, context)
File "/Users/delip/miniconda2/envs/ceye/lib/python2.7/site-packages/wit/wit.py", line 53, in converse
return req(self.access_token, 'POST', '/converse', params, context)
File "/Users/delip/miniconda2/envs/ceye/lib/python2.7/site-packages/wit/wit.py", line 19, in req
json=payload,
File "/Users/delip/miniconda2/envs/ceye/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
TypeError: request() got an unexpected keyword argument 'json'
Python version:
$ python --version
Python 2.7.11 :: Anaconda 2.5.0 (x86_64)
Env listing:
dependencies:
- abstract-rendering=0.5.1=np110py27_0
- alabaster=0.7.7=py27_0
- anaconda=2.5.0=np110py27_0
- anaconda-client=1.2.2=py27_0
- appnope=0.1.0=py27_0
- appscript=1.0.1=py27_0
- argcomplete=1.0.0=py27_1
- astropy=1.1.1=np110py27_0
- babel=2.2.0=py27_0
- backports_abc=0.4=py27_0
- beautifulsoup4=4.4.1=py27_0
- bitarray=0.8.1=py27_0
- blaze-core=0.9.0=py27_0
- bokeh=0.11.0=py27_0
- boto=2.39.0=py27_0
- bottleneck=1.0.0=np110py27_0
- cdecimal=2.3=py27_0
- cffi=1.2.1=py27_0
- click=6.3=py27_0
- cloudpickle=0.1.1=py27_0
- clyent=1.2.0=py27_0
- colorama=0.3.6=py27_0
- configobj=5.0.6=py27_0
- cryptography=1.0.2=py27_0
- curl=7.45.0=0
- cycler=0.9.0=py27_0
- cymem=1.30=py27_0
- cython=0.23.4=py27_1
- cytoolz=0.7.5=py27_0
- datashape=0.5.0=py27_0
- decorator=4.0.6=py27_0
- docutils=0.12=py27_0
- dynd-python=0.7.1=py27_0
- enum34=1.1.2=py27_0
- et_xmlfile=1.0.1=py27_0
- fastcache=1.0.2=py27_0
- flask=0.10.1=py27_1
- freetype=2.5.5=0
- funcsigs=0.4=py27_0
- futures=3.0.3=py27_0
- gevent=1.0.2=py27_0
- gevent-websocket=0.9.5=py27_0
- greenlet=0.4.9=py27_0
- grin=1.2.1=py27_1
- h5py=2.5.0=np110py27_4
- hdf5=1.8.15.1=2
- idna=2.0=py27_0
- ipaddress=1.0.14=py27_0
- ipykernel=4.2.2=py27_0
- ipython=4.1.2=py27_1
- ipython-notebook=4.0.4=py27_0
- ipython-qtconsole=4.0.1=py27_0
- ipython_genutils=0.1.0=py27_0
- ipywidgets=4.1.1=py27_0
- itsdangerous=0.24=py27_0
- jbig=2.1=0
- jdcal=1.2=py27_0
- jedi=0.9.0=py27_0
- jinja2=2.8=py27_0
- joblib=0.9.4=py27_0
- jpeg=8d=1
- jsonschema=2.4.0=py27_0
- jupyter=1.0.0=py27_1
- jupyter_client=4.1.1=py27_0
- jupyter_console=4.1.0=py27_0
- jupyter_core=4.0.6=py27_0
- launcher=1.0.0=3
- libdynd=0.7.1=0
- libpng=1.6.17=0
- libtiff=4.0.6=1
- libxml2=2.9.2=0
- libxslt=1.1.28=2
- llvmlite=0.8.0=py27_0
- lxml=3.5.0=py27_0
- markupsafe=0.23=py27_0
- matplotlib=1.5.1=np110py27_0
- mistune=0.7.1=py27_0
- mkl=11.3.1=0
- mkl-service=1.1.2=py27_0
- multipledispatch=0.4.8=py27_0
- murmurhash=0.26.1=py27_0
- nbconvert=4.1.0=py27_0
- nbformat=4.0.1=py27_0
- networkx=1.11=py27_0
- nltk=3.2=py27_0
- node-webkit=0.10.1=0
- nose=1.3.7=py27_0
- notebook=4.1.0=py27_0
- numba=0.23.1=np110py27_0
- numexpr=2.4.6=np110py27_1
- numpy=1.10.4=py27_0
- odo=0.4.0=py27_0
- openpyxl=2.3.2=py27_0
- openssl=1.0.2g=0
- pandas=0.18.0=np110py27_0
- path.py=8.1.2=py27_1
- patsy=0.4.0=np110py27_0
- pep8=1.7.0=py27_0
- pexpect=3.3=py27_0
- pickleshare=0.5=py27_0
- pillow=3.1.0=py27_0
- pip=8.1.1=py27_1
- plac=0.9.1=py27_0
- ply=3.8=py27_0
- preshed=0.46.2=py27_0
- psutil=3.4.2=py27_0
- ptyprocess=0.5=py27_0
- py=1.4.31=py27_0
- pyasn1=0.1.9=py27_0
- pyaudio=0.2.7=py27_0
- pycosat=0.6.1=py27_0
- pycparser=2.14=py27_0
- pycrypto=2.6.1=py27_0
- pycurl=7.19.5.3=py27_0
- pyflakes=1.0.0=py27_0
- pygments=2.1=py27_0
- pyopenssl=0.15.1=py27_1
- pyparsing=2.0.3=py27_0
- pyqt=4.11.4=py27_1
- pytables=3.2.2=np110py27_0
- pytest=2.8.5=py27_0
- python=2.7.11=0
- python-dateutil=2.4.2=py27_0
- python.app=1.2=py27_4
- pytz=2015.7=py27_0
- pyyaml=3.11=py27_1
- pyzmq=15.2.0=py27_0
- qt=4.8.7=1
- qtconsole=4.1.1=py27_0
- readline=6.2=2
- redis=2.6.9=0
- redis-py=2.10.3=py27_0
- requests=2.9.1=py27_0
- rope=0.9.4=py27_1
- scikit-image=0.11.3=np110py27_0
- scikit-learn=0.17=np110py27_2
- scipy=0.17.0=np110py27_0
- semver=2.4.1=py27_0
- setuptools=20.2.2=py27_0
- simplegeneric=0.8.1=py27_0
- simplejson=3.8.2=py27_0
- singledispatch=3.4.0.3=py27_0
- sip=4.16.9=py27_0
- six=1.10.0=py27_0
- snowballstemmer=1.2.1=py27_0
- sockjs-tornado=1.0.1=py27_0
- spacy=0.100.6=py27_1
- sphinx=1.3.5=py27_0
- sphinx_rtd_theme=0.1.9=py27_0
- sputnik=0.9.3=py27_0
- spyder=2.3.8=py27_0
- spyder-app=2.3.8=py27_0
- sqlalchemy=1.0.11=py27_0
- sqlite=3.9.2=0
- ssl_match_hostname=3.4.0.2=py27_0
- statsmodels=0.6.1=np110py27_0
- sympy=0.7.6.1=py27_0
- terminado=0.5=py27_1
- thinc=5.0.6=py27_1
- tk=8.5.18=0
- toolz=0.7.4=py27_0
- tornado=4.3=py27_0
- traitlets=4.1.0=py27_0
- ujson=1.35=py27_0
- unicodecsv=0.14.1=py27_0
- werkzeug=0.11.3=py27_0
- wheel=0.29.0=py27_0
- xlrd=0.9.4=py27_0
- xlsxwriter=0.8.4=py27_0
- xlwings=0.6.4=py27_0
- xlwt=1.0.0=py27_0
- xz=5.0.5=0
- yaml=0.1.6=0
- zeromq=4.1.3=0
- zlib=1.2.8=0
- pip:
- arrow==0.7.0
- awscli==1.6.2
- backports-abc==0.4
- backports.ssl-match-hostname==3.5.0.1
- bcdoc==0.12.2
- blaze==0.9.0
- botocore==0.73.0
- bz2file==0.98
- cachecontrol==0.11.6
- certifi==2015.4.28
- climate==0.4.6
- contextlib2==0.5.1
- downhill==0.3.2
- dynd==f641248
- elasticsearch==2.3.0
- et-xmlfile==1.0.1
- fuel==0.0.1
- functools32==3.2.3.post2
- funcy==1.7.1
- future==0.15.2
- gensim==0.12.4
- genson==0.1.0
- gnureadline==6.3.3
- graphlab-create==1.8.5
- graphlab-create-license==1.8.5
- httpretty==0.8.10
- intervaltree==2.1.0
- ipyparallel==5.0.1
- ipython-genutils==0.1.0
- jmespath==0.5.0
- jupyter-client==4.1.1
- jupyter-console==4.1.0
- jupyter-core==4.0.6
- keras==0.3.2
- lime==0.1.1.3
- lockfile==0.12.2
- mixpanel-py==3.1.1
- mock==1.3.0
- mpld3==0.2
- natsort==4.0.4
- ndg-httpsclient==0.4.0
- neurolab==0.3.5
- numpydoc==0.6.0
- pbr==1.8.1
- picklable-itertools==0.1.0
- plotly==1.8.6
- prettytable==0.7.2
- progressbar2==2.7.3
- pybrain==0.3
- pyldavis==1.5.0
- pymongo==3.2.2
- pyreadline==2.1
- rep==0.6.5
- rsa==3.1.2
- scikit-bio==0.4.2
- slackclient==1.0.0
- smart-open==1.3.2
- sortedcontainers==1.4.4
- sphinx-rtd-theme==0.1.9
- sseclient==0.0.8
- tables==3.2.0
- testpath==0.3
- theanets==0.6.2
- theano==0.8.0
- urllib3==1.14
- websocket-client==0.35.0
- wit==3.1
- xgboost==0.4a30
When using run_actions
it seems there is no way to access to the confidence level from the response in the merge
or say
actions.
I would like to decide whether or not to use the response from Wit or to use a generic response based on this.
I know I can do this using the lower level converse
method but it feels like i'm just copying most of __run_actions
just to get access to this property, unless I'm missing something obvious?
Hello~ Wit.ai
I just followed the quickstar tutorial and create a story as example.
It's tested good at the beginning.
But now some problems are happened.
I type "weather" with no location and answered it with "location" after receiving robot's "where".
My robot will ask "where" again and answer "sunny" correctly at the 2nd time.
And ... processing time becomes slow.
Anyone knows about this?
Thank you
Hello, I use to be able to use wit with multiprocessing but recently when I started using wit again, this fails now. I made a simple example that shows the failure. I created 2 classes, one with multiprocessing and one without. The multiprocessing class hangs up on wit.query_text()
for some reason. If you comment it out and replace it with something like print 'hello!'
it works fine. What happened to wit
to break this?
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wit
import multiprocessing as mp
import time
token = 'my token'
# a class with multiprocessing
class MP(mp.Process):
def __init__(self):
mp.Process.__init__(self)
wit.init()
def run(self):
while True:
ans = wit.text_query('hello',token)
print ans
time.sleep(2)
# just a normal class
class nonMP(object):
def __init__(self):
wit.init()
def run(self):
while True:
ans = wit.text_query('hello',token)
print ans
time.sleep(2)
def start(self):
self.run()
def join(self):
a=1
# w = nonMP() # no multiprocessing
w = MP() # with multiprocessing
w.start()
w.join()
Platform: OSX 10.11.1
Python: 2.7.11
message
and other HTTP requests need to have a version parameter, failing which a DEPRECATED
warning is generated.
Also official documentation says "requests that do not include a version parameter will be rejected."
from wit import Wit
client = Wit(TOKEN, actions)
client.message('hi')
{'WARNING': 'DEPRECATED',
'_text': 'hi',
'msg_id': 'e6909c8c-818a-4271-a104-027a94b3b11a',
'outcomes': [{'_text': 'hi',
'confidence': None,
'entities': {},
'intent': 'default_intent'}]}
Hello,
I was using pywit (https://github.com/lextoumbourou/PyWit) in my project and as you made an official python package, I was going to use it. But I miss some features to switch :
There was some useful functions like get_intents().
Is it possible to implement these please ?
Also, I think dependencies shouldn't be here in this library.
Using the audio part is one of the feature of your API, but seems a bit useless to install dev dependencies to compile (as it isn't pure-python) the package by default.
It should be used in a subpackage or something like that "wit.api.X, wit.text.X, wit.audio.X".
This way it will be more pythonic and more easy to distribute the package. (but it's my personal point of view)
If I call run_actions() with verbose set to True, then inside the resulting calls to __run_actions() it seems that my verbose flag gets passed to converse() as the reset flag. Therefore, I get a reset on every step and my app does not seem to follow my story at all.
If I don't pass a verbose flag to run_actions() then I don't have this problem.
Hi
Thank you for a great plugin. I would like to display R squared on the chart and I found some references to it in some docs, but I cannot find the setting. Can you please help.
Gert
PS: Apologies if this is not the right approach, but I am not sure how else to make contact.
This is great, but there is something that I didn't understand 100% about the latest version..
Why is the action argument required if only message method is used?
I think that 'validate_actions(actions)' shouldn't be done on Wit constructor. It's forcing me to setup a dummy set of methods like:
`
def say(session_id, context, msg):
print(msg)
def merge(session_id, context, entities, msg):
return context
def error(session_id, context, e):
print(str(e))
actions = {
'say': say,
'merge': merge,
'error': error,
}`
Doing it is ok and working, but I think this is unnecessary if I only use the message parsing feature.
I'm moving my existing code for 1.0 version to the latest.
Thanks !
res = wit.text_query('turn on the lights in the kitchen', access_token)
print type(res)
should be dict type instead of str
Using pip I just installed pywit==0.4.0
, but the latest release in this git repository is pywit==0.3.5.0
.
In addition, it seems that pywit==0.4.0
is not very compatible with the 0.3.*
series.
I see the the 0.4.0
version in the v1.0
branch, is it the default branch for now?
when i tried to use in my file
# -*- coding: UTF-8 -*-
it resulted in
File "/usr/local/lib/python2.7/dist-packages/wit/wit.py", line 76, in run_actions
print('Executing say with: {}'.format(rst['msg']))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 9: ordinal not in range(128)
when i had some non ascii character in bot response
Hello,
I am using pywit for my project. I have followed the documentation provided on ( wit.ai ). As mentioned in the documentation, i created a story, downloaded pywit and installed as show in( https://github.com/wit-ai/pywit ). when i tried to run the example program, I am facing the below issues:
rajasekharan@ubuntu:~/pywit-master$ sudo python examples/quickstart.py
what's the weather?
Traceback (most recent call last):
File "examples/quickstart.py", line 44, in
client.interactive()
File "/usr/local/lib/python2.7/dist-packages/wit/wit.py", line 141, in interactive
context = self.run_actions(session_id, message, context, max_steps)
File "/usr/local/lib/python2.7/dist-packages/wit/wit.py", line 115, in run_actions
message)
File "/usr/local/lib/python2.7/dist-packages/wit/wit.py", line 72, in __run_actions
rst = self.converse(session_id, message, context)
File "/usr/local/lib/python2.7/dist-packages/wit/wit.py", line 66, in converse
return req(self.access_token, 'POST', '/converse', params, json=context)
File "/usr/local/lib/python2.7/dist-packages/wit/wit.py", line 22, in req
*_kwargs
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, *_kwargs)
TypeError: request() got an unexpected keyword argument 'json'
Kindly help me in solving this issue.
Hi,
I've started a port to asyncio in order to use pywit with an asyncio app.
The question being: are you guys interested by this? Or should I maintain my own fork?
Thanks,
Rémy
I am sometimes getting the below error. Seems to be when wit.ai is unable to determine the intent. Could this be responded to in a more elegant way?
Or am I doing something completely wrong?
ERROR:jarvis:error when running wit actions
TypeError("Can't convert 'NoneType' object to str implicitly",)
Traceback (most recent call last):
File "quickstart.py", line 220, in handle_command
context1 = witclient.run_actions(session_id, command, context0)
File "C:\Users\Anders\AppData\Local\Programs\Python\Python35-32\lib\site-packages\wit-4.1.0-py3.5.egg\wit\wit.py", line 154, in run_actions
context, max_steps, verbose)
File "C:\Users\Anders\AppData\Local\Programs\Python\Python35-32\lib\site-packages\wit-4.1.0-py3.5.egg\wit\wit.py", line 127, in __run_actions
self.throw_if_action_missing(action)
File "C:\Users\Anders\AppData\Local\Programs\Python\Python35-32\lib\site-packages\wit-4.1.0-py3.5.egg\wit\wit.py", line 192, in throw_if_action_missing
raise WitError('unknown action: ' + action_name)
TypeError: Can't convert 'NoneType' object to str implicitly
Hey all.
This is a pretty minor issue and will likely be automatically resolved with time. But it cost me an hour or so today so I thought I'd report it on the off chance of saving someone else.
When trying to install the latest version via pip:
Collecting wit==4.0.0
Could not find a version that satisfies the requirement wit==4.0.0 (from versions: 1.0, 1.1, 2.0, 3.0, 3.1, 3.2, 3.3.0, 3.4.0, 3.4.1, 3.5.0)
No matching distribution found for wit==4.0.0
The version seems to be listed here: https://pypi.python.org/pypi/wit . As it's been a few days since the release I thought it best to let you know.
There is no way to configure network proxy in wit query commands.
wit.text_query returns with connection refused.
The environment variables for the proxy should be used.
Hi,
Can I add state to the request somehow?
Thanks,
Istvan
I tried using sudo pip install wit
but it kept failing to install. I then download from github and tried installing manually:
python setup.py build
running build
Retrieving platform-specific libwit library... libwit-armv6.a
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13.1M 100 13.1M 0 0 53223 0 0:04:19 0:04:19 --:--:-- 55903
running build_ext
building 'wit' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ilibwit/include -I/usr/include/python2.7 -c pywit.c -o build/temp.linux-armv6l-2.7/pywit.o
pywit.c:18:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
pywit.c:57:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-armv6l-2.7/pywit.o -Llibwit/lib -lwit -lsox -lcurl -o build/lib.linux-armv6l-2.7/wit.so
/usr/bin/ld: libwit/lib/libwit.a(r-vad-vad.o): Relocations in generic ELF (EM: 3)
/usr/bin/ld: libwit/lib/libwit.a(r-vad-vad.o): Relocations in generic ELF (EM: 3)
/usr/bin/ld: libwit/lib/libwit.a(r-vad-vad.o): Relocations in generic ELF (EM: 3)
/usr/bin/ld: libwit/lib/libwit.a(r-vad-vad.o): Relocations in generic ELF (EM: 3)
/usr/bin/ld: libwit/lib/libwit.a(r-vad-vad.o): Relocations in generic ELF (EM: 3)
libwit/lib/libwit.a: error adding symbols: File in wrong format
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
My RPi:
pi@bender ~ $ uname -a
Linux bender 3.12.32+ #721 PREEMPT Fri Nov 7 16:50:31 GMT 2014 armv6l GNU/Linux
I assume there is an issue with the libwit.a that python downloads.
i have created stories and developed python code for that . i need help to integrate it with facebook .
Hey,
Just installed the latest wit on my ubuntu, though pip. Unfortunately it does not know the function init(). Anybody has any idea?
see pull request in libwit-ruby
Can you please write a complete library? Please include a function for speech (link to your API) passed as an audio file. Basically it does this (per your docs):
$ curl -XPOST 'https://api.wit.ai/speech?v=20141022' \
-i -L \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: audio/wav" \
--data-binary "@sample.wav"
Hello,
there a couple of new commits since the last release (1.1): https://github.com/wit-ai/pywit/releases
Could you please make a new release tag? Thanks!
i tried to install wit via pip install wit. i got this error
`sathish@sathish-desktop:~/pywit$ sudo pip install wit
Downloading/unpacking wit
Downloading wit-1.1.tar.gz
Running setup.py (path:/tmp/pip-build-hNjLyq/wit/setup.py) egg_info for package wit
Installing collected packages: wit
Running setup.py install for wit
Retrieving platform-specific libwit library... libwit-armv6.a
building 'wit' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ilibwit/include -I/usr/include/python2.7 -c pywit.c -o build/temp.linux-armv7l-2.7/pywit.o
pywit.c:18:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
static PyObject *pywit_close()
^
pywit.c:57:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
static PyObject *pywit_voice_query_stop()
^
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/pywit.o -Llibwit/lib -lwit -lrt -lsox -lssl -lcrypto -ldl -lpthread -lrt -lgcc_s -lpthread -lc -lm -o build/lib.linux-armv7l-2.7/wit.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip-build-hNjLyq/wit/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-KLZaBg-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
Retrieving platform-specific libwit library... libwit-armv6.a
running build_ext
building 'wit' extension
creating build
creating build/temp.linux-armv7l-2.7
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ilibwit/include -I/usr/include/python2.7 -c pywit.c -o build/temp.linux-armv7l-2.7/pywit.o
pywit.c:18:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
static PyObject *pywit_close()
^
pywit.c:57:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
static PyObject *pywit_voice_query_stop()
^
creating build/lib.linux-armv7l-2.7
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/pywit.o -Llibwit/lib -lwit -lrt -lsox -lssl -lcrypto -ldl -lpthread -lrt -lgcc_s -lpthread -lc -lm -o build/lib.linux-armv7l-2.7/wit.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip-build-hNjLyq/wit/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-KLZaBg-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-hNjLyq/wit
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pip/init.py", line 248, in main
return command.main(cmd_args)
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 52: ordinal not in range(128)`
When i tried it with manual install. i get error in ld
sathish@sathish-desktop:~/pywit$ sudo python setup.py build running build running build_ext building 'wit' extension arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ilibwit/include -I/usr/include/python2.7 -c pywit.c -o build/temp.linux-armv7l-2.7/pywit.o pywit.c:18:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes] static PyObject *pywit_close() ^ pywit.c:57:18: warning: function declaration isn’t a prototype [-Wstrict-prototypes] static PyObject *pywit_voice_query_stop() ^ pywit.c: In function ‘initwit’: pywit.c:203:16: warning: ‘return’ with a value, in function returning void return NULL; ^ arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/pywit.o -Llibwit/lib -lwit -lrt -lsox -lssl -lcrypto -ldl -lpthread -lrt -lgcc_s -lpthread -lc -lm -o build/lib.linux-armv7l-2.7/wit.so libwit/lib/libwit.a: error adding symbols: File truncated collect2: error: ld returned 1 exit status error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
i tried in all versions of wheezy and Jessie and ubuntu mate in raspberry pi. please some one help me solve this problem
Are you guys planning to add an example integrating pywit with fb messenger as in node-wit?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.