restv1

package
v1.6.0-dev.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

This package provides the speak client implementation for the Deepgram API

Index

Constants

View Source
const (
	PackageVersion string = "v1.0"
)

Variables

View Source
var (
	// ErrInvalidInput required input was not found
	ErrInvalidInput = errors.New("required input was not found")
)

errors

Functions

This section is empty.

Types

type Client

type Client = RESTClient

Client is an alias for RESTClient

func New

func New(apiKey string, options *interfaces.ClientOptions) *Client

New creates a new speak client with the specified options

Input parameters: - ctx: context.Context object - apiKey: string containing the Deepgram API key - options: ClientOptions which allows overriding things like hostname, version of the API, etc.

func NewWithDefaults

func NewWithDefaults() *Client

NewWithDefaults creates a new speak client with all default options

Notes:

  • The Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY

func (*Client) DoText

func (c *Client) DoText(ctx context.Context, text string, options *interfaces.SpeakOptions, keys []string, resBody interface{}) (map[string]string, error)

DoText posts the text to be spoken to a given REST endpoint

Input parameters: - ctx: context.Context object - text: contains the text for Text-to-Speech - req: SpeakOptions which allows configuring things like the speech model, etc.

Output parameters: - resBody: interface{} which will be populated with the response from the server

type RESTClient added in v1.6.0

type RESTClient struct {
	*common.RESTClient
}

Client implements helper functionality for Prerecorded API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL