omniavatar

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package omniavatar provides an OmniAvatar render provider backed by the bitHuman API.

It implements render.Provider (Generate/Status/Download) for audio-driven talking-head generation using bitHuman agents, and render.AudioUploader via the bitHuman file API.

The adapter is constructor-based and depends only on omniavatar-core. The batteries omniavatar package registers it; import that to use it by name:

renderer, err := omniavatar.GetRenderProvider("bithuman",
    omniavatar.WithAPIKey(os.Getenv("BITHUMAN_API_KEY")),
    omniavatar.WithExtension("agent_id", agentID))

The real-time (live) bitHuman provider lives in the batteries omniavatar package (github.com/plexusone/omniavatar/providers/bithuman), because its LiveKit integration depends on that package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRenderProviderFromConfig

func NewRenderProviderFromConfig(cfg registry.ProviderConfig) (render.Provider, error)

NewRenderProviderFromConfig creates a bitHuman render provider from registry config. It is the registry-friendly constructor the batteries omniavatar package registers as a render.Provider factory.

Types

type RenderConfig

type RenderConfig struct {
	// APIKey is the bitHuman API key.
	// Required.
	APIKey string

	// BaseURL is the bitHuman API base URL.
	// Default: https://api.bithuman.ai
	BaseURL string

	// AgentID is the default bitHuman agent used when
	// GenerateRequest.AvatarID is empty.
	AgentID string

	// HTTPClient is an optional custom HTTP client, used for both API
	// calls and video downloads.
	HTTPClient *http.Client
}

RenderConfig configures the bitHuman render (batch video generation) provider.

type RenderProvider

type RenderProvider struct {
	// contains filtered or unexported fields
}

RenderProvider implements render.Provider for bitHuman video generation. It also implements render.AudioUploader via the bitHuman file API.

func NewRenderProvider

func NewRenderProvider(cfg RenderConfig) (*RenderProvider, error)

NewRenderProvider creates a bitHuman render provider.

func (*RenderProvider) Download

func (p *RenderProvider) Download(ctx context.Context, jobID string, dst io.Writer) error

Download streams the completed video to dst.

func (*RenderProvider) Generate

func (p *RenderProvider) Generate(ctx context.Context, req render.GenerateRequest) (*render.Job, error)

Generate submits a video generation job to bitHuman.

GenerateRequest.AvatarID maps to the bitHuman agent ID. Width, Height, and Background are not supported by the bitHuman API and are ignored. The "voice_id" extension selects a TTS voice for Script input.

func (*RenderProvider) Name

func (p *RenderProvider) Name() string

Name returns the provider name.

func (*RenderProvider) Status

func (p *RenderProvider) Status(ctx context.Context, jobID string) (*render.JobStatus, error)

Status returns the current status of a generation job.

func (*RenderProvider) UploadAudio

func (p *RenderProvider) UploadAudio(ctx context.Context, filename string, r io.Reader) (string, error)

UploadAudio uploads audio content via the bitHuman file API and returns a hosted URL usable as GenerateRequest.AudioURL.

Jump to

Keyboard shortcuts

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