dialogflow-go-client icon indicating copy to clipboard operation
dialogflow-go-client copied to clipboard

Go library for DialogFlow (API.AI) 😎

dialogflow-go-client

CircleCI License Go Report Card

This library allows integrating agents from the DialogFlow natural language processing service with your Golang application.

  • Prerequsites
  • Installation
  • Features
  • Usage
  • Documentation

Prerequsites

Create an DialogFlow account.

Installation

go get github.com/mlabouardy/dialogflow-go-client

Features

  • Queries
  • Contexts
  • Intents
  • UserIntents
  • Entities

Usage

  • Create main.go file with the following code:
package main

import (
	"fmt"
	. "github.com/mlabouardy/dialogflow-go-client"
	. "github.com/mlabouardy/dialogflow-go-client/models"
	"log"
)

func main() {
	err, client := NewDialogFlowClient(Options{
		AccessToken: "<API.AI TOKEN GOES HERE>",
	})
	if err != nil {
		log.Fatal(err)
	}

	entities, err := client.EntitiesFindAllRequest()
	if err != nil {
		log.Fatal(err)
	}
	for _, entity := range entities {
		fmt.Println(entity.Name)
	}
}
  • Run following command.
go run main.go
  • Your can find more examples in examples directory.

Tutorials

Documentation

Documentation is available at https://dialogflow.com/docs.