request messages from api.ai like what
This library is built against the v1 API of api.ai / Dialogflow, which is in the process of being deprecated. When building something new, use the offical Go package for the V2 API instead. This package will not be maintained in any way anymore.
Use go get
:
$ go get github.com/m90/go-apiaiclient
Instantiate a new client using New(token string, language string)
and call Request(message string, sessionID string, contexts json.Marshaler)
:
client := apiaiclient.New("my_token", "en")
response, err := client.Request("Good morning Mr. Magpie", "session_id", &apiaiclient.ContextCollection{/*...*/})
Run the tests:
$ make
MIT © Frederik Ring