Documentation
¶
Overview ¶
Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.
Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.
Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.
This package implements both MeetingProvider (control plane) and AgentParticipant (media plane) interfaces for LiveKit.
Usage ¶
Import this package to register the LiveKit provider:
import (
"github.com/plexusone/omnimeet-core"
_ "github.com/plexusone/omni-livekit/omnimeet"
)
func main() {
provider, _ := omnimeet.GetMeetingProvider("livekit",
omnimeet.WithAPIKey("your-api-key"),
omnimeet.WithAPISecret("your-api-secret"),
omnimeet.WithServerURL("wss://your-server.livekit.cloud"),
)
// Create a meeting
meeting, _ := provider.CreateMeeting(ctx, omnimeet.CreateMeetingRequest{
Name: "My Meeting",
})
// Generate join token
token, _ := provider.CreateJoinToken(ctx, omnimeet.CreateJoinTokenRequest{
MeetingID: meeting.ID,
Participant: omnimeet.ParticipantInfo{
Name: "AI Assistant",
Kind: omnimeet.ParticipantKindAgent,
},
})
}
Agent Participation ¶
For AI agents that need to join meetings and process audio:
factory := provider.(omnimeet.AgentParticipantFactory)
agent, _ := factory.CreateAgentParticipant(omnimeet.AgentParticipantOptions{
AutoSubscribe: true,
})
agent.JoinMeeting(ctx, meeting.ID, token)
defer agent.LeaveMeeting(ctx)
audioCh, _ := agent.SubscribeToAllAudio(ctx)
for frame := range audioCh {
// Process audio
}
Configuration ¶
The provider can be configured with the following options:
- api_key: LiveKit API key
- api_secret: LiveKit API secret
- server_url: LiveKit server URL (e.g., "wss://your-server.livekit.cloud")
- webhook_secret: Secret for validating webhooks
Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.
Package omnimeet provides a LiveKit implementation of the OmniMeet provider interface.
Index ¶
- func NewProviderFromConfig(config map[string]any) (provider.MeetingProvider, error)
- type AgentParticipant
- func (a *AgentParticipant) ConnectionState() provider.ConnectionState
- func (a *AgentParticipant) Events() <-chan event.Event
- func (a *AgentParticipant) GetParticipant(participantID string) *participant.Participant
- func (a *AgentParticipant) JoinMeeting(ctx context.Context, meetingID string, tok *token.JoinToken) error
- func (a *AgentParticipant) LeaveMeeting(ctx context.Context) error
- func (a *AgentParticipant) LocalParticipant() *participant.Participant
- func (a *AgentParticipant) Meeting() *meeting.Meeting
- func (a *AgentParticipant) OnActiveSpeakerChanged(handler func([]participant.Participant))
- func (a *AgentParticipant) OnDataMessage(handler func(provider.DataMessage))
- func (a *AgentParticipant) OnParticipantJoined(handler func(participant.Participant))
- func (a *AgentParticipant) OnParticipantLeft(handler func(participant.Participant))
- func (a *AgentParticipant) OnTrackPublished(handler func(participant.Participant, track.Track))
- func (a *AgentParticipant) OnTrackUnpublished(handler func(participant.Participant, track.Track))
- func (a *AgentParticipant) PublishAudio(ctx context.Context, frame provider.AudioFrame) error
- func (a *AgentParticipant) RemoteParticipants() []participant.Participant
- func (a *AgentParticipant) SendDataMessage(ctx context.Context, msg provider.DataMessage) error
- func (a *AgentParticipant) StartAudioTrack(ctx context.Context, opts provider.AudioTrackOptions) (provider.AudioWriter, error)
- func (a *AgentParticipant) StopAudioTrack(ctx context.Context) error
- func (a *AgentParticipant) SubscribeToAllAudio(ctx context.Context) (<-chan provider.AudioFrame, error)
- func (a *AgentParticipant) SubscribeToAudio(ctx context.Context, participantID string) (<-chan provider.AudioFrame, error)
- func (a *AgentParticipant) SubscribeToTrack(ctx context.Context, trackID string, opts track.SubscribeOptions) error
- func (a *AgentParticipant) UnsubscribeFromTrack(ctx context.Context, trackID string) error
- type Config
- type Provider
- func (p *Provider) Close() error
- func (p *Provider) CreateAgentParticipant(opts provider.AgentParticipantOptions) (provider.AgentParticipant, error)
- func (p *Provider) CreateJoinToken(ctx context.Context, req token.CreateRequest) (*token.JoinToken, error)
- func (p *Provider) CreateMeeting(ctx context.Context, req meeting.CreateRequest) (*meeting.Meeting, error)
- func (p *Provider) DeleteMeeting(ctx context.Context, meetingID string) error
- func (p *Provider) EndMeeting(ctx context.Context, meetingID string) error
- func (p *Provider) GetMeeting(ctx context.Context, meetingID string) (*meeting.Meeting, error)
- func (p *Provider) GetParticipant(ctx context.Context, meetingID, participantID string) (*participant.Participant, error)
- func (p *Provider) ListMeetings(ctx context.Context, opts meeting.ListOptions) ([]meeting.Meeting, error)
- func (p *Provider) ListParticipants(ctx context.Context, meetingID string) ([]participant.Participant, error)
- func (p *Provider) Name() string
- func (p *Provider) OnEvent(handler event.Handler)
- func (p *Provider) RemoveParticipant(ctx context.Context, meetingID, participantID string) error
- func (p *Provider) SupportsAgentParticipation() bool
- func (p *Provider) UpdateParticipant(ctx context.Context, meetingID, participantID string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProviderFromConfig ¶
func NewProviderFromConfig(config map[string]any) (provider.MeetingProvider, error)
NewProviderFromConfig creates a provider from a generic config map.
Types ¶
type AgentParticipant ¶
type AgentParticipant struct {
// contains filtered or unexported fields
}
AgentParticipant implements the OmniMeet AgentParticipant interface for LiveKit.
func NewAgentParticipant ¶
func NewAgentParticipant(cfg Config, opts provider.AgentParticipantOptions) (*AgentParticipant, error)
NewAgentParticipant creates a new AgentParticipant.
func (*AgentParticipant) ConnectionState ¶
func (a *AgentParticipant) ConnectionState() provider.ConnectionState
ConnectionState returns the current connection state.
func (*AgentParticipant) Events ¶
func (a *AgentParticipant) Events() <-chan event.Event
Events returns a channel of real-time events.
func (*AgentParticipant) GetParticipant ¶
func (a *AgentParticipant) GetParticipant(participantID string) *participant.Participant
GetParticipant returns a specific participant by ID.
func (*AgentParticipant) JoinMeeting ¶
func (a *AgentParticipant) JoinMeeting(ctx context.Context, meetingID string, tok *token.JoinToken) error
JoinMeeting joins the meeting as an agent participant.
func (*AgentParticipant) LeaveMeeting ¶
func (a *AgentParticipant) LeaveMeeting(ctx context.Context) error
LeaveMeeting leaves the current meeting.
func (*AgentParticipant) LocalParticipant ¶
func (a *AgentParticipant) LocalParticipant() *participant.Participant
LocalParticipant returns the local (agent) participant.
func (*AgentParticipant) Meeting ¶
func (a *AgentParticipant) Meeting() *meeting.Meeting
Meeting returns the current meeting.
func (*AgentParticipant) OnActiveSpeakerChanged ¶
func (a *AgentParticipant) OnActiveSpeakerChanged(handler func([]participant.Participant))
OnActiveSpeakerChanged registers a handler for active speaker changes.
func (*AgentParticipant) OnDataMessage ¶
func (a *AgentParticipant) OnDataMessage(handler func(provider.DataMessage))
OnDataMessage registers a handler for incoming data messages.
func (*AgentParticipant) OnParticipantJoined ¶
func (a *AgentParticipant) OnParticipantJoined(handler func(participant.Participant))
OnParticipantJoined registers a handler for participant join events.
func (*AgentParticipant) OnParticipantLeft ¶
func (a *AgentParticipant) OnParticipantLeft(handler func(participant.Participant))
OnParticipantLeft registers a handler for participant leave events.
func (*AgentParticipant) OnTrackPublished ¶
func (a *AgentParticipant) OnTrackPublished(handler func(participant.Participant, track.Track))
OnTrackPublished registers a handler for track publish events.
func (*AgentParticipant) OnTrackUnpublished ¶
func (a *AgentParticipant) OnTrackUnpublished(handler func(participant.Participant, track.Track))
OnTrackUnpublished registers a handler for track unpublish events.
func (*AgentParticipant) PublishAudio ¶
func (a *AgentParticipant) PublishAudio(ctx context.Context, frame provider.AudioFrame) error
PublishAudio publishes an audio frame to the meeting.
func (*AgentParticipant) RemoteParticipants ¶
func (a *AgentParticipant) RemoteParticipants() []participant.Participant
RemoteParticipants returns all remote participants.
func (*AgentParticipant) SendDataMessage ¶
func (a *AgentParticipant) SendDataMessage(ctx context.Context, msg provider.DataMessage) error
SendDataMessage sends a data message.
func (*AgentParticipant) StartAudioTrack ¶
func (a *AgentParticipant) StartAudioTrack(ctx context.Context, opts provider.AudioTrackOptions) (provider.AudioWriter, error)
StartAudioTrack starts publishing audio and returns a writer.
func (*AgentParticipant) StopAudioTrack ¶
func (a *AgentParticipant) StopAudioTrack(ctx context.Context) error
StopAudioTrack stops publishing audio.
func (*AgentParticipant) SubscribeToAllAudio ¶
func (a *AgentParticipant) SubscribeToAllAudio(ctx context.Context) (<-chan provider.AudioFrame, error)
SubscribeToAllAudio subscribes to all participants' audio.
func (*AgentParticipant) SubscribeToAudio ¶
func (a *AgentParticipant) SubscribeToAudio(ctx context.Context, participantID string) (<-chan provider.AudioFrame, error)
SubscribeToAudio subscribes to a specific participant's audio.
func (*AgentParticipant) SubscribeToTrack ¶
func (a *AgentParticipant) SubscribeToTrack(ctx context.Context, trackID string, opts track.SubscribeOptions) error
SubscribeToTrack subscribes to a specific track.
func (*AgentParticipant) UnsubscribeFromTrack ¶
func (a *AgentParticipant) UnsubscribeFromTrack(ctx context.Context, trackID string) error
UnsubscribeFromTrack unsubscribes from a track.
type Config ¶
type Config struct {
// APIKey is the LiveKit API key.
APIKey string
// APISecret is the LiveKit API secret.
APISecret string
// ServerURL is the LiveKit server URL (e.g., "wss://your-server.livekit.cloud").
ServerURL string
// WebhookSecret is the secret for validating webhooks.
WebhookSecret string
}
Config configures the LiveKit provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the OmniMeet MeetingProvider interface for LiveKit.
func NewProvider ¶
NewProvider creates a new LiveKit provider.
func (*Provider) CreateAgentParticipant ¶
func (p *Provider) CreateAgentParticipant(opts provider.AgentParticipantOptions) (provider.AgentParticipant, error)
CreateAgentParticipant creates a new AgentParticipant.
func (*Provider) CreateJoinToken ¶
func (p *Provider) CreateJoinToken(ctx context.Context, req token.CreateRequest) (*token.JoinToken, error)
CreateJoinToken generates a token for a participant to join a meeting.
func (*Provider) CreateMeeting ¶
func (p *Provider) CreateMeeting(ctx context.Context, req meeting.CreateRequest) (*meeting.Meeting, error)
CreateMeeting creates a new meeting (LiveKit room).
func (*Provider) DeleteMeeting ¶
DeleteMeeting deletes a meeting (same as EndMeeting for LiveKit).
func (*Provider) EndMeeting ¶
EndMeeting ends a meeting.
func (*Provider) GetMeeting ¶
GetMeeting retrieves a meeting by ID (room name in LiveKit).
func (*Provider) GetParticipant ¶
func (p *Provider) GetParticipant(ctx context.Context, meetingID, participantID string) (*participant.Participant, error)
GetParticipant retrieves a specific participant.
func (*Provider) ListMeetings ¶
func (p *Provider) ListMeetings(ctx context.Context, opts meeting.ListOptions) ([]meeting.Meeting, error)
ListMeetings returns a list of active meetings.
func (*Provider) ListParticipants ¶
func (p *Provider) ListParticipants(ctx context.Context, meetingID string) ([]participant.Participant, error)
ListParticipants returns the current participants in a meeting.
func (*Provider) RemoveParticipant ¶
RemoveParticipant removes a participant from a meeting.
func (*Provider) SupportsAgentParticipation ¶
SupportsAgentParticipation returns true (LiveKit supports agent participation).
func (*Provider) UpdateParticipant ¶
func (p *Provider) UpdateParticipant(ctx context.Context, meetingID, participantID string, update provider.ParticipantUpdate) error
UpdateParticipant updates participant metadata or permissions.