Skip to content

Commit

Permalink
v3.5 - API versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
patapizza committed May 23, 2016
1 parent 2a87282 commit d536968
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## v3.5

- allows for overriding API version, by setting `WIT_API_VERSION`
- fixes unicode error
- adds custom logging
- warns instead of throwing when validating actions

### breaking

- bumped default API version from `20160330` to `20160516`

## v3.4.1

- `interactive()` mode
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ See the `examples` folder for examples.

## API

### Versioning

The default API version is `20160516`.
You can target a specific version by setting the env variable `WIT_API_VERSION`.

### Overview

`pywit` provides a Wit class with the following methods:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

setup(
name='wit',
version='3.4.1',
version='3.5.0',
description='Wit SDK for Python',
author='The Wit Team',
author_email='help@wit.ai',
Expand Down
3 changes: 2 additions & 1 deletion wit/wit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging

WIT_API_HOST = os.getenv('WIT_URL', 'https://api.wit.ai')
WIT_API_VERSION = os.getenv('WIT_API_VERSION', '20160516')
DEFAULT_MAX_STEPS = 5
INTERACTIVE_PROMPT = '> '

Expand All @@ -17,7 +18,7 @@ def req(access_token, meth, path, params, **kwargs):
WIT_API_HOST + path,
headers={
'authorization': 'Bearer ' + access_token,
'accept': 'application/vnd.wit.20160330+json'
'accept': 'application/vnd.wit.' + WIT_API_VERSION + '+json'
},
params=params,
**kwargs
Expand Down

0 comments on commit d536968

Please sign in to comment.