NOTE: Deprecated in favour of this project
gowit is the Go SDK for Wit.ai
This is WIP
Using go get:
go get github.com/dragonraid/gowit
From source:
git clone https://github.com/dragonraid/gowit $GOPATH/src/github.com/dragonraid/
go install $GOPATH/src/github.com/dragonraid/gowit
For minimal working example you need to specify WIT_API_TOKEN environment variable. Then you can do:
witAPI := wit.New()
body, _, err := witApi.Message("YOUR MESSAGE").Do()
See the also examples directory
The default API version is 20180527. You can target a specific version by setting the env variable WIT_API_VERSION.
gowit provides interaction with following endpoints:
Message- the Wit message API
You have two options how to setup your client behaviour
-
Environment variables
WIT_API_URL(defaults tohttps://api.wit.ai)WIT_API_VERSION(defaults to20180527)WIT_API_VERBOSE(defaults tofalse)
-
Wit struct
witApi := &wit.Wit{
Token: "<WIT_API_TOKEN>",
URL: "<WIT_API_URL>",
Version: "<WIT_API_VERSION>",
Verbose: "<WIT_API_VERBOSE>",
}