Added encoding for special characters in url param strings
Upgrading to latest API version!
Check it out: 20200513.
Added session_id to context in messenger.py (thanks @davidawad)
The most important change is the removal of .converse() and .run_actions(). Follow the migration tutorial here, or read more here.
converseandrun_actionsare removed- updated and added new examples that leverage the /message API
messagenow takes an optionalcontextas second parameterconverseandrun_actionsare deprecatedinteractivenow callsmessage- Python 3 compatibility (future imports)
- added a
speech()method to send audio files to the API (thanks @willywongi)
conversenow takesresetas optional parameter.run_actionsnow resets the last turn on new messages and errors.
After a lot of internal dogfooding and bot building, we decided to change the API in a backwards-incompatible way. The changes are described below and aim to simplify user code and accommodate upcoming features.
See ./examples to see how to use the new API.
sayrenamed tosendto reflect that it deals with more than just text- Removed built-in actions
mergeanderror - Actions signature simplified with
requestandresponsearguments - INFO level replaces LOG level
- adding verbose option for
message,converseandrun_actions
- allows for overriding API version, by setting
WIT_API_VERSION - fixes unicode error
- adds custom logging
- warns instead of throwing when validating actions
- bumped default API version from
20160330to20160516
interactive()mode- fixed default arg for
context - fixed
sayaction inexamples/quickstart.py - examples to take the Wit access token in argument
Unifying action parameters
- the
sayaction now takes 3 parameters:session_id,context,msg - the
erroraction now takes 3 parameters:session_id,context,e
Updating action parameters
- the
mergeaction now takes 4 parameters:session_id,context,entities,msg - the
erroraction now takescontextas second parameter - custom actions now take 2 parameters:
session_id,context
- Fixed request keyword arguments issue
- Better error messages
- Added
examples/template.py - Fixed missing type
- Updated
examples/weather.pytoexamples/quickstart.pyto reflect the docs
Bot Engine integration
- the
messageAPI is wrapped around aWitclass, and doesn't take the token as first parameter
Rewrite in pure Python
- audio recording and streaming have been removed because:
- many people only needed access to the HTTP API, and audio recording did not make sense for server-side use cases
- dependent on platform, choice best left to developers
- forced us to maintain native bindings as opposed to a pure Pythonic library
- we renamed the functions to match the HTTP API more closely
.text_query(string, access_token)becomes.message(access_token, string)
- all functions now return a Python dict instead of a JSON string