Giter Club home page Giter Club logo

apiai-go's Introduction

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

apiai-go's People

Contributors

hysios avatar marcossegovia avatar rafalbromirski avatar warent avatar

Stargazers

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

Watchers

 avatar  avatar

apiai-go's Issues

/contexts & sessionId

Hey,

Actually it's more like a question because I have a feeling that something is not right. Here we go:

I started working with /context end-point and I've seen that you implemented all methods that API.ai provides with (https://docs.api.ai/docs/contexts). When I looked into DELETE method is says:

Deletes all contexts from the specified session.

Query Parameters
sessionId – session Id

but in your method I cannot pass sessionId (which API.ai returns when I send a request).

Seems like the SessionID that I had to configure at the very beginning is not the one that I have to use with DELETE. My understanding of sessionId here is a unique identifier for each "client" which is a user, not bot – so there is no need to generate it at the very beginning.

What do you think about it?

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.