- Updating encode function to encode more special characters that could be passed in when constructing a request URL.
- Updated API version to latest:
20200513
. Browse the latest HTTP API documentation here. - Added intents and traits CRUD methods.
- More consistent, transparent naming of entities methods.
The most important change is the removal of .converse()
and .run_actions()
. Follow the migration tutorial here, or read more here.
converse
andrun_actions
are removed- updated and added new examples that leverage the /message API
converse
andrun_actions
are deprecatedinteractive
now callsmessage
- Renamed WitException to Wit::Error
- Changed Wit::Error to inherit from StandardError instead of Exception
- Moved constants inside Wit namespace
- Moved #req and #validate_actions to private methods within Wit namespace
converse
now takesreset
as optional parameter.
run_actions
now 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.
say
renamed tosend
to reflect that it deals with more than just text- Removed built-in actions
merge
anderror
- Actions signature simplified with
request
andresponse
arguments - INFO level replaces LOG level
- allows for overriding API version, by setting
WIT_API_VERSION
interactive()
mode- warns instead of throwing when validating actions
- bumped default API version from
20160330
to20160516
- fixed recursive call when running actions
- throws an exception if context passed is not a Hash
Unifying action parameters
- the
say
action now takes 3 parameters:session_id
,context
,msg
- the
error
action now takes 3 parameters:session_id
,context
,error
Updating action parameters
- the
merge
action now takes 4 parameters:session_id
,context
,entities
,msg
- the
error
action now takescontext
as second parameter - custom actions now take 2 parameters:
session_id
,context
- allows for custom logging
- better error message
Bot Engine integration
- the
message
API is wrapped around aWit
class, and doesn't take the token as first parameter
Rewrite in pure Ruby
- 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 Ruby dict instead of a JSON string