Skip to main content

Agent Framework plugin for Spatius avatars

Project description

LiveKit Agents Plugin for Spatius Avatar

LiveKit Agents plugin for Spatius avatar sessions. It forwards TTS audio from a LiveKit agent session to Spatius and lets the avatar publish synchronized audio/video back into the same room.

Installation

pip install livekit-plugins-spatius

Quick Start

Set credentials:

export SPATIUS_API_KEY=your-api-key
export SPATIUS_APP_ID=your-app-id
export SPATIUS_AVATAR_ID=your-avatar-id

export LIVEKIT_URL=wss://your-livekit-host
export LIVEKIT_API_KEY=your-livekit-api-key
export LIVEKIT_API_SECRET=your-livekit-api-secret

Use plugin in your LiveKit agent:

from livekit.agents import Agent, AgentSession, JobContext, WorkerOptions, cli
from livekit.plugins import spatius


class VoiceAssistant(Agent):
    def __init__(self) -> None:
        super().__init__(instructions="You are a helpful voice assistant.")


async def entrypoint(ctx: JobContext) -> None:
    await ctx.connect()

    session = AgentSession(
        vad=vad,
        stt=stt,
        llm=llm,
        tts=tts,
    )

    avatar = spatius.AvatarSession()
    await avatar.start(session, room=ctx.room)

    await session.start(agent=VoiceAssistant(), room=ctx.room)


if __name__ == "__main__":
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))

Advanced LiveKit egress room

By default, Spatius publishes the avatar into the same LiveKit room as the agent. For specialized routing setups, pass livekit_room_name to publish the avatar into a different room:

await avatar.start(
    session,
    room=ctx.room,
    livekit_room_name="avatar-output-room",
)

For detailed usage, see Spatius docs.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livekit_plugins_spatius-1.6.4.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

livekit_plugins_spatius-1.6.4-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_spatius-1.6.4.tar.gz.

File metadata

  • Download URL: livekit_plugins_spatius-1.6.4.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for livekit_plugins_spatius-1.6.4.tar.gz
Algorithm Hash digest
SHA256 76a406f6cc9c4cd83574df8ab39373fcf51d33ac5e63c32ebba84b1e26e4278a
MD5 40b6e4ad25d807529e31c764fded4e92
BLAKE2b-256 6dc4838452bfbbdd2fe4f539c6c7b2c73994eb025c7d8f68da3a6a7f4cf1662b

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_spatius-1.6.4.tar.gz:

Publisher: publish.yml on spatius-ai/livekit-plugins-spatius

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file livekit_plugins_spatius-1.6.4-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_spatius-1.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b563c5056f0428f45b64d92160bc53391c5b76ce7c43e6d008fee8eb0415fd1b
MD5 da7cad4c2ead56521cccb05c8dff3e4e
BLAKE2b-256 4fe9d59ced3a8280fbf9fbc6c68f8ae757766da8d55b35fc972469c5b3fded66

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_spatius-1.6.4-py3-none-any.whl:

Publisher: publish.yml on spatius-ai/livekit-plugins-spatius

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page