Documentation
¶
Overview ¶
This package provides the agent client implementation for the Deepgram API
Index ¶
- Constants
- func Init(init InitLib)
- func InitWithDefault()
- func NewSettingsConfigurationOptions() *interfaces.SettingsConfigurationOptions
- func NewWSUsingChan(ctx context.Context, apiKey string, cOptions *interfaces.ClientOptions, ...) (*listenv1ws.WSChannel, error)
- func NewWSUsingChanForDemo(ctx context.Context, options *interfaces.SettingsConfigurationOptions) (*listenv1ws.WSChannel, error)
- func NewWSUsingChanWithCancel(ctx context.Context, ctxCancel context.CancelFunc, apiKey string, ...) (*listenv1ws.WSChannel, error)
- func NewWSUsingChanWithDefaults(ctx context.Context, options *interfaces.SettingsConfigurationOptions, ...) (*listenv1ws.WSChannel, error)
- type InitLib
- type WSChannel
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 (
WebSocketPackageVersion = listenv1ws.PackageVersion
)
********************************* WebSocket Agent *********************************
Variables ¶
This section is empty.
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 NewSettingsConfigurationOptions ¶
func NewSettingsConfigurationOptions() *interfaces.SettingsConfigurationOptions
options
func NewWSUsingChan ¶
func NewWSUsingChan(ctx context.Context, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.SettingsConfigurationOptions, chans msginterfaces.AgentMessageChan) (*listenv1ws.WSChannel, error)
NewWSUsingChan 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: SettingsConfigurationOptions which allows overriding things like language, model, etc. - chans: AgentMessageChan which is a chans that allows you to perform actions based on the transcription
func NewWSUsingChanForDemo ¶
func NewWSUsingChanForDemo(ctx context.Context, options *interfaces.SettingsConfigurationOptions) (*listenv1ws.WSChannel, error)
Using Channels
NewWSUsingChanForDemo creates a new websocket connection for demo purposes only ¶
Input parameters: - ctx: context.Context object - tOptions: SettingsConfigurationOptions which allows overriding things like language, model, etc.
Notes:
- The Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY
func NewWSUsingChanWithCancel ¶
func NewWSUsingChanWithCancel(ctx context.Context, ctxCancel context.CancelFunc, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.SettingsConfigurationOptions, chans msginterfaces.AgentMessageChan) (*listenv1ws.WSChannel, error)
NewWSUsingChanWithCancel creates a new websocket connection with the specified options
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: SettingsConfigurationOptions which allows overriding things like language, model, etc. - chans: AgentMessageChan which is a chans that allows you to perform actions based on the transcription
func NewWSUsingChanWithDefaults ¶
func NewWSUsingChanWithDefaults(ctx context.Context, options *interfaces.SettingsConfigurationOptions, chans msginterfaces.AgentMessageChan) (*listenv1ws.WSChannel, error)
NewWebSocketUsingChanWithDefaults creates a new websocket connection with all default options
Input parameters: - ctx: context.Context object - tOptions: SettingsConfigurationOptions which allows overriding things like language, model, etc.
Notes:
- The Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY
- The chans handler is set to the default handler which just prints all messages to the console
Types ¶
type WSChannel ¶
type WSChannel = listenv1ws.WSChannel
WSChannel is an alias for listenv1ws.WSChannel