pipecat icon indicating copy to clipboard operation
pipecat copied to clipboard

Twilio example docs doesn't say anything about adding twilio params

Open surapuramakhil opened this issue 1 month ago • 5 comments

pipecat version

0.0.95

Python version

3.13.4

Operating System

mac

Issue description

twilio guide docs - https://docs.pipecat.ai/guides/telephony/twilio-websockets

by following docs:

  File "/Users/akhil-capex/work/poc/pipecat/examples/quickstart/bot.py", line 148, in bot
    transport = await create_transport(runner_args, transport_params)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/akhil-capex/work/poc/pipecat/examples/quickstart/.venv/lib/python3.12/site-packages/pipecat/runner/utils.py", line 565, in create_transport
    params = _get_transport_params(transport_type, transport_params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/akhil-capex/work/poc/pipecat/examples/quickstart/.venv/lib/python3.12/site-packages/pipecat/runner/utils.py", line 393, in _get_transport_params
    raise ValueError(
ValueError: Missing transport params for 'twilio'. Please add 'twilio' key to your transport_params dict.

Reproduction steps

twilio guide docs - https://docs.pipecat.ai/guides/telephony/twilio-websockets

by following docs:

  File "/Users/akhil-capex/work/poc/pipecat/examples/quickstart/bot.py", line 148, in bot
    transport = await create_transport(runner_args, transport_params)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/akhil-capex/work/poc/pipecat/examples/quickstart/.venv/lib/python3.12/site-packages/pipecat/runner/utils.py", line 565, in create_transport
    params = _get_transport_params(transport_type, transport_params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/akhil-capex/work/poc/pipecat/examples/quickstart/.venv/lib/python3.12/site-packages/pipecat/runner/utils.py", line 393, in _get_transport_params
    raise ValueError(
ValueError: Missing transport params for 'twilio'. Please add 'twilio' key to your transport_params dict.

we need to add this to transport_params json

"twilio": lambda: FastAPIWebsocketParams(
            audio_in_enabled=True,
            audio_out_enabled=True,
            vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=0.2)),
            turn_analyzer=LocalSmartTurnAnalyzerV3(),
        ),

Expected behavior

following docs - example should work

Actual behavior

by following docs:

  File "/Users/akhil-capex/work/poc/pipecat/examples/quickstart/bot.py", line 148, in bot
    transport = await create_transport(runner_args, transport_params)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/akhil-capex/work/poc/pipecat/examples/quickstart/.venv/lib/python3.12/site-packages/pipecat/runner/utils.py", line 565, in create_transport
    params = _get_transport_params(transport_type, transport_params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/akhil-capex/work/poc/pipecat/examples/quickstart/.venv/lib/python3.12/site-packages/pipecat/runner/utils.py", line 393, in _get_transport_params
    raise ValueError(
ValueError: Missing transport params for 'twilio'. Please add 'twilio' key to your transport_params dict.

Logs


surapuramakhil avatar Nov 20 '25 02:11 surapuramakhil

I'm not sure I'm following. There are two ways to construct the transport:

  1. Explicitly specify the transport; for Twilio, that's a FastAPIWebsocketTransport, passing the args, which includes a TwilioFrameSerializer. You can see that here: https://github.com/pipecat-ai/pipecat-examples/blob/main/twilio-chatbot/inbound/bot.py#L172-L202
  2. Use the create_transport() convenience method, which allows you to pass only the TransportParams, which you can see in all of the foundational examples: https://github.com/pipecat-ai/pipecat/blob/main/examples/foundational/07-interruptible.py#L43-L48

Can you more clearly state what you're confused about. It seems like something in the docs isn't clear.

markbackman avatar Nov 20 '25 14:11 markbackman

even this was missing in the docs @markbackman

which repo to look at. what I tried was from quickstart bot.py

https://github.com/pipecat-ai/pipecat/tree/main/examples/quickstart

@markbackman this request if for updating docs https://docs.pipecat.ai/guides/telephony/twilio-websockets

surapuramakhil avatar Nov 20 '25 23:11 surapuramakhil

What specifically is missing from the docs?

Every section won't detail all the ways to do things. There's a transport specific section that explains how transports work: https://docs.pipecat.ai/guides/learn/transports

markbackman avatar Nov 21 '25 01:11 markbackman

What specifically is missing from the docs?

@markbackman this what I think,

in https://docs.pipecat.ai/guides/telephony/twilio-websockets#running-the-example

repo link or bot.py file link should be provided.

surapuramakhil avatar Nov 22 '25 15:11 surapuramakhil

It is though. The guide links to the full examples.

Dialin:

Image

Dialout:

Image

Make sense?

markbackman avatar Nov 22 '25 16:11 markbackman