GithubHelp home page GithubHelp logo

mlabouardy / dialogflow-go-client Goto Github PK

View Code? Open in Web Editor NEW
79.0 7.0 20.0 66 KB

Go library for DialogFlow (API.AI) ๐Ÿ˜Ž

License: Apache License 2.0

Go 100.00%
apiai sdk golang bot machine-learning dialogflow

dialogflow-go-client's Introduction

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

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.

dialogflow-go-client's People

Contributors

mlabouardy avatar plasticlife-art avatar push-pol-rebase avatar yogyrahmawan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dialogflow-go-client's Issues

Return parameters order

When you create a client you return error then the client.

Feels very odd compared to all the other libraries I've used.

	err, client := NewDialogFlowClient(Options{
		AccessToken: "<API.AI TOKEN GOES HERE>",
	})

help me!! To use function EntitiesCreateRequest

If you use Japanese for Entries of EntityCreateRequest, garbled characters will occur, but are there any findings?
If lang is not set in the specification of dialogflow, it says that the default language will be used, but do you know something?

Integer in Result.parameters Error

With action entity @sys.number dialogflow returns integer to parameters json and parsing json to string array cause error.

Error
json: cannot unmarshal string into Go struct field Result.parameters of type []string

SessionID is binded to client

I'm just wondering should sessionID be independent of the client?

For example, if I want to get the context of a user, each user should have a different sessionID, but in order to get the context of the user, I have to call SetSessionID so that client.GetSessionID() will return the sessionID of the particular user which is a bit weird.

If I am using it wrong, please tell me how it should be used, thanks ๐Ÿ˜„

Go get : multiple-value uuid.NewV4() in single-value context

Hi,

I have some trouble go-getting your client using Golang version 1.9.2. Here is the error message :

$ go get -u github.com/mlabouardy/dialogflow-go-client
# github.com/mlabouardy/dialogflow-go-client
../../mlabouardy/dialogflow-go-client/apiai.go:47:32: multiple-value uuid.NewV4() in single-value context

For now, I just want to test dialogflow with my own chat server so I will build the query myself. But if I find some time during the next week I'll try to figure out what's going wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.