From 87a79df0484b3b783fe42f0d09959259397c6c15 Mon Sep 17 00:00:00 2001 From: filipi87 Date: Tue, 10 Feb 2026 14:02:20 -0300 Subject: [PATCH] Updating the heygen examples to use sandbox by default. --- examples/foundational/43-heygen-transport.py | 7 +++++++ examples/foundational/43a-heygen-video-service.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/examples/foundational/43-heygen-transport.py b/examples/foundational/43-heygen-transport.py index 5cc56644b..dd31baa02 100644 --- a/examples/foundational/43-heygen-transport.py +++ b/examples/foundational/43-heygen-transport.py @@ -25,6 +25,7 @@ from pipecat.processors.aggregators.llm_response_universal import ( from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.google.llm import GoogleLLMService +from pipecat.services.heygen.api_liveavatar import LiveAvatarNewSessionRequest from pipecat.transports.heygen.transport import HeyGenParams, HeyGenTransport, ServiceType load_dotenv(override=True) @@ -43,6 +44,12 @@ async def main(): audio_in_enabled=True, audio_out_enabled=True, ), + session_request=LiveAvatarNewSessionRequest( + is_sandbox=True, + # Sandbox mode only works with this specific avatar + # https://docs.liveavatar.com/docs/developing-in-sandbox-mode#sandbox-mode-behaviors + avatar_id="dd73ea75-1218-4ef3-92ce-606d5f7fbc0a", + ), ) stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) diff --git a/examples/foundational/43a-heygen-video-service.py b/examples/foundational/43a-heygen-video-service.py index bae88e2b5..ba3d4417d 100644 --- a/examples/foundational/43a-heygen-video-service.py +++ b/examples/foundational/43a-heygen-video-service.py @@ -25,6 +25,7 @@ from pipecat.runner.utils import create_transport from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.google.llm import GoogleLLMService +from pipecat.services.heygen.api_liveavatar import LiveAvatarNewSessionRequest from pipecat.services.heygen.client import ServiceType from pipecat.services.heygen.video import HeyGenVideoService from pipecat.transports.base_transport import BaseTransport, TransportParams @@ -71,6 +72,12 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): api_key=os.getenv("HEYGEN_LIVE_AVATAR_API_KEY"), service_type=ServiceType.LIVE_AVATAR, session=session, + session_request=LiveAvatarNewSessionRequest( + is_sandbox=True, + # Sandbox mode only works with this specific avatar + # https://docs.liveavatar.com/docs/developing-in-sandbox-mode#sandbox-mode-behaviors + avatar_id="dd73ea75-1218-4ef3-92ce-606d5f7fbc0a", + ), ) messages = [