This repository is community-maintained. We gladly accept pull requests. Please see the Wit HTTP Reference for all supported endpoints.
Go client for wit.ai HTTP API.
API version: 20240304
go get -u github.com/wit-ai/wit-go/v2
package main
import (
"os"
"fmt"
witai "github.com/wit-ai/wit-go/v2"
)
func main() {
client := witai.NewClient(os.Getenv("WIT_AI_TOKEN"))
// Use client.SetHTTPClient() to set custom http.Client
msg, _ := client.Parse(&witai.MessageRequest{
Query: "hello",
})
fmt.Printf("%v", msg)
}
Unit tests are executed by Github Actions, but Integration tests have to be executed manually by providing a valid token via WITAI_INTEGRATION_TOKEN
env var.
go test -race -v
Integration tests are connecting to real Wit.ai API, so you need to provide a valid token:
WITAI_INTEGRATION_TOKEN={SERVER_ACCESS_TOKEN} go test -v -tags=integration
The license for wit-go can be found in LICENSE file in the root directory of this source tree.
Our terms of use can be found at https://opensource.facebook.com/legal/terms.
Our privacy policy can be found at https://opensource.facebook.com/legal/privacy.