aivahealth / apiai-go

Unofficial Go SDK for api.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Unofficial Go SDK for api.ai

License:MIT License


Languages

Language:Go 100.0%