Documentation
¶
Overview ¶
This package provides the prerecorded client implementation for the Deepgram API
Index ¶
- Constants
- Variables
- func Init(init InitLib)
- func InitWithDefault()
- func NewREST(apiKey string, options *interfaces.ClientOptions) *listenv1rest.Client
- func NewRESTWithDefaults() *listenv1rest.Client
- func NewWebSocket(ctx context.Context, apiKey string, cOptions *interfaces.ClientOptions, ...) (*listenv1ws.Client, error)
- func NewWebSocketForDemo(ctx context.Context, options *interfaces.LiveTranscriptionOptions) (*listenv1ws.Client, error)
- func NewWebSocketWithCancel(ctx context.Context, ctxCancel context.CancelFunc, apiKey string, ...) (*listenv1ws.Client, error)
- func NewWebSocketWithDefaults(ctx context.Context, tOptions *interfaces.LiveTranscriptionOptions, ...) (*listenv1ws.Client, error)
- type InitLib
- type LiveClientdeprecated
- type PreRecordedClientdeprecated
- type RestClient
- type WebSocketClient
Constants ¶
const ( LogLevelDefault = common.LogLevelDefault LogLevelErrorOnly = common.LogLevelErrorOnly LogLevelStandard = common.LogLevelStandard LogLevelElevated = common.LogLevelElevated LogLevelFull = common.LogLevelFull LogLevelDebug = common.LogLevelDebug LogLevelTrace = common.LogLevelTrace LogLevelVerbose = common.LogLevelVerbose )
please see pkg/common/init.go for more information
const (
RESTPackageVersion = listenv1rest.PackageVersion
)
********************************* REST Client *********************************
const (
WebSocketPackageVersion = listenv1ws.PackageVersion
)
********************************* LiveClient *********************************
Variables ¶
var NewLive = NewWebSocket
NewLive is an alias for NewWebSocket
Deprecated: This package is deprecated. Use NewWebSocket instead. This will be removed in a future release.
var NewLiveForDemo = NewWebSocketForDemo
NewLiveForDemo is an alias for NewWebSocketForDemo
Deprecated: This package is deprecated. Use NewWebSocketForDemo instead. This will be removed in a future release.
var NewLiveWithCancel = NewWebSocketWithCancel
NewLiveWithCancel is an alias for NewWebSocketWithCancel
Deprecated: This package is deprecated. Use NewWebSocketWithCancel instead. This will be removed in a future release.
var NewLiveWithDefaults = NewWebSocketWithDefaults
NewLiveWithDefaults is an alias for NewWebSocketWithDefaults
Deprecated: This package is deprecated. Use NewWebSocketWithDefaults instead. This will be removed in a future release.
var NewPreRecorded = NewREST
NewPreRecorded is an alias for NewREST
Deprecated: This package is deprecated. Use NewREST instead. This will be removed in a future release.
var NewPreRecordedWithDefaults = NewRESTWithDefaults
NewPreRecordedWithDefaults is an alias for NewRESTWithDefaults
Deprecated: This package is deprecated. Use NewRESTWithDefaults instead. This will be removed in a future release.
Functions ¶
func Init ¶
func Init(init InitLib)
The SDK Init function for this library. Allows you to set the logging level and use of a log file. Default is output to the stdout.
func InitWithDefault ¶
func InitWithDefault()
InitWithDefault is the SDK Init function for this library using default values.
func NewREST ¶
func NewREST(apiKey string, options *interfaces.ClientOptions) *listenv1rest.Client
NewREST creates a new prerecorded client with the specified options
Input parameters: - apiKey: string containing the Deepgram API key - options: ClientOptions which allows overriding things like hostname, version of the API, etc.
func NewRESTWithDefaults ¶
func NewRESTWithDefaults() *listenv1rest.Client
NewRESTWithDefaults creates a new analyze/read client with all default options
Notes:
- The Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY
func NewWebSocket ¶
func NewWebSocket(ctx context.Context, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.LiveTranscriptionOptions, callback msginterfaces.LiveMessageCallback) (*listenv1ws.Client, error)
NewWebSocket creates a new websocket connection with the specified options
Input parameters: - ctx: context.Context object - apiKey: string containing the Deepgram API key - cOptions: ClientOptions which allows overriding things like hostname, version of the API, etc. - tOptions: LiveTranscriptionOptions which allows overriding things like language, model, etc. - callback: LiveMessageCallback which is a callback that allows you to perform actions based on the transcription
Notes:
- If apiKey is an empty string, the Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY
- The callback handler is set to the default handler which just prints all messages to the console
func NewWebSocketForDemo ¶
func NewWebSocketForDemo(ctx context.Context, options *interfaces.LiveTranscriptionOptions) (*listenv1ws.Client, error)
NewWebSocketForDemo creates a new websocket connection with all default options
Notes:
- The Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY
func NewWebSocketWithCancel ¶
func NewWebSocketWithCancel(ctx context.Context, ctxCancel context.CancelFunc, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.LiveTranscriptionOptions, callback msginterfaces.LiveMessageCallback) (*listenv1ws.Client, error)
NewWebSocketWithCancel creates a new websocket connection but has facilities to BYOC (Bring Your Own Cancel)
Input parameters: - ctx: context.Context object - ctxCancel: allow passing in own cancel - apiKey: string containing the Deepgram API key - cOptions: ClientOptions which allows overriding things like hostname, version of the API, etc. - tOptions: LiveTranscriptionOptions which allows overriding things like language, model, etc. - callback: LiveMessageCallback which is a callback that allows you to perform actions based on the transcription
Notes:
- If apiKey is an empty string, the Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY
- The callback handler is set to the default handler which just prints all messages to the console
func NewWebSocketWithDefaults ¶
func NewWebSocketWithDefaults(ctx context.Context, tOptions *interfaces.LiveTranscriptionOptions, callback msginterfaces.LiveMessageCallback) (*listenv1ws.Client, error)
NewWebSocketWithDefaults creates a new websocket connection with all default options
Input parameters: - ctx: context.Context object - tOptions: LiveTranscriptionOptions which allows overriding things like language, model, etc. - callback: LiveMessageCallback which is a callback that allows you to perform actions based on the transcription
Notes:
- The Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY
- The callback handler is set to the default handler which just prints all messages to the console
Types ¶
type LiveClient
deprecated
type LiveClient = listenv1ws.Client
LiveClient is an alias for listenv1rest.Client
Deprecated: This package is deprecated. Use WebSocketClient instead. This will be removed in a future release.
type PreRecordedClient
deprecated
type PreRecordedClient = listenv1rest.Client
PreRecordedClient is an alias for listenv1rest.Client
Deprecated: This package is deprecated. Use RestClient instead. This will be removed in a future release.
type RestClient ¶
type RestClient = listenv1rest.Client
RestClient is an alias for listenv1rest.Client
type WebSocketClient ¶
type WebSocketClient = listenv1ws.Client
WebSocketClient is an alias for listenv1ws.Client
Directories
¶
Path | Synopsis |
---|---|
v1
|
|
rest
This package provides the prerecorded client implementation for the Deepgram API
|
This package provides the prerecorded client implementation for the Deepgram API |
websocket
This package provides the live/streaming client implementation for the Deepgram API
|
This package provides the live/streaming client implementation for the Deepgram API |