Skip to content

lextoumbourou/PyWit

Repository files navigation

PyWit (Unofficial)

Build Status License Latest Version Downloads

Note: Wit.ai now provides an official Python SDK also called pywit. It is the recommended way to develop Wit applications in Python.

Python bindings for the Wit HTTP API

Basic Usage

>>> from wit import Wit
>>> w = Wit('YOUR_TOKEN_GOES_HERE')
>>> w.get_message('It puts the lotion in the basket')
{u'msg_body': u'It puts the lotion in the basket',
 u'msg_id': u'67771674-25ad-40af-b3fe-f2806c9a092a',
 u'outcome': {u'confidence': 0.525, u'entities': {}, u'intent': u'order'}}
>>> fh = open('hello_world.wav', 'rb')
>>> w.post_speech(fh)
{u'msg_body': u'hello world',
 u'msg_id': u'6a410cda-32e0-4602-bcfb-c20f5e1aed66',
 u'outcome': {u'entities': {}, u'confidence': 0.525, u'intent': u'order'}}

Documentation

Read the docs here

Tests

Unit (Offline)

> nosetests tests/unit

Integration (Online)

> export WIT_ACCESS_TOKEN=YOUR_TOKEN_GOES_HERE
> nosetests tests/integration

Python version support

  • Python 2.7 and higher (Python 2.6 should work with argparse installed: pip install argparse)
  • Python 3

License

MIT

Changelog

  • 0.4.0
    • Fix BadRequestError when calling get_message.
    • Support newer version of API.
  • 0.3.0
    • Added Python3 support
  • 0.2.0
    • Added support for Wit's versioning system
    • Improved tests
  • 0.1.5
    • Added support for raw audio
    • Provided additional streamed audio example
  • 0.1.4
    • Initial PyPi-ready release

Contributors

If you contributed to the project, feel free to add your name and/or Github username here.

  • Lex Toumbourou (@lextoumbourou) - origin author
  • Josh Deare (@doodles526)

About

Python bindings for the Wit HTTP API (unofficial)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages