interfacesv1

package
v1.7.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

This package defines interfaces for the live API

Index

Constants

View Source
const (
	TypeSettingsConfiguration = "SettingsConfiguration"
	TypeUpdateInstructions    = "UpdateInstructions"
	TypeUpdateSpeak           = "UpdateSpeak"
	TypeInjectAgentMessage    = "InjectAgentMessage"
	TypeFunctionCallResponse  = "FunctionCallResponse"
	TypeKeepAlive             = "KeepAlive"
	TypeClose                 = "Close"
)

client message types

View Source
const (
	// message types
	TypeOpenResponse                 = commoninterfaces.TypeOpenResponse
	TypeWelcomeResponse              = "Welcome"
	TypeConversationTextResponse     = "ConversationText"
	TypeUserStartedSpeakingResponse  = "UserStartedSpeaking"
	TypeAgentThinkingResponse        = "AgentThinking"
	TypeFunctionCallRequestResponse  = "FunctionCallRequest"
	TypeFunctionCallingResponse      = "FunctionCalling"
	TypeAgentStartedSpeakingResponse = "AgentStartedSpeaking"
	TypeAgentAudioDoneResponse       = "AgentAudioDone"
	TypeEndOfThoughtResponse         = "EndOfThought"
	TypeCloseResponse                = commoninterfaces.TypeCloseResponse
	TypeErrorResponse                = commoninterfaces.TypeErrorResponse
)

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
	GetFunctionCalling() []*chan *FunctionCallingResponse
	GetAgentStartedSpeaking() []*chan *AgentStartedSpeakingResponse
	GetAgentAudioDone() []*chan *AgentAudioDoneResponse
	GetEndOfThought() []*chan *EndOfThoughtResponse
	GetClose() []*chan *CloseResponse
	GetError() []*chan *ErrorResponse
	GetUnhandled() []*chan *[]byte
}

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

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 EndOfThoughtResponse

type EndOfThoughtResponse struct {
	Type string `json:"type,omitempty"`
}

EndOfThoughtResponse is the response from the end of thought

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 FunctionCallingResponse

type FunctionCallingResponse struct {
	Type   string            `json:"type,omitempty"`
	Output map[string]string `json:"output,omitempty"` // TODO: this is still undefined
}

FunctionCallingResponse is the response from a function calling

type InjectAgentMessage

type InjectAgentMessage struct {
	Type    string `json:"type,omitempty"`
	Message string `json:"message,omitempty"`
}

InjectAgentMessage is the request to inject a message into the Agent

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 SettingsConfigurationOptions

type SettingsConfigurationOptions interfaces.SettingsConfigurationOptions

********************************* Request/Input structs *********************************

type TypeResponse

type TypeResponse commoninterfaces.TypeResponse

These are the message types that can be received from the live API

type UpdateInstructions

type UpdateInstructions struct {
	Type         string `json:"type,omitempty"`
	Instructions string `json:"instructions,omitempty"`
}

UpdateInstructions is the request to update the Agent instructions

type UpdateSpeak

type UpdateSpeak struct {
	Type  string `json:"type,omitempty"`
	Model string `json:"model,omitempty"`
}

UpdateSpeak is the request to update model 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"`
	SessionID string `json:"session_id,omitempty"`
}

WelcomeResponse is the response from the welcome message

Jump to

Keyboard shortcuts

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