A simple API.ai SDK for Go.
- Query
- Supports all query response fields, including:
- Multiple Fulfillment message types
- Params
- Supports all query response fields, including:
- List Intents
- Add/Fetch/Delete/Clear Context
Example: Perform a query and access some response params.
c := apiai.NewClient("<YOUR API.AI ACCESS TOKEN>")
answer, err := c.Query("<SOME UNIQUE SESSION ID>", "Hi there!")
params := struct {
MyParam1 string `json:"my-param-1"`
MyParam2 string `json:"my-param-2"`
}{}
json.Unmarshal(*answer.Result.Parameters, ¶ms)
fmt.Printf("got params: %+v", params)
NOTE: Running tests require an API.ai Access Token. The tests use this token to perform a query triggering the Default Fallback Intent for that account to ensure basic tests pass.
API_AI_ACCESS_TOKEN=<token> go test