-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_options.go
More file actions
63 lines (53 loc) · 1.62 KB
/
Copy pathstart_options.go
File metadata and controls
63 lines (53 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package omniavatar
import (
lksdk "github.com/livekit/server-sdk-go/v2"
"github.com/plexusone/omniavatar-core/live"
)
// LiveKitStartOptions contains LiveKit-specific start options for avatar sessions.
//
// This is passed to Session.Start() when integrating with LiveKit.
type LiveKitStartOptions struct {
// Room is the LiveKit room the agent has joined.
// Required.
Room *lksdk.Room
// AgentIdentity is the identity of the agent participant.
// The avatar will publish tracks on behalf of this identity
// using the lk.publish_on_behalf attribute.
// Required.
AgentIdentity string
// LiveKitURL is the LiveKit server URL for the avatar to connect to.
// This should match the URL the agent connected to.
// Required.
LiveKitURL string
// LiveKitAPIKey is used to generate tokens for the avatar.
// Required.
LiveKitAPIKey string
// LiveKitAPISecret is used to generate tokens for the avatar.
// Required.
LiveKitAPISecret string
// Callbacks configures optional event callbacks.
Callbacks *live.SessionCallbacks
// AudioDestination is the audio output for streaming TTS audio.
// If provided, the session will use this instead of creating its own.
// Optional.
AudioDestination live.AudioDestination
}
// Validate checks that all required fields are set.
func (o *LiveKitStartOptions) Validate() error {
if o.Room == nil {
return live.ErrInvalidConfig
}
if o.AgentIdentity == "" {
return live.ErrInvalidConfig
}
if o.LiveKitURL == "" {
return live.ErrInvalidConfig
}
if o.LiveKitAPIKey == "" {
return live.ErrInvalidConfig
}
if o.LiveKitAPISecret == "" {
return live.ErrInvalidConfig
}
return nil
}