Overview
LemonSliceTransport enables your Pipecat bot to join the same virtual room as a LemonSlice avatar and human participants. The transport integrates with the LemonSlice platform to add interactive AI-powered video avatars to Daily rooms. The service handles bidirectional audio streaming, avatar animations, voice activity detection, and conversation interruptions to deliver engaging conversational AI experiences with lifelike visual presence.
When used, the Pipecat bot connects to a Daily room alongside the LemonSlice avatar and user. The bot receives audio input from participants, processes it through your pipeline, and sends TTS audio to the LemonSlice avatar for synchronized video rendering.
LemonSliceTransport API Reference
Pipecat’s API methods for LemonSlice video integration
Example Implementation
Complete example with interactive avatar
LemonSlice Platform
Access interactive avatars and API keys
Installation
To use LemonSlice services, install the required dependency:Prerequisites
LemonSlice Account Setup
Before using LemonSlice video services, you need:- LemonSlice Account: Sign up at LemonSlice Platform
- API Key: Generate an API key from your account dashboard
- Avatar Selection: Choose from available interactive avatars or provide your own agent image
Required Environment Variables
LEMONSLICE_API_KEY: Your LemonSlice API key for authentication
Configuration
LemonSliceTransport
The name of the Pipecat bot instance.
An aiohttp session for making async HTTP requests to the LemonSlice API.
LemonSlice API key for authentication.
Optional session creation parameters. If not provided, a default agent will be
used. See LemonSliceNewSessionRequest below.
Transport configuration parameters. See LemonSliceParams
below.
Optional name for the input transport processor.
Optional name for the output transport processor.
LemonSliceNewSessionRequest
Configuration for creating a new LemonSlice session.URL to an agent image. Provide either
agent_id or agent_image_url, not
both.ID of a LemonSlice agent. Provide either
agent_id or agent_image_url, not
both. If neither is provided, a default agent will be used.A high-level system prompt that subtly influences the avatar’s movements,
expressions, and emotional demeanor.
Idle timeout in seconds for the session.
Daily room URL to use for the session. If not provided, LemonSlice will create
a new room.
Daily token for authenticating with the room.
Additional properties to pass to the LemonSlice session.
LemonSliceParams
Inherits fromDailyParams (which inherits from TransportParams) with the
following defaults:
Whether to enable audio input from participants.
Whether to enable audio output to participants.
Whether to enable microphone output track.
Usage
LemonSliceTransport creates a three-way conversation between your Pipecat bot, a LemonSlice avatar, and human participants. The transport manages the LemonSlice API session and Daily room connectivity automatically. See the complete example for a full implementation including:- LemonSlice transport configuration with API key and session setup
- Avatar selection and configuration
- Pipeline integration with TTS
- Event handling for participant management
Event Handlers
LemonSliceTransport provides event handlers for participant connection lifecycle. Register handlers using the@event_handler decorator on the
transport instance.
Events Summary
| Event | Description |
|---|---|
on_client_connected | Participant (non-avatar) connected to the session |
on_client_disconnected | Participant (non-avatar) disconnected from the session |
The LemonSlice avatar participant is automatically filtered out from these
events. Only human participant connections trigger the event handlers.
Connection Lifecycle
on_client_connected
Fired when a human participant connects to the session. The LemonSlice avatar is filtered out from this event.| Parameter | Type | Description |
|---|---|---|
transport | LemonSliceTransport | The transport instance |
participant | Mapping[str, Any] | The participant data |
on_client_disconnected
Fired when a human participant disconnects from the session.| Parameter | Type | Description |
|---|---|---|
transport | LemonSliceTransport | The transport instance |
participant | Mapping[str, Any] | The participant data |
Notes
- LemonSlice uses Daily as the underlying transport layer, so all Daily features
and configuration options are available through the inherited
DailyParams. - The transport automatically manages interruptions and sends appropriate control
messages (
interrupt,response_started,response_finished) to the LemonSlice session. - The LemonSlice avatar’s microphone is automatically muted to prevent audio feedback loops.
Additional Resources
- Events Overview - Overview of all events in Pipecat
- DailyTransport - Underlying Daily transport documentation
- TransportParams - Base transport parameters