Skip to content

epigos/dialogflow-go

Repository files navigation

Go client for Dialogflow v2 API

Godoc Build Status Go Report Card

This package allows integrating your Golang application with Dialogflow v2

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:

  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)
  }

Unit tests

go test -race -v

Documentation

Todo

  • Add Entities resource
  • Add Intents resource
  • Add Sessions resource
  • Add SessionContexts resource
  • Add SessionEntityTypes resource

Author

Philip Adzanoukpe @epigos

About

Go client for dialogflow.com v2 HTTP API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages