agent

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

This package provides the agent client implementation for the Deepgram API

Index

Constants

View Source
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

View Source
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

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

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 InitLib

type InitLib struct {
	LogLevel      common.LogLevel
	DebugFilePath string
}

Initialization options for this SDK.

type WSChannel

type WSChannel = listenv1ws.WSChannel

WSChannel is an alias for listenv1ws.WSChannel

Directories

Path Synopsis
v1
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

Jump to

Keyboard shortcuts

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