Documentation
¶
Index ¶
- Constants
- Variables
- type ChanRouter
- func (r *ChanRouter) Binary(byMsg []byte) error
- func (r *ChanRouter) Close(cr *interfaces.CloseResponse) error
- func (r *ChanRouter) Error(er *interfaces.ErrorResponse) error
- func (r *ChanRouter) Message(byMsg []byte) error
- func (r *ChanRouter) Open(or *interfaces.OpenResponse) error
- func (r *ChanRouter) UnhandledMessage(byMsg []byte) error
- type DefaultChanHandler
- func (dch DefaultChanHandler) GetAgentAudioDone() []*chan *interfaces.AgentAudioDoneResponse
- func (dch DefaultChanHandler) GetAgentStartedSpeaking() []*chan *interfaces.AgentStartedSpeakingResponse
- func (dch DefaultChanHandler) GetAgentThinking() []*chan *interfaces.AgentThinkingResponse
- func (dch DefaultChanHandler) GetBinary() []*chan *[]byte
- func (dch DefaultChanHandler) GetClose() []*chan *interfaces.CloseResponse
- func (dch DefaultChanHandler) GetConversationText() []*chan *interfaces.ConversationTextResponse
- func (dch DefaultChanHandler) GetError() []*chan *interfaces.ErrorResponse
- func (dch DefaultChanHandler) GetFunctionCallRequest() []*chan *interfaces.FunctionCallRequestResponse
- func (dch DefaultChanHandler) GetFunctionCalling() []*chan *interfaces.FunctionCallingResponse
- func (dch DefaultChanHandler) GetInjectionRefused() []*chan *interfaces.InjectionRefusedResponse
- func (dch DefaultChanHandler) GetKeepAlive() []*chan *interfaces.KeepAlive
- func (dch DefaultChanHandler) GetOpen() []*chan *interfaces.OpenResponse
- func (dch DefaultChanHandler) GetSettingsApplied() []*chan *interfaces.SettingsAppliedResponse
- func (dch DefaultChanHandler) GetUnhandled() []*chan *[]byte
- func (dch DefaultChanHandler) GetUserStartedSpeaking() []*chan *interfaces.UserStartedSpeakingResponse
- func (dch DefaultChanHandler) GetWelcome() []*chan *interfaces.WelcomeResponse
- func (dch DefaultChanHandler) Run() error
Constants ¶
const (
PackageVersion string = "v1.0"
)
Variables ¶
var ( // ErrInvalidMessageType invalid message type ErrInvalidMessageType = errors.New("invalid message type") // ErrUserChanNotDefined user chan not defined or invalid ErrUserChanNotDefined = errors.New("user chan not defined or invalid") )
Functions ¶
This section is empty.
Types ¶
type ChanRouter ¶
type ChanRouter struct {
// contains filtered or unexported fields
}
ChanRouter routes events
func NewChanRouter ¶
func NewChanRouter(chans interfaces.AgentMessageChan) *ChanRouter
New creates a ChanRouter with a user-defined channels gocritic:ignore
func NewChanWithDefault ¶
func NewChanWithDefault() *ChanRouter
NewWithDefault creates a ChanRouter with the default callback handler
func (*ChanRouter) Binary ¶
func (r *ChanRouter) Binary(byMsg []byte) error
Binary handles platform messages and routes them appropriately based on the MessageType
func (*ChanRouter) Close ¶
func (r *ChanRouter) Close(cr *interfaces.CloseResponse) error
Close sends an CloseResponse message to the callback
func (*ChanRouter) Error ¶
func (r *ChanRouter) Error(er *interfaces.ErrorResponse) error
Error sends an ErrorResponse message to the callback
func (*ChanRouter) Message ¶
func (r *ChanRouter) Message(byMsg []byte) error
Message handles platform messages and routes them appropriately based on the MessageType
func (*ChanRouter) Open ¶
func (r *ChanRouter) Open(or *interfaces.OpenResponse) error
Open sends an OpenResponse message to the callback
func (*ChanRouter) UnhandledMessage ¶
func (r *ChanRouter) UnhandledMessage(byMsg []byte) error
UnhandledMessage logs and handles any unexpected message types
type DefaultChanHandler ¶
type DefaultChanHandler struct {
// contains filtered or unexported fields
}
Using Channels
DefaultCallbackHandler is a default callback handler for live transcription Simply prints the transcript to stdout
func NewDefaultChanHandler ¶
func NewDefaultChanHandler() *DefaultChanHandler
NewDefaultChanHandler creates a new DefaultChanHandler
func (DefaultChanHandler) GetAgentAudioDone ¶
func (dch DefaultChanHandler) GetAgentAudioDone() []*chan *interfaces.AgentAudioDoneResponse
GetAgentAudioDoneResponse returns the agent audio done response channels
func (DefaultChanHandler) GetAgentStartedSpeaking ¶
func (dch DefaultChanHandler) GetAgentStartedSpeaking() []*chan *interfaces.AgentStartedSpeakingResponse
GetAgentStartedSpeakingResponse returns the agent started speaking response channels
func (DefaultChanHandler) GetAgentThinking ¶
func (dch DefaultChanHandler) GetAgentThinking() []*chan *interfaces.AgentThinkingResponse
GetAgentThinkingResponse returns the agent thinking response channels
func (DefaultChanHandler) GetBinary ¶
func (dch DefaultChanHandler) GetBinary() []*chan *[]byte
GetBinary returns the binary channels
func (DefaultChanHandler) GetClose ¶
func (dch DefaultChanHandler) GetClose() []*chan *interfaces.CloseResponse
GetClose returns the close channels
func (DefaultChanHandler) GetConversationText ¶
func (dch DefaultChanHandler) GetConversationText() []*chan *interfaces.ConversationTextResponse
GetConversationTextResponse returns the conversation text response channels
func (DefaultChanHandler) GetError ¶
func (dch DefaultChanHandler) GetError() []*chan *interfaces.ErrorResponse
GetError returns the error channels
func (DefaultChanHandler) GetFunctionCallRequest ¶
func (dch DefaultChanHandler) GetFunctionCallRequest() []*chan *interfaces.FunctionCallRequestResponse
GetFunctionCallRequestResponse returns the function call request response channels
func (DefaultChanHandler) GetFunctionCalling ¶
func (dch DefaultChanHandler) GetFunctionCalling() []*chan *interfaces.FunctionCallingResponse
GetFunctionCallingResponse returns the function calling response channels
func (DefaultChanHandler) GetInjectionRefused ¶
func (dch DefaultChanHandler) GetInjectionRefused() []*chan *interfaces.InjectionRefusedResponse
GetInjectionRefused returns the injection refused channels
func (DefaultChanHandler) GetKeepAlive ¶
func (dch DefaultChanHandler) GetKeepAlive() []*chan *interfaces.KeepAlive
GetKeepAlive returns the keep alive channels
func (DefaultChanHandler) GetOpen ¶
func (dch DefaultChanHandler) GetOpen() []*chan *interfaces.OpenResponse
GetOpen returns the open channels
func (DefaultChanHandler) GetSettingsApplied ¶
func (dch DefaultChanHandler) GetSettingsApplied() []*chan *interfaces.SettingsAppliedResponse
GetSettingsApplied returns the settings applied response channels
func (DefaultChanHandler) GetUnhandled ¶
func (dch DefaultChanHandler) GetUnhandled() []*chan *[]byte
GetUnhandled returns the unhandled event channels
func (DefaultChanHandler) GetUserStartedSpeaking ¶
func (dch DefaultChanHandler) GetUserStartedSpeaking() []*chan *interfaces.UserStartedSpeakingResponse
GetUserStartedSpeakingResponse returns the user started speaking response channels
func (DefaultChanHandler) GetWelcome ¶
func (dch DefaultChanHandler) GetWelcome() []*chan *interfaces.WelcomeResponse
GetWelcomeResponse returns the welcome response channels
func (DefaultChanHandler) Run ¶
func (dch DefaultChanHandler) Run() error
Open is the callback for when the connection opens
Directories
¶
Path | Synopsis |
---|---|
This package defines interfaces for the live API
|
This package defines interfaces for the live API |