func (api APIAI) TTS(text string, filepath string) error {
	req, err := http.NewRequest("GET", fmt.Sprintf(apiEndpoint, "tts", api.Version), nil)
	if err != nil {
		return err
	}
	req.Header.Add("Authorization", "Bearer "+api.AuthToken)
	req.Header.Add("Accept-Language", "en-US")
	client := http.Client{}
	q := req.URL.Query()
	q.Add("text", text)
	req.URL.RawQuery = q.Encode()
	resp, err := client.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	file, err := os.Create(filepath)
	if err != nil {
		return err
	}
	defer file.Close()
	io.Copy(file, resp.Body)
	return nil
}
TTS sends query to API.ai and saves the speech response to specified filepath in wav format
package apiaigo
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"os"
)
type APIAI struct {
	Version   string
	Language  string
	AuthToken string
	SessionID string
}
const apiEndpoint string = "https://api.api.ai/v1/%s?v=%s"
func (api APIAI) SendText(text string) (ResponseStruct, error) {
	query := QueryStruct{
		Query:     text,
		Language:  api.Language,
		SessionID: api.SessionID,
	}
	return Response(query, api)
}