Documentation Index
Fetch the complete documentation index at: https://lemonslice.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
LemonSlice integrates with Pipecat, an open-source framework for building multimodal conversational agents by Daily. TheLemonSliceTransport object connects your Pipecat app to a LemonSlice avatar for real-time voice conversations with synchronized video.
Jump to the example code section for ready-to-use samples.
Prerequisites
Before integrating LemonSlice with Pipecat, ensure you have the following:-
LemonSlice avatar configuration
Either a base image URL or a LemonSlice avatar ID.
- Agent base image — a publicly accessible image URL of your avatar, focused on the face. The image should be 368 × 560 pixels. LemonSlice will automatically center-crop your image to the target aspect ratio if the dimensions do not match the expected values. Best results are achieved with anthropomorphic images where the face and mouth are clearly identifiable.
-
LemonSlice Agent ID
Selected voices and personalities for a LemonSlice avatar preset are ignored when using the Pipecat plugin.
-
Pipecat Python Application
- Either your own existing application, or follow the Pipecat quickstart to create one.
How to use
Authenticate
- Create a LemonSlice API key
- In your Pipecat app, set
LEMONSLICE_API_KEYin your .env file
Create the LemonSlice transport layer
Create an instance of Parameters for
Parameters for
Parameters for
LemonSliceTransport by providing your bot name, LemonSlice API key, session request, and additional parameters.PYTHON
LemonSliceTransport:| Parameter | Description |
|---|---|
bot_name | The name of the Pipecat bot instance. |
api_key | LemonSlice API key for authentication. |
session | An aiohttp.ClientSession for making async HTTP requests. |
session_request | Session creation parameters. See LemonSliceNewSessionRequest below. |
params | (Optional) Transport configuration. |
LemonSliceNewSessionRequest.| Parameter | Description |
|---|---|
agent_image_url | A URL to an avatar image to use. Provide either agent_id or agent_image_url, not both. |
agent_id | The ID of a LemonSlice avatar preset. Provide either agent_id or agent_image_url, not both. |
agent_prompt | (Optional) A high-level system prompt that subtly influences the avatar’s movements, expressions, and emotional demeanor during the talking state. |
agent_idle_prompt | (Optional) A high-level system prompt that influences the avatar’s movements, expressions, and emotional demeanor during the idle state. |
idle_timeout | (Optional) Idle timeout in seconds. Defaults to 60. If a negative number is provided, the session will have no idle timeout. |
response_done_timeout | (Optional) Time in seconds to wait without receiving new audio bytes before marking the response as complete. Some TTS models do not send an end response event, or do not send it in a timely manner, after transmitting all audio bytes. This parameter enables detection of response completion when such events are missing or delayed. |
daily_room_url | (Optional) Daily room URL to use. If not provided, LemonSlice will create a new room at an additional cost of 0.51 credits per participant minute. |
daily_token | (Optional) Daily token for authenticating with the room. |
lemonslice_properties | (Optional) A dictionary of extra connection properties. See lemonslice_properties below. |
lemonslice_properties.| Parameter | Description |
|---|---|
enable_recording | Enable Daily call recording. Must be one of cloud, cloud-audio-only, local, or raw-tracks. If set, recordings_bucket must also be provided. Enabling recording incurs an additional charge of 0.378 credits per minute. |
recordings_bucket | The S3 bucket configuration where recordings will be saved. Follows the Daily recording bucket specification. |
Insert the LemonSlice transport layer into the pipeline
Add the LemonSlice transport layer to your processing pipeline.
PYTHON
The LemonSlice avatar participant is automatically filtered out from
transport.on_client_connected and transport.on_client_disconnected events. Only human participant connections trigger these event handlers.Implementation Details
- 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.
- The Daily video UI should filter out the Pipecat bot participant from being displayed. This participant only exists to facilitate passing audio between the user, Pipecat, and LemonSlice.
Example Code
| Repo | What’s included |
|---|---|
video-avatar-lemonslice-transport.py | Run a Pipecat pipeline locally and join with Daily Prebuilt to quickly test your agent with a LemonSlice avatar. |
05-pipecat-app | Fullstack web app using the LemonSliceTransport within Pipecat. Includes LemonSlice-augmented Pipecat pipeline, front-end UI, and backend token server. |
