This package allows integrating your Golang application with Dialogflow v2
Standard go get:
go get github.com/epigos/dialogflow-go
- Agents
- EntityTypes
- Entities
- Intents
- Sessions
- SessionContexts
- SessionEntityTypes
Create a Client instance, providing your access token and the project ID you want to use:
package main
import (
"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)
}
go test -race -v
- For full usage and examples see the Godoc
- Dialogflow v2 API reference
- Add
Entities
resource - Add
Intents
resource - Add
Sessions
resource - Add
SessionContexts
resource - Add
SessionEntityTypes
resource
Philip Adzanoukpe @epigos