Documentation ¶
Overview ¶
This package defines the live API for Deepgram
Index ¶
- Variables
- type DefaultCallbackHandler
- func (dch DefaultCallbackHandler) Error(er *interfaces.ErrorResponse) error
- func (dch DefaultCallbackHandler) Message(mr *interfaces.MessageResponse) error
- func (dch DefaultCallbackHandler) Metadata(md *interfaces.MetadataResponse) error
- func (dch DefaultCallbackHandler) SpeechStarted(ssr *interfaces.SpeechStartedResponse) error
- func (dch DefaultCallbackHandler) UtteranceEnd(ur *interfaces.UtteranceEndResponse) error
- type MessageRouter
- func (r *MessageRouter) ErrorResponse(byMsg []byte) error
- func (r *MessageRouter) Message(byMsg []byte) error
- func (r *MessageRouter) MessageResponse(byMsg []byte) error
- func (r *MessageRouter) MetadataResponse(byMsg []byte) error
- func (r *MessageRouter) SpeechStartedResponse(byMsg []byte) error
- func (r *MessageRouter) UnhandledMessage(byMsg []byte) error
- func (r *MessageRouter) UtteranceEndResponse(byMsg []byte) error
- type MessageType
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidMessageType invalid message type ErrInvalidMessageType = errors.New("invalid message type") // ErrUserCallbackNotDefined user callback object not defined ErrUserCallbackNotDefined = errors.New("user callback object not defined") )
Functions ¶
This section is empty.
Types ¶
type DefaultCallbackHandler ¶
type DefaultCallbackHandler struct{}
DefaultCallbackHandler is a default callback handler for live transcription Simply prints the transcript to stdout
func NewDefaultCallbackHandler ¶
func NewDefaultCallbackHandler() DefaultCallbackHandler
NewDefaultCallbackHandler creates a new DefaultCallbackHandler
func (DefaultCallbackHandler) Error ¶
func (dch DefaultCallbackHandler) Error(er *interfaces.ErrorResponse) error
func (DefaultCallbackHandler) Message ¶
func (dch DefaultCallbackHandler) Message(mr *interfaces.MessageResponse) error
Message is the callback for a message
func (DefaultCallbackHandler) Metadata ¶
func (dch DefaultCallbackHandler) Metadata(md *interfaces.MetadataResponse) error
Metadata is the callback for a metadata
func (DefaultCallbackHandler) SpeechStarted ¶ added in v1.1.1
func (dch DefaultCallbackHandler) SpeechStarted(ssr *interfaces.SpeechStartedResponse) error
func (DefaultCallbackHandler) UtteranceEnd ¶ added in v1.0.2
func (dch DefaultCallbackHandler) UtteranceEnd(ur *interfaces.UtteranceEndResponse) error
type MessageRouter ¶
type MessageRouter struct {
// contains filtered or unexported fields
}
MessageRouter is helper struct that routes events
func New ¶
func New(callback interfaces.LiveMessageCallback) *MessageRouter
New creates a MessageRouter with user defined callback
func NewWithDefault ¶
func NewWithDefault() *MessageRouter
NewWithDefault creates a default MessageRouter
func (*MessageRouter) ErrorResponse ¶
func (r *MessageRouter) ErrorResponse(byMsg []byte) error
func (*MessageRouter) Message ¶
func (r *MessageRouter) Message(byMsg []byte) error
Message handles platform messages
func (*MessageRouter) MessageResponse ¶
func (r *MessageRouter) MessageResponse(byMsg []byte) error
MessageResponse handles the MessageResponse message
func (*MessageRouter) MetadataResponse ¶
func (r *MessageRouter) MetadataResponse(byMsg []byte) error
func (*MessageRouter) SpeechStartedResponse ¶ added in v1.1.1
func (r *MessageRouter) SpeechStartedResponse(byMsg []byte) error
func (*MessageRouter) UnhandledMessage ¶
func (r *MessageRouter) UnhandledMessage(byMsg []byte) error
UnhandledMessage handles the UnhandledMessage message
func (*MessageRouter) UtteranceEndResponse ¶ added in v1.0.2
func (r *MessageRouter) UtteranceEndResponse(byMsg []byte) error
type MessageType ¶
type MessageType struct {
Type string `json:"type"`
}
MessageType is the header to bootstrap you way unmarshalling other messages
Example: { "type": "message", "message": { ... } }
Directories ¶
Path | Synopsis |
---|---|
This package defines interfaces for the live API
|
This package defines interfaces for the live API |