fix: initialize engine earlier than event handler

This commit is contained in:
Abhishek Kumar 2026-01-11 13:59:09 +05:30
parent edf0fa4fbc
commit b79bc4221d
2 changed files with 3 additions and 1 deletions

View file

@ -51,7 +51,6 @@ def register_transport_event_handlers(
async def on_client_connected(transport, participant):
logger.debug("In on_client_connected callback handler - initializing workflow")
await audio_buffer.start_recording()
await engine.initialize()
@transport.event_handler("on_client_disconnected")
async def on_client_disconnected(transport, participant):

View file

@ -567,6 +567,9 @@ async def _run_pipeline(
# Now set the task on the engine
engine.set_task(task)
# Initialize the engine to set the initial context
await engine.initialize()
# Register event handlers
in_memory_audio_buffer, in_memory_transcript_buffer = (