examples(tavus): await update_subscriptions
This commit is contained in:
@@ -6,10 +6,11 @@
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from typing import Any
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from typing import Any, Mapping
|
||||||
|
|
||||||
from pipecat.frames.frames import LLMMessagesFrame
|
from pipecat.frames.frames import LLMMessagesFrame
|
||||||
from pipecat.pipeline.pipeline import Pipeline
|
from pipecat.pipeline.pipeline import Pipeline
|
||||||
from pipecat.pipeline.runner import PipelineRunner
|
from pipecat.pipeline.runner import PipelineRunner
|
||||||
@@ -103,12 +104,12 @@ async def main():
|
|||||||
|
|
||||||
@transport.event_handler("on_participant_joined")
|
@transport.event_handler("on_participant_joined")
|
||||||
async def on_participant_joined(
|
async def on_participant_joined(
|
||||||
transport: DailyTransport, participant: dict[str, Any]
|
transport: DailyTransport, participant: Mapping[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
# Ignore the Tavus replica's microphone
|
# Ignore the Tavus replica's microphone
|
||||||
if participant.get("info", {}).get("userName", "") == persona_name:
|
if participant.get("info", {}).get("userName", "") == persona_name:
|
||||||
logger.debug(f"Ignoring {participant['id']}'s microphone")
|
logger.debug(f"Ignoring {participant['id']}'s microphone")
|
||||||
transport.update_subscriptions(
|
await transport.update_subscriptions(
|
||||||
participant_settings={
|
participant_settings={
|
||||||
participant["id"]: {
|
participant["id"]: {
|
||||||
"media": {"microphone": "unsubscribed"},
|
"media": {"microphone": "unsubscribed"},
|
||||||
|
|||||||
Reference in New Issue
Block a user