https://github.com/epigos/dialogflow-go
Go client for dialogflow.com v2 HTTP API
https://github.com/epigos/dialogflow-go
chatbot dialogflow-v2 golang
Last synced: 3 months ago
JSON representation
Go client for dialogflow.com v2 HTTP API
- Host: GitHub
- URL: https://github.com/epigos/dialogflow-go
- Owner: epigos
- License: mit
- Created: 2019-02-20T14:32:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-20T23:52:38.000Z (over 6 years ago)
- Last Synced: 2025-01-27T05:41:40.776Z (4 months ago)
- Topics: chatbot, dialogflow-v2, golang
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go client for Dialogflow v2 API
[](http://godoc.org/github.com/epigos/dialogflow-go)
[](https://travis-ci.org/epigos/dialogflow-go)
[](https://goreportcard.com/report/github.com/epigos/dialogflow-go)This package allows integrating your Golang application with [Dialogflow v2](https://dialogflow.com/docs/)
## Installation
Standard go get:
go get github.com/epigos/dialogflow-go
## Resource coverage
- Agents
- EntityTypes
- Entities
- Intents
- Sessions
- SessionContexts
- SessionEntityTypes## Usage
Create a Client instance, providing your access token and the project ID you want to use:
```go
package mainimport (
"fmt"
"os"
dialogflow "github.com/epigos/dialogflow-go"
)func main() {
// dialogflow access token
token := os.Getenv("DIALOGFLOW_ACCESS_TOKEN")
projectID := os.Getenv("DIALOGFLOW_PROJECT_ID")// dialogflow client
client := dialogflow.NewClient(token, projectID)// retrieve all entity types
entityTypes, err := client.EntityTypeList()if err != nil {
fmt.Println(err)
}
fmt.Println(entityTypes)
}
```## Unit tests
go test -race -v
## Documentation
- For full usage and examples see the [Godoc](http://godoc.org/github.com/epigos/dialogflow-go)
- [Dialogflow v2 API reference](https://cloud.google.com/dialogflow-enterprise/docs/reference/rest/v2-overview)## Todo
- Add `Entities` resource
- Add `Intents` resource
- Add `Sessions` resource
- Add `SessionContexts` resource
- Add `SessionEntityTypes` resource## Author
Philip Adzanoukpe [@epigos](https://twitter.com/@epigos)