Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wit-ai/wit-go
Go client for wit.ai HTTP API
https://github.com/wit-ai/wit-go
go nlu wit
Last synced: 14 days ago
JSON representation
Go client for wit.ai HTTP API
- Host: GitHub
- URL: https://github.com/wit-ai/wit-go
- Owner: wit-ai
- License: mit
- Created: 2018-08-20T07:18:40.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-07-24T16:59:45.000Z (4 months ago)
- Last Synced: 2024-07-31T20:53:21.969Z (3 months ago)
- Topics: go, nlu, wit
- Language: Go
- Size: 72.3 KB
- Stars: 153
- Watchers: 25
- Forks: 30
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-go - wit-go - Go client for wit.ai HTTP API. (Third-party APIs / Utility/Miscellaneous)
- awesome-go - wit-go - Go client for wit.ai HTTP API - ★ 12 (Third-party APIs)
- awesome-go-extra - wit-go - 08-20T07:18:40Z|2022-05-16T15:36:46Z| (Third-party APIs / Fail injection)
- awesome - wit-go - Go client for wit.ai HTTP API (Go)
README
![wit.ai](https://s3.amazonaws.com/pliutau.com/wit.png)
[![Go Reference](https://pkg.go.dev/badge/github.com/wit-ai/wit-go)](https://pkg.go.dev/github.com/wit-ai/wit-go)
*This repository is community-maintained. We gladly accept pull requests. Please see the [Wit HTTP Reference](https://wit.ai/docs/http/latest) for all supported endpoints.*
Go client for [wit.ai](https://wit.ai/) HTTP API.
API version: 20240304
## Install
```
go get -u github.com/wit-ai/wit-go/v2
```## Usage
```go
package mainimport (
"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.Clientmsg, _ := client.Parse(&witai.MessageRequest{
Query: "hello",
})
fmt.Printf("%v", msg)
}
```## Testing
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.
### Unit tests
```
go test -race -v
```### Integration tests
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
```## License
The license for wit-go can be found in LICENSE file in the root directory of this source tree.
## Terms of Use
Our terms of use can be found at https://opensource.facebook.com/legal/terms.
## Privacy Policy
Our privacy policy can be found at
https://opensource.facebook.com/legal/privacy.