Repository navigation
Expand file tree
/
Copy pathdoc.go
More file actions
69 lines (69 loc) · 2.31 KB
/
Copy pathdoc.go
File metadata and controls
69 lines (69 loc) · 2.31 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
64
65
66
67
68
69
// Package omniavatar provides a unified, provider-agnostic interface for AI avatars.
//
// This is the batteries-included package that imports all providers.
// For a minimal dependency footprint, use github.com/plexusone/omniavatar-core instead.
//
// Two surfaces are supported:
//
// - live: real-time streaming avatar sessions (LiveKit rooms, PCM audio
// streaming for lip-sync) for conversational agents
// - render: asynchronous batch avatar video generation (narration audio
// in, talking-head MP4 out) for offline pipelines such as
// presentation videos
//
// # Quick Start (live)
//
// import (
// "github.com/plexusone/omniavatar"
// _ "github.com/plexusone/omniavatar/providers/all"
// )
//
// func main() {
// provider, err := omniavatar.GetLiveProvider("heygen",
// omniavatar.WithAPIKey(os.Getenv("LIVEAVATAR_API_KEY")),
// omniavatar.WithExtension("avatar_id", avatarID),
// omniavatar.WithExtension("sandbox", true))
// if err != nil {
// log.Fatal(err)
// }
//
// session, err := provider.CreateSession(live.SessionConfig{
// AudioConfig: live.DefaultAudioConfig(),
// })
// if err != nil {
// log.Fatal(err)
// }
//
// // Use session with LiveKit or other platform adapters
// }
//
// # Quick Start (render)
//
// provider, err := omniavatar.GetRenderProvider("heygen",
// omniavatar.WithAPIKey(os.Getenv("HEYGEN_API_KEY")))
// if err != nil {
// log.Fatal(err)
// }
//
// job, err := provider.Generate(ctx, render.GenerateRequest{
// AvatarID: avatarID,
// AudioURL: narrationURL,
// })
// status, err := render.Wait(ctx, provider, job.ID, 5*time.Second)
// err = provider.Download(ctx, job.ID, outFile)
//
// # Available Providers
//
// - heygen: HeyGen LiveAvatar (live) and HeyGen Video Generation (render)
// - tavus: Tavus Conversational Video (live) and Video Generation (render)
// - bithuman: bitHuman Real-time Avatars (live) and Video Generation
// (render, with audio upload support)
//
// # Architecture
//
// omniavatar follows the same pattern as omnivoice:
//
// - omniavatar-core: Core interfaces (live, render) with no provider dependencies
// - omniavatar: Provider implementations with auto-registration
// - omniavatar/providers/all: Convenience import for all providers
package omniavatar