Updating the heygen examples to use sandbox by default.

This commit is contained in:
filipi87
2026-02-10 14:02:20 -03:00
parent 24f90715e3
commit 87a79df048
2 changed files with 14 additions and 0 deletions

View File

@@ -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"))

View File

@@ -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 = [