Skip to main content

Anam avatar plugin for Vision Agents

Project description

Anam Avatar Plugin for Vision Agents

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

Features

  • Real-time avatar video and audio synchronized with TTS output
  • Audio passthrough mode for high-quality voice reproduction
  • Automatic interruption when the user starts speaking
  • Works with any TTS provider (ElevenLabs, Cartesia, etc.) or Realtime LLMs
  • Configurable video resolution (default 1920x1080)

Installation

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

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 deepgram, elevenlabs, getstream, gemini
from vision_agents.plugins.anam import AnamAvatarPublisher

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=elevenlabs.TTS(),
        stt=deepgram.STT(),

        processors=[AnamAvatarPublisher()],
    )

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

    async with agent.join(call):
        await agent.simple_response("Say hello.")
        await agent.finish()


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

Configuration

Environment Variables

ANAM_API_KEY=your_anam_api_key
ANAM_AVATAR_ID=your_anam_avatar_id

AvatarPublisher Options

AnamAvatarPublisher(
    avatar_id=None,  # Anam avatar ID (or set ANAM_AVATAR_ID env var)
    api_key=None,  # Anam API key (or set ANAM_API_KEY env var)
    client_options=None,  # Optional Anam ClientOptions for advanced configuration
    connect_timeout=None,  # Seconds to wait for connection (None = wait indefinitely)
    session_ready_timeout=None,  # Seconds to wait for session ready (None = wait indefinitely)
    width=1920,  # Output video width in pixels
    height=1080,  # Output video height in pixels
)

How It Works

  1. Anam Connection: Connects to Anam's avatar service and waits for the session to become ready
  2. Audio Forwarding: TTS audio from the agent is resampled to 24kHz mono and streamed to Anam
  3. Avatar Generation: Anam generates synchronized avatar video and lip-synced audio from the input
  4. Video Streaming: Avatar video and audio frames are streamed back to call participants via GetStream Edge

Requirements

  • Python 3.10+
  • Anam API key and avatar ID (get them at anam.ai)
  • GetStream account for video calls
  • TTS provider (ElevenLabs, Cartesia, 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_anam-0.5.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

vision_agents_plugins_anam-0.5.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file vision_agents_plugins_anam-0.5.0.tar.gz.

File metadata

  • Download URL: vision_agents_plugins_anam-0.5.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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_anam-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a8c328cbf92ba4f35b36e82b1188f5410aba248d7dab46dc9b0b60fe1a5542e7
MD5 b1ce1d25ba50e7ba3129dceb6954dfa3
BLAKE2b-256 2ebde56b92d0254609014df83e0fefbe413378c144586e2a4eeaf4bef99ed8b4

See more details on using hashes here.

File details

Details for the file vision_agents_plugins_anam-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: vision_agents_plugins_anam-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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_anam-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e098c8fbd34008ba609126ac5d5a44ba490a9eada8c2002601867c78ccaf74aa
MD5 92eca79d76f50f0237eae9f9f7a073f7
BLAKE2b-256 af547836566631b906387cbe12782f3110e766b054cc7d4c3d119cdf0e0caa22

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