Go library for wit.ai HTTP API
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial import Apr 26, 2016
README.md Edit sample code in README.md May 17, 2016
types.go Edit back Apr 27, 2016
types_helper.go Edit helper function for type: Converse Apr 27, 2016
witai.go Mark deprecated APIs and change order of functions May 17, 2016

README.md

wit.ai-go

Go library for wit.ai HTTP API

How to install

$ go get -u github.com/meinside/wit.ai-go

Usage

package main

import (
	"fmt"

	witai "github.com/meinside/wit.ai-go"
)

const (
	Token = "YOUR-WIT.AI-APP-SPECIFIC-TOKEN-HERE"
)

func main() {
	c := witai.NewClient(Token)

	//c.Verbose = false
	c.Verbose = true // for verbose messages

	// message
	if result, err := c.QueryMessage("how's the weather today?", nil, "", ""); err == nil {
		fmt.Printf("query message result: %+v\n", result)
	} else {
		fmt.Printf("%s\n", err)
	}

	// speech
	if result, err := c.QuerySpeechMp3("/some/where/test_voice.mp3", nil, "", "", 1); err == nil {
		fmt.Printf("query speech result: %+v\n", result)
	} else {
		fmt.Printf("%s\n", err)
	}
}