Skip to main content

LemonSlice avatar plugin for Vision Agents

Project description

LemonSlice Avatar Plugin for Vision Agents

Add real-time interactive avatar video to your AI agents using LemonSlice's self-managed API.

Features

  • Real-time avatar video synchronized with TTS audio
  • Works with any TTS provider (Cartesia, ElevenLabs, etc.)
  • Supports both standard and Realtime LLMs
  • Customizable avatar expressions via agent prompts

Installation

uv add "vision-agents[lemonslice]"
# or directly
uv add vision-agents-plugins-lemonslice

Quick Start

import asyncio
from uuid import uuid4
from dotenv import load_dotenv

from vision_agents.core import User, Agent
from vision_agents.plugins import cartesia, deepgram, getstream, gemini, lemonslice

load_dotenv()


async def start_avatar_agent():
    agent = Agent(
        edge=getstream.Edge(),
        agent_user=User(name="AI Assistant with Avatar", id="agent"),
        instructions="You're a friendly AI assistant.",

        llm=gemini.LLM(),
        tts=cartesia.TTS(),
        stt=deepgram.STT(),

        avatar=lemonslice.Avatar(agent_id="your-avatar-id"),
    )

    call = await agent.create_call("default", str(uuid4()))

    async with agent.join(call):
        await agent.simple_response("Hello! I'm your AI assistant with an avatar.")
        await agent.finish()


if __name__ == "__main__":
    asyncio.run(start_avatar_agent())

Configuration

Environment Variables

LEMONSLICE_API_KEY=your_lemonslice_api_key
LEMONSLICE_AGENT_ID=your_agent_id
# Or, instead of LEMONSLICE_AGENT_ID:
# LEMONSLICE_AGENT_IMAGE_URL=https://example.com/avatar.png

# LemonSlice uses LiveKit as a transport for audio and video
LIVEKIT_URL=wss://your-livekit-server.com
LIVEKIT_API_KEY=your_livekit_api_key
LIVEKIT_API_SECRET=your_livekit_api_secret

Avatar Options

lemonslice.Avatar(
    agent_id="your-avatar-id",  # LemonSlice agent ID (or set LEMONSLICE_AGENT_ID env var)
    agent_image_url=None,  # Custom image URL, 368x560px (or set LEMONSLICE_AGENT_IMAGE_URL env var)
    agent_prompt=None,  # Prompt to influence avatar expressions/movements
    api_key=None,  # Optional: override LEMONSLICE_API_KEY env var
    idle_timeout=None,  # Session timeout in seconds
    livekit_url=None,  # Optional: override LIVEKIT_URL env var
    livekit_api_key=None,  # Optional: override LIVEKIT_API_KEY env var
    livekit_api_secret=None,  # Optional: override LIVEKIT_API_SECRET env var
    width=1920,  # Output video width in pixels
    height=1080,  # Output video height in pixels
)

How It Works

  1. LemonSlice Session: Creates a session via LemonSlice API, and joins the LiveKit room as a participant
  2. Audio Forwarding: TTS audio is captured and sent to LemonSlice via the room
  3. Avatar Generation: LemonSlice generates synchronized avatar video and audio
  4. Video Streaming: Avatar video is streamed to call participants via GetStream Edge

Requirements

  • Python 3.10+
  • LemonSlice API key (get one at lemonslice.com)
  • LiveKit server (cloud or self-hosted)
  • GetStream account for video calls
  • TTS provider (Cartesia, ElevenLabs, etc.) or Realtime LLM

License

MIT

Links

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

vision_agents_plugins_lemonslice-0.6.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file vision_agents_plugins_lemonslice-0.6.1.tar.gz.

File metadata

  • Download URL: vision_agents_plugins_lemonslice-0.6.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vision_agents_plugins_lemonslice-0.6.1.tar.gz
Algorithm Hash digest
SHA256 452dd84fa81c1afa74bdf78c1d211a81e60d7abed0a78262b8fdc5d1f82c5f07
MD5 3c49b793eee600b2dbd13edad6d1cfad
BLAKE2b-256 c255a1c932fb2a79c8617e2c252a95d81320136b6a53270f4982f75aecb1a9da

See more details on using hashes here.

File details

Details for the file vision_agents_plugins_lemonslice-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: vision_agents_plugins_lemonslice-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vision_agents_plugins_lemonslice-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05f983ba52b25fb91020235b42d1c6db8d789ad1c3c92517daf48170dffc1baf
MD5 8a7b555372778c7077cb4c8fd8164d69
BLAKE2b-256 b3ed6d3270389d6133c235691973e87e323ebb30a8e8196a04a908bf52f19730

See more details on using hashes here.

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