Skip to content

Latest commit

 

History

History
75 lines (52 loc) · 1.78 KB

README.md

File metadata and controls

75 lines (52 loc) · 1.78 KB

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