Documentation
¶
Overview ¶
This package defines interfaces for the live API
Index ¶
- Constants
- type AgentAudioDoneResponse
- type AgentMessageChan
- type AgentStartedSpeakingResponse
- type AgentThinkingResponse
- type Close
- type CloseResponse
- type ConversationTextResponse
- type ErrorResponse
- type FunctionCallRequestResponse
- type FunctionCallResponse
- type InjectAgentMessage
- type InjectUserMessage
- type InjectionRefusedResponse
- type KeepAlive
- type MessageType
- type OpenResponse
- type SettingsAppliedResponse
- type SettingsOptions
- type TypeResponse
- type UpdatePrompt
- type UpdateSpeak
- type UserStartedSpeakingResponse
- type WelcomeResponse
Constants ¶
const ( TypeSettings = "Settings" TypeUpdatePrompt = "UpdatePrompt" TypeUpdateSpeak = "UpdateSpeak" TypeInjectAgentMessage = "InjectAgentMessage" TypeInjectUserMessage = "InjectUserMessage" TypeFunctionCallResponse = "FunctionCallResponse" TypeKeepAlive = "KeepAlive" TypeClose = "Close" )
client message types
const ( // message types TypeOpenResponse = commoninterfaces.TypeOpenResponse TypeWelcomeResponse = "Welcome" TypeConversationTextResponse = "ConversationText" TypeUserStartedSpeakingResponse = "UserStartedSpeaking" TypeAgentThinkingResponse = "AgentThinking" TypeFunctionCallRequestResponse = "FunctionCallRequest" TypeAgentStartedSpeakingResponse = "AgentStartedSpeaking" TypeAgentAudioDoneResponse = "AgentAudioDone" TypeCloseResponse = commoninterfaces.TypeCloseResponse TypeErrorResponse = commoninterfaces.TypeErrorResponse TypeInjectionRefusedResponse = "InjectionRefused" TypeSettingsAppliedResponse = "SettingsApplied" )
server message types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentAudioDoneResponse ¶
type AgentAudioDoneResponse struct {
Type string `json:"type,omitempty"`
}
AgentAudioDoneResponse is the response from the Agent audio done
type AgentMessageChan ¶
type AgentMessageChan interface {
GetBinary() []*chan *[]byte
GetOpen() []*chan *OpenResponse
GetWelcome() []*chan *WelcomeResponse
GetConversationText() []*chan *ConversationTextResponse
GetUserStartedSpeaking() []*chan *UserStartedSpeakingResponse
GetAgentThinking() []*chan *AgentThinkingResponse
GetFunctionCallRequest() []*chan *FunctionCallRequestResponse
GetAgentStartedSpeaking() []*chan *AgentStartedSpeakingResponse
GetAgentAudioDone() []*chan *AgentAudioDoneResponse
GetClose() []*chan *CloseResponse
GetError() []*chan *ErrorResponse
GetUnhandled() []*chan *[]byte
GetInjectionRefused() []*chan *InjectionRefusedResponse
GetKeepAlive() []*chan *KeepAlive
GetSettingsApplied() []*chan *SettingsAppliedResponse
}
Chan Interfaces
AgentMessageChan is a callback used to receive notifcations for platforms messages
type AgentStartedSpeakingResponse ¶
type AgentStartedSpeakingResponse struct {
Type string `json:"type,omitempty"`
TotalLatency float64 `json:"total_latency,omitempty"`
TtsLatency float64 `json:"tts_latency,omitempty"`
TttLatency float64 `json:"ttt_latency,omitempty"`
}
AgentStartedSpeakingResponse is the response from the Agent starting to speak. You will ONLY get this if `experimental` is set to true.
type AgentThinkingResponse ¶
type AgentThinkingResponse struct {
Type string `json:"type,omitempty"`
Content string `json:"content,omitempty"`
}
AgentThinkingResponse is the response from the Agent thinking
type Close ¶
type Close struct {
Type string `json:"type,omitempty"`
}
Close terminates the connection
type CloseResponse ¶
type CloseResponse = commoninterfaces.CloseResponse
CloseResponse is the response from closing the connection
type ConversationTextResponse ¶
type ConversationTextResponse struct {
Type string `json:"type,omitempty"`
Role string `json:"role,omitempty"`
Content string `json:"content,omitempty"`
}
ConversationTextResponse is the response from the conversation text
type ErrorResponse ¶
type ErrorResponse = interfaces.DeepgramError
ErrorResponse is the Deepgram specific response error
type FunctionCallRequestResponse ¶
type FunctionCallRequestResponse struct {
Type string `json:"type,omitempty"`
FunctionName string `json:"function_name,omitempty"`
FunctionCallID string `json:"function_call_id,omitempty"`
Input map[string]string `json:"input,omitempty"` // TODO: this is still undefined
}
FunctionCallRequestResponse is the response from a function call request
type FunctionCallResponse ¶
type FunctionCallResponse struct {
Type string `json:"type,omitempty"`
FunctionCallID string `json:"function_call_id,omitempty"`
Output string `json:"output,omitempty"`
}
FunctionCallResponse is the response from a function call
type InjectAgentMessage ¶
type InjectAgentMessage struct {
Type string `json:"type,omitempty"`
Content string `json:"content,omitempty"`
}
InjectAgentMessage is the request to inject a message into the Agent
type InjectUserMessage ¶ added in v3.3.0
type InjectUserMessage struct {
Type string `json:"type,omitempty"`
Content string `json:"content,omitempty"`
}
InjectUserMessage is the request to interact with the agent using text.
type InjectionRefusedResponse ¶
type InjectionRefusedResponse struct {
Type string `json:"type,omitempty"`
Message string `json:"message,omitempty"`
}
InjectionRefusedResponse is the response when an agent message injection is refused
type KeepAlive ¶
type KeepAlive struct {
Type string `json:"type,omitempty"`
}
KeepAlive is the request to keep the connection alive
type MessageType ¶
type MessageType struct {
Type string `json:"type"`
}
********************************* MessageType is the header to bootstrap you way unmarshalling other messages *********************************
Example:
{
"type": "message",
"message": {
...
}
}
type OpenResponse ¶
type OpenResponse = commoninterfaces.OpenResponse
********************************* Results from Agent/Server ********************************* OpenResponse is the response from opening the connection
type SettingsAppliedResponse ¶
type SettingsAppliedResponse struct {
Type string `json:"type,omitempty"`
}
SettingsAppliedResponse is the response confirming settings were applied
type SettingsOptions ¶
type SettingsOptions interfaces.SettingsOptions
********************************* Request/Input structs *********************************
type TypeResponse ¶
type TypeResponse commoninterfaces.TypeResponse
These are the message types that can be received from the live API
type UpdatePrompt ¶
type UpdatePrompt struct {
Type string `json:"type,omitempty"`
Prompt string `json:"instructions,omitempty"`
}
UpdatePrompt is the request to update the Agent prompt
type UpdateSpeak ¶
type UpdateSpeak struct {
Type string `json:"type,omitempty"`
Speak interfaces.SpeakOptions `json:"speak,omitempty"`
}
UpdateSpeak is the request to update configuration for speaking
type UserStartedSpeakingResponse ¶
type UserStartedSpeakingResponse struct {
Type string `json:"type,omitempty"`
}
UserStartedSpeakingResponse is the response from the user starting to speak
type WelcomeResponse ¶
type WelcomeResponse struct {
Type string `json:"type,omitempty"`
RequestID string `json:"request_id,omitempty"`
}
WelcomeResponse is the response from the welcome message