Skip to content

marcossegovia/apiai-go

Repository files navigation

Go SDK for api.ai

Go Report Card GoDoc Build Status codecov

This library allows you to integrate Api.ai natural language processing service with your Go application. For more information see the docs.

We encourage you to follow this official guide to get started in 5 steps before proceeding.

Installation

go get github.com/marcossegovia/apiai-go

Usage

import (
        "fmt"

        "github.com/marcossegovia/apiai-go"
)

func main() {
    client, err := apiai.NewClient(
        &apiai.ClientConfig{
            Token:      "YOUR-API-AI-TOKEN",
            QueryLang:  "en",    //Default en
            SpeechLang: "en-US", //Default en-US
        },
    )
    if err != nil {
        fmt.Printf("%v", err)
    }
    //Set the query string and your current user identifier.
    qr, err := client.Query(apiai.Query{Query: []string{"My name is Marcos and I live in Barcelona"}, SessionId: "123454321"})
    if err != nil {
        fmt.Printf("%v", err)
    }
    fmt.Printf("%v", qr.Result.Fulfillment.Speech)
}

Bugs & Issues

See CONTRIBUTING

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages