Documentation
¶
Index ¶
- Constants
- type AgentServer
- func (s *AgentServer) ExecuteLocalJob(ctx context.Context, roomName string, participantIdentity string) error
- func (s *AgentServer) GetConsoleSession() any
- func (s *AgentServer) RTCSession(entrypoint func(*JobContext) error, request func(*JobRequest) error, ...)
- func (s *AgentServer) Run(ctx context.Context) error
- func (s *AgentServer) SetConsoleSession(session any)
- type AudioDecoder
- type AudioEncoder
- type JobAcceptArguments
- type JobContext
- func (c *JobContext) AddSIPParticipant(ctx context.Context, callTo string, trunkID string, identity string, ...) (*livekit.SIPParticipantInfo, error)
- func (c *JobContext) Connect(ctx context.Context, cb *lksdk.RoomCallback) error
- func (c *JobContext) DeleteRoom(ctx context.Context, roomName string) (*livekit.DeleteRoomResponse, error)
- func (c *JobContext) Shutdown(reason string)
- func (c *JobContext) TransferSIPParticipant(ctx context.Context, identity string, transferTo string, playDialtone bool) error
- type JobRequest
- type PreConnectAudioBuffer
- type PreConnectAudioHandler
- type RecorderIO
- type RoomIO
- type RoomOptions
- type WorkerOptions
- type WorkerType
Constants ¶
View Source
const PreConnectAudioBufferStream = "lk.agent.pre-connect-audio-buffer"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentServer ¶
type AgentServer struct {
Options WorkerOptions
// contains filtered or unexported fields
}
func NewAgentServer ¶
func NewAgentServer(opts WorkerOptions) *AgentServer
func (*AgentServer) ExecuteLocalJob ¶
func (s *AgentServer) ExecuteLocalJob(ctx context.Context, roomName string, participantIdentity string) error
ExecuteLocalJob runs a job locally without connecting to the worker service, useful for the CLI console
func (*AgentServer) GetConsoleSession ¶
func (s *AgentServer) GetConsoleSession() any
GetConsoleSession retrieves the active local console session
func (*AgentServer) RTCSession ¶
func (s *AgentServer) RTCSession( entrypoint func(*JobContext) error, request func(*JobRequest) error, sessionEnd func(*JobContext) error, )
func (*AgentServer) SetConsoleSession ¶
func (s *AgentServer) SetConsoleSession(session any)
SetConsoleSession allows entrypoints to register their session for console interaction
type AudioDecoder ¶
type AudioEncoder ¶
type JobAcceptArguments ¶
type JobContext ¶
type JobContext struct {
Job *livekit.Job
Room *lksdk.Room
Report *agent.SessionReport
// contains filtered or unexported fields
}
func NewJobContext ¶
func (*JobContext) AddSIPParticipant ¶
func (c *JobContext) AddSIPParticipant(ctx context.Context, callTo string, trunkID string, identity string, name string) (*livekit.SIPParticipantInfo, error)
AddSIPParticipant adds a SIP participant to the room.
func (*JobContext) Connect ¶
func (c *JobContext) Connect(ctx context.Context, cb *lksdk.RoomCallback) error
func (*JobContext) DeleteRoom ¶
func (c *JobContext) DeleteRoom(ctx context.Context, roomName string) (*livekit.DeleteRoomResponse, error)
DeleteRoom deletes the room and disconnects all participants.
func (*JobContext) Shutdown ¶
func (c *JobContext) Shutdown(reason string)
func (*JobContext) TransferSIPParticipant ¶
func (c *JobContext) TransferSIPParticipant(ctx context.Context, identity string, transferTo string, playDialtone bool) error
TransferSIPParticipant transfers a SIP participant to another number.
type JobRequest ¶
func (*JobRequest) Accept ¶
func (r *JobRequest) Accept(args JobAcceptArguments) error
func (*JobRequest) Reject ¶
func (r *JobRequest) Reject() error
type PreConnectAudioBuffer ¶
type PreConnectAudioBuffer struct {
Timestamp time.Time
Frames []*model.AudioFrame
}
type PreConnectAudioHandler ¶
type PreConnectAudioHandler struct {
// contains filtered or unexported fields
}
func NewPreConnectAudioHandler ¶
func NewPreConnectAudioHandler(room *lksdk.Room, timeout time.Duration) *PreConnectAudioHandler
func (*PreConnectAudioHandler) Register ¶
func (h *PreConnectAudioHandler) Register()
func (*PreConnectAudioHandler) WaitForData ¶
func (h *PreConnectAudioHandler) WaitForData(ctx context.Context, trackID string) []*model.AudioFrame
type RecorderIO ¶
type RecorderIO struct {
Session *agent.AgentSession
InputStartTime *time.Time
OutputStartTime *time.Time
// contains filtered or unexported fields
}
func NewRecorderIO ¶
func NewRecorderIO(session *agent.AgentSession) *RecorderIO
func (*RecorderIO) RecordInput ¶
func (r *RecorderIO) RecordInput(frame *model.AudioFrame)
func (*RecorderIO) RecordOutput ¶
func (r *RecorderIO) RecordOutput(frame *model.AudioFrame)
func (*RecorderIO) Stop ¶
func (r *RecorderIO) Stop() error
type RoomIO ¶
type RoomIO struct {
Room *lksdk.Room
AgentSession *agent.AgentSession
Options RoomOptions
Recorder *RecorderIO
// contains filtered or unexported fields
}
func NewRoomIO ¶
func NewRoomIO(room *lksdk.Room, session *agent.AgentSession, opts RoomOptions) *RoomIO
func (*RoomIO) GetCallback ¶
func (rio *RoomIO) GetCallback() *lksdk.RoomCallback
func (*RoomIO) PublishAudio ¶
func (rio *RoomIO) PublishAudio(frame *model.AudioFrame) error
type RoomOptions ¶
type RoomOptions struct {
}
type WorkerOptions ¶
type WorkerType ¶
type WorkerType string
const ( WorkerTypeRoom WorkerType = "room" WorkerTypePublisher WorkerType = "publisher" )
Click to show internal directories.
Click to hide internal directories.