session_args become runner_args
This commit is contained in:
@@ -101,11 +101,11 @@ async def run_bot(transport):
|
||||
|
||||
|
||||
async def bot(
|
||||
session_args: DailyRunnerArguments | SmallWebRTCRunnerArguments | WebSocketRunnerArguments,
|
||||
runner_args: DailyRunnerArguments | SmallWebRTCRunnerArguments | WebSocketRunnerArguments,
|
||||
):
|
||||
"""Main bot entry point compatible with Pipecat Cloud."""
|
||||
|
||||
if isinstance(session_args, DailyRunnerArguments):
|
||||
if isinstance(runner_args, DailyRunnerArguments):
|
||||
from pipecat.transports.services.daily import DailyParams, DailyTransport
|
||||
|
||||
if os.environ.get("ENV") != "local":
|
||||
@@ -116,8 +116,8 @@ async def bot(
|
||||
krisp_filter = None
|
||||
|
||||
transport = DailyTransport(
|
||||
session_args.room_url,
|
||||
session_args.token,
|
||||
runner_args.room_url,
|
||||
runner_args.token,
|
||||
"Pipecat Bot",
|
||||
params=DailyParams(
|
||||
audio_in_enabled=True,
|
||||
@@ -127,7 +127,7 @@ async def bot(
|
||||
),
|
||||
)
|
||||
|
||||
elif isinstance(session_args, SmallWebRTCRunnerArguments):
|
||||
elif isinstance(runner_args, SmallWebRTCRunnerArguments):
|
||||
from pipecat.transports.base_transport import TransportParams
|
||||
from pipecat.transports.network.small_webrtc import SmallWebRTCTransport
|
||||
|
||||
@@ -137,14 +137,14 @@ async def bot(
|
||||
audio_out_enabled=True,
|
||||
vad_analyzer=SileroVADAnalyzer(),
|
||||
),
|
||||
webrtc_connection=session_args.webrtc_connection,
|
||||
webrtc_connection=runner_args.webrtc_connection,
|
||||
)
|
||||
|
||||
elif isinstance(session_args, WebSocketRunnerArguments):
|
||||
elif isinstance(runner_args, WebSocketRunnerArguments):
|
||||
# Use the utility to parse WebSocket data
|
||||
from pipecat.runner.utils import parse_telephony_websocket
|
||||
|
||||
transport_type, call_data = await parse_telephony_websocket(session_args.websocket)
|
||||
transport_type, call_data = await parse_telephony_websocket(runner_args.websocket)
|
||||
logger.info(f"Auto-detected transport: {transport_type}")
|
||||
|
||||
# Create transport based on detected type
|
||||
@@ -190,7 +190,7 @@ async def bot(
|
||||
)
|
||||
|
||||
transport = FastAPIWebsocketTransport(
|
||||
websocket=session_args.websocket,
|
||||
websocket=runner_args.websocket,
|
||||
params=FastAPIWebsocketParams(
|
||||
audio_in_enabled=True,
|
||||
audio_out_enabled=True,
|
||||
|
||||
@@ -137,10 +137,10 @@ async def run_bot(transport):
|
||||
|
||||
|
||||
async def bot(
|
||||
session_args: DailyRunnerArguments | SmallWebRTCRunnerArguments | WebSocketRunnerArguments,
|
||||
runner_args: DailyRunnerArguments | SmallWebRTCRunnerArguments | WebSocketRunnerArguments,
|
||||
):
|
||||
"""Main bot entry point compatible with Pipecat Cloud."""
|
||||
transport = await create_transport(session_args, transport_params)
|
||||
transport = await create_transport(runner_args, transport_params)
|
||||
await run_bot(transport)
|
||||
|
||||
|
||||
|
||||
@@ -92,10 +92,10 @@ async def run_bot(transport):
|
||||
await runner.run(task)
|
||||
|
||||
|
||||
async def bot(session_args: DailyRunnerArguments | SmallWebRTCRunnerArguments):
|
||||
async def bot(runner_args: DailyRunnerArguments | SmallWebRTCRunnerArguments):
|
||||
"""Main bot entry point compatible with Pipecat Cloud."""
|
||||
|
||||
if isinstance(session_args, DailyRunnerArguments):
|
||||
if isinstance(runner_args, DailyRunnerArguments):
|
||||
from pipecat.transports.services.daily import DailyParams, DailyTransport
|
||||
|
||||
if os.environ.get("ENV") != "local":
|
||||
@@ -106,8 +106,8 @@ async def bot(session_args: DailyRunnerArguments | SmallWebRTCRunnerArguments):
|
||||
krisp_filter = None
|
||||
|
||||
transport = DailyTransport(
|
||||
session_args.room_url,
|
||||
session_args.token,
|
||||
runner_args.room_url,
|
||||
runner_args.token,
|
||||
"Pipecat Bot",
|
||||
params=DailyParams(
|
||||
audio_in_enabled=True,
|
||||
@@ -117,7 +117,7 @@ async def bot(session_args: DailyRunnerArguments | SmallWebRTCRunnerArguments):
|
||||
),
|
||||
)
|
||||
|
||||
elif isinstance(session_args, SmallWebRTCRunnerArguments):
|
||||
elif isinstance(runner_args, SmallWebRTCRunnerArguments):
|
||||
from pipecat.transports.base_transport import TransportParams
|
||||
from pipecat.transports.network.small_webrtc import SmallWebRTCTransport
|
||||
|
||||
@@ -127,7 +127,7 @@ async def bot(session_args: DailyRunnerArguments | SmallWebRTCRunnerArguments):
|
||||
audio_out_enabled=True,
|
||||
vad_analyzer=SileroVADAnalyzer(),
|
||||
),
|
||||
webrtc_connection=session_args.webrtc_connection,
|
||||
webrtc_connection=runner_args.webrtc_connection,
|
||||
)
|
||||
|
||||
await run_bot(transport)
|
||||
|
||||
@@ -91,7 +91,7 @@ async def run_bot(transport):
|
||||
await runner.run(task)
|
||||
|
||||
|
||||
async def bot(session_args: SmallWebRTCRunnerArguments):
|
||||
async def bot(runner_args: SmallWebRTCRunnerArguments):
|
||||
"""Main bot entry point compatible with Pipecat Cloud."""
|
||||
|
||||
transport = SmallWebRTCTransport(
|
||||
@@ -100,7 +100,7 @@ async def bot(session_args: SmallWebRTCRunnerArguments):
|
||||
audio_out_enabled=True,
|
||||
vad_analyzer=SileroVADAnalyzer(),
|
||||
),
|
||||
webrtc_connection=session_args.webrtc_connection,
|
||||
webrtc_connection=runner_args.webrtc_connection,
|
||||
)
|
||||
|
||||
await run_bot(transport)
|
||||
|
||||
Reference in New Issue
Block a user