Skip to content

feat(examples): add 540-livekit-voice-agent-python#231

Closed
github-actions[bot] wants to merge 1 commit intomainfrom
example/540-livekit-voice-agent-python
Closed

feat(examples): add 540-livekit-voice-agent-python#231
github-actions[bot] wants to merge 1 commit intomainfrom
example/540-livekit-voice-agent-python

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Closes #225

Auto-generated from issue suggestion by the engineering pipeline.

Action: New
Runtime: python
Example: 540-livekit-voice-agent-python


Build log

Build log: example 540-livekit-voice-agent-python

⚙️ Container started
ℹ️ Bootstrapping container tools...
ℹ️ Starting agent loop for example 540-livekit-voice-agent-python (max turns: 75)
ℹ️ Turn 1/75 — turn=1 phases=[] tests=not yet run history_len=0

run_command: echo "DEEPGRAM_API_KEY is set: ${DEEPGRAM_API_KEY:+yes}" && echo "LIVEKIT_API_KEY is set: ${LIVEKIT_API_KEY:+yes}" && echo "LIVEKIT_API_SECRET is set: ${LIVEKIT_API_SECRET:+yes}" && echo "LIVEKIT_URL is set: ${LIVEKIT_URL:+yes}"

exit: 0

DEEPGRAM_API_KEY is set: yes
LIVEKIT_API_KEY is set: yes
LIVEKIT_API_SECRET is set: 
LIVEKIT_URL is set: yes

ℹ️ Turn 2/75 — turn=2 phases=['api_verified'] tests=not yet run history_len=1

run_command: deepgram --help 2>/dev/null || echo "deepgram CLI not available"

exit: 0

deepgram CLI not available

ℹ️ Turn 3/75 — turn=3 phases=['api_verified'] tests=not yet run history_len=2

run_command: context7 search "livekit agents python deepgram voice"

exit: 127
stderr:

bash: line 1: context7: command not found

ℹ️ Turn 4/75 — turn=4 phases=['api_verified'] tests=not yet run history_len=3
ℹ️ Turn 5/75 — turn=5 phases=['api_verified'] tests=not yet run history_len=3

run_command: pip install livekit-agents --dry-run 2>&1 | head -20

exit: 0

Collecting livekit-agents
  Downloading livekit_agents-1.5.2-py3-none-any.whl.metadata (8.5 kB)
Collecting aiofiles>=24 (from livekit-agents)
  Downloading aiofiles-25.1.0-py3-none-any.whl.metadata (6.3 kB)
Collecting aiohttp~=3.10 (from livekit-agents)
  Downloading aiohttp-3.13.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (8.1 kB)
Collecting av>=14.0.0 (from livekit-agents)
  Downloading av-17.0.0-cp311-abi3-manylinux_2_28_x86_64.whl.metadata (4.6 kB)
Collecting certifi>=2025.6.15 (from livekit-agents)
  Downloading certifi-2026.2.25-py3-none-any.whl.metadata (2.5 kB)
Collecting click~=8.1 (from livekit-agents)
  Downloading click-8.3.2-py3-none-any.whl.metadata (2.6 kB)
Collecting colorama>=0.4.6 (from livekit-agents)
  Downloading colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting docstring-parser>=0.16 (from livekit-agents)
  Downloading docstring_parser-0.18.0-py3-none-any.whl.metadata (3.5 kB)
Collecting eval-type-backport (from livekit-agents)
  Downloading eval_type_backport-0.3.1-py3-none-any.whl.metadata (2.4 kB)
Collecting livekit-api<2,>=1.0.7 (from livekit-agents)
  Downloading livekit_api-1.1.0-py3-none-any.whl.metadata (1.5 kB)

ℹ️ Turn 6/75 — turn=6 phases=['api_verified'] tests=not yet run history_len=4

run_command: pip search livekit-plugins-deepgram 2>&1 || pip index versions livekit-plugins-deepgram 2>&1 || pip install livekit-plugins-deepgram==9999 2>&1 | head -20

exit: 0

ERROR: XMLRPC request failed [code: -32500]
RuntimeError: PyPI no longer supports 'pip search' (or XML-RPC search). Please use https://pypi.org/search (via a browser) instead. See https://warehouse.pypa.io/api-reference/xml-rpc.html#deprecated-methods for more information.
WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
livekit-plugins-deepgram (1.5.2)
Available versions: 1.5.2, 1.5.1, 1.5.0, 1.4.6, 1.4.5, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.3.12, 1.3.11, 1.3.10, 1.3.9, 1.3.8, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.2.18, 1.2.17, 1.2.16, 1.2.15, 1.2.14, 1.2.13, 1.2.12, 1.2.11, 1.2.9, 1.2.8, 1.2.7, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.7, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.23, 1.0.22, 1.0.21, 1.0.20, 1.0.19, 1.0.18, 1.0.17, 1.0.16, 1.0.15, 1.0.14, 1.0.13, 1.0.12, 1.0.11, 1.0.10, 1.0.2, 1.0.1, 1.0.0, 0.7.4, 0.7.3, 0.7.2, 0.7.1, 0.7.0, 0.6.20, 0.6.19, 0.6.18, 0.6.17, 0.6.16, 0.6.15, 0.6.14, 0.6.13, 0.6.11, 0.6.10, 0.6.9, 0.6.8, 0.6.7, 0.6.6, 0.6.5, 0.6.4, 0.6.3, 0.6.2, 0.6.1, 0.6.0, 0.5.1, 0.5.0, 0.4.0, 0.3.0, 0.2.0, 0.1.4, 0.1.3, 0.1.2, 0.1.1, 0.1.0, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1

[notice] A new release of pip is available: 25.0.1 -> 26.0.1
[notice] To update, run: pip install --upgrade pip

ℹ️ Turn 7/75 — turn=7 phases=['api_verified'] tests=not yet run history_len=5

run_command: cat /workspace/../030-livekit-agents-python/README.md 2>/dev/null || echo "Looking for existing example..."

exit: 0

Looking for existing example...

ℹ️ Turn 8/75 — turn=8 phases=['api_verified'] tests=not yet run history_len=6

run_command: ls -la /workspace/../ 2>/dev/null | head -20 || echo "can't list parent"

exit: 0

total 72
drwxr-xr-x   1 root root 4096 Apr 14 19:42 .
drwxr-xr-x   1 root root 4096 Apr 14 19:42 ..
-rwxr-xr-x   1 root root    0 Apr 14 19:42 .dockerenv
lrwxrwxrwx   1 root root    7 Apr  6 00:00 bin -> usr/bin
drwxr-xr-x   2 root root 4096 Jan  2 12:40 boot
drwxr-xr-x   5 root root  340 Apr 14 19:42 dev
drwxr-xr-x   1 root root 4096 Apr 14 19:42 etc
drwxr-xr-x   2 root root 4096 Jan  2 12:40 home
lrwxrwxrwx   1 root root    7 Apr  6 00:00 lib -> usr/lib
lrwxrwxrwx   1 root root    9 Apr  6 00:00 lib64 -> usr/lib64
drwxr-xr-x   2 root root 4096 Apr  6 00:00 media
drwxr-xr-x   2 root root 4096 Apr  6 00:00 mnt
drwxr-xr-x   2 root root 4096 Apr  6 00:00 opt
dr-xr-xr-x 229 root root    0 Apr 14 19:42 proc
drwx------   1 root root 4096 Apr 14 19:42 root
drwxr-xr-x   1 root root 4096 Apr  7 02:42 run
lrwxrwxrwx   1 root root    8 Apr  6 00:00 sbin -> usr/sbin
drwxr-xr-x   2 root root 4096 Apr  6 00:00 srv
dr-xr-xr-x  12 root root    0 Apr 14 19:42 sys

ℹ️ Turn 9/75 — turn=9 phases=['api_verified'] tests=not yet run history_len=7

run_command: pip install livekit-agents livekit-plugins-deepgram livekit-plugins-silero --quiet 2>&1 | tail -5

exit: 0

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

[notice] A new release of pip is available: 25.0.1 -> 26.0.1
[notice] To update, run: pip install --upgrade pip

ℹ️ Turn 10/75 — turn=10 phases=['api_verified'] tests=not yet run history_len=8

run_command: python3 -c "import livekit.agents; print(livekit.agents.__version__)"

exit: 0

1.5.2

ℹ️ Turn 11/75 — turn=11 phases=['api_verified'] tests=not yet run history_len=9

run_command: python3 -c "from livekit.plugins import deepgram; print(dir(deepgram))"

exit: 0

['DeepgramPlugin', 'NOT_IN_ALL', 'Plugin', 'STT', 'STTv2', 'SpeechStream', 'SpeechStreamv2', 'TTS', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__pdoc__', '__spec__', '__version__', '_module', '_utils', 'log', 'logger', 'models', 'n', 'stt', 'stt_v2', 'tts', 'version']

ℹ️ Turn 12/75 — turn=12 phases=['api_verified'] tests=not yet run history_len=10

run_command: python3 -c "from livekit.plugins.deepgram import STT, TTS; help(STT)" 2>&1 | head -80

exit: 0

Help on class STT in module livekit.plugins.deepgram.stt:

class STT(livekit.agents.stt.stt.STT)
 |  STT(*, model: 'DeepgramModels | str' = 'nova-3', language: 'DeepgramLanguages | str' = 'en-US', detect_language: 'bool' = False, interim_results: 'bool' = True, punctuate: 'bool' = True, smart_format: 'bool' = False, sample_rate: 'int' = 16000, no_delay: 'bool' = True, endpointing_ms: 'int' = 25, enable_diarization: 'bool' = False, filler_words: 'bool' = True, keywords: 'NotGivenOr[list[tuple[str, float]]]' = NOT_GIVEN, keyterm: 'NotGivenOr[str | list[str]]' = NOT_GIVEN, tags: 'NotGivenOr[list[str]]' = NOT_GIVEN, profanity_filter: 'bool' = False, api_key: 'NotGivenOr[str]' = NOT_GIVEN, http_session: 'aiohttp.ClientSession | None' = None, base_url: 'str' = 'https://api.deepgram.com/v1/listen', numerals: 'bool' = False, mip_opt_out: 'bool' = False, vad_events: 'bool' = True, keyterms: 'NotGivenOr[list[str]]' = NOT_GIVEN) -> 'None'
 |
 |  Method resolution order:
 |      STT
 |      livekit.agents.stt.stt.STT
 |      abc.ABC
 |      livekit.rtc.event_emitter.EventEmitter
 |      typing.Generic
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, *, model: 'DeepgramModels | str' = 'nova-3', language: 'DeepgramLanguages | str' = 'en-US', detect_language: 'bool' = False, interim_results: 'bool' = True, punctuate: 'bool' = True, smart_format: 'bool' = False, sample_rate: 'int' = 16000, no_delay: 'bool' = True, endpointing_ms: 'int' = 25, enable_diarization: 'bool' = False, filler_words: 'bool' = True, keywords: 'NotGivenOr[list[tuple[str, float]]]' = NOT_GIVEN, keyterm: 'NotGivenOr[str | list[str]]' = NOT_GIVEN, tags: 'NotGivenOr[list[str]]' = NOT_GIVEN, profanity_filter: 'bool' = False, api_key: 'NotGivenOr[str]' = NOT_GIVEN, http_session: 'aiohttp.ClientSession | None' = None, base_url: 'str' = 'https://api.deepgram.com/v1/listen', numerals: 'bool' = False, mip_opt_out: 'bool' = False, vad_events: 'bool' = True, keyterms: 'NotGivenOr[list[str]]' = NOT_GIVEN) -> 'None'
 |      Create a new instance of Deepgram STT.
 |
 |      Args:
 |          model: The Deepgram model to use for speech recognition. Defaults to "nova-3".
 |          language: The language code for recognition. Defaults to "en-US".
 |          detect_language: Whether to enable automatic language detection. Defaults to False.
 |          interim_results: Whether to return interim (non-final) transcription results. Defaults to True.
 |          punctuate: Whether to add punctuations to the transcription. Defaults to True. Turn detector will work better with punctuations.
 |          smart_format: Whether to apply smart formatting to numbers, dates, etc. Defaults to False.
 |          sample_rate: The sample rate of the audio in Hz. Defaults to 16000.
 |          no_delay: When smart_format is used, ensures it does not wait for sequence to be complete before returning results. Defaults to True.
 |          endpointing_ms: Time in milliseconds of silence to consider end of speech. Set to 0 to disable. Defaults to 25.
 |          filler_words: Whether to include filler words (um, uh, etc.) in transcription. Defaults to True.
 |          keywords: List of tuples containing keywords and their boost values for improved recognition.
 |                   Each tuple should be (keyword: str, boost: float). Defaults to None.
 |                   `keywords` does not work with Nova-3 models. Use `keyterm` instead.
 |          keyterm: str or list of str of key terms to improve recognition accuracy. Defaults to None.
 |                   `keyterm` is only supported by Nova-3 models.
 |          tags: List of tags to add to the requests for usage reporting. Defaults to NOT_GIVEN.
 |          profanity_filter: Whether to filter profanity from the transcription. Defaults to False.
 |          api_key: Your Deepgram API key. If not provided, will look for DEEPGRAM_API_KEY environment variable.
 |          http_session: Optional aiohttp ClientSession to use for requ

ℹ️ Turn 13/75 — turn=13 phases=['api_verified'] tests=not yet run history_len=11

run_command: python3 -c "from livekit.plugins.deepgram import TTS; help(TTS)" 2>&1 | head -80

exit: 0

Help on class TTS in module livekit.plugins.deepgram.tts:

class TTS(livekit.agents.tts.tts.TTS)
 |  TTS(*, model: 'str' = 'aura-2-andromeda-en', encoding: 'str' = 'linear16', sample_rate: 'int' = 24000, api_key: 'str | None' = None, base_url: 'str' = 'https://api.deepgram.com/v1/speak', word_tokenizer: 'NotGivenOr[tokenize.WordTokenizer]' = NOT_GIVEN, http_session: 'aiohttp.ClientSession | None' = None, mip_opt_out: 'bool' = False) -> 'None'
 |
 |  Method resolution order:
 |      TTS
 |      livekit.agents.tts.tts.TTS
 |      abc.ABC
 |      livekit.rtc.event_emitter.EventEmitter
 |      typing.Generic
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, *, model: 'str' = 'aura-2-andromeda-en', encoding: 'str' = 'linear16', sample_rate: 'int' = 24000, api_key: 'str | None' = None, base_url: 'str' = 'https://api.deepgram.com/v1/speak', word_tokenizer: 'NotGivenOr[tokenize.WordTokenizer]' = NOT_GIVEN, http_session: 'aiohttp.ClientSession | None' = None, mip_opt_out: 'bool' = False) -> 'None'
 |      Create a new instance of Deepgram TTS.
 |
 |      Args:
 |          model (str): TTS model to use. Defaults to "aura-2-andromeda-en".
 |          encoding (str): Audio encoding to use. Defaults to "linear16".
 |          sample_rate (int): Sample rate of audio. Defaults to 24000.
 |          api_key (str): Deepgram API key. If not provided, will look for DEEPGRAM_API_KEY in environment.
 |          base_url (str): Base URL for Deepgram TTS API. Defaults to "https://api.deepgram.com/v1/speak"
 |          word_tokenizer (tokenize.WordTokenizer): Tokenizer for processing text. Defaults to basic WordTokenizer.
 |          http_session (aiohttp.ClientSession): Optional aiohttp session to use for requests.
 |
 |  async aclose(self) -> 'None'
 |
 |  prewarm(self) -> 'None'
 |      Pre-warm connection to the TTS service
 |
 |  stream(self, *, conn_options: 'APIConnectOptions' = APIConnectOptions(max_retry=3, retry_interval=2.0, timeout=10.0)) -> 'SynthesizeStream'
 |
 |  synthesize(self, text: 'str', *, conn_options: 'APIConnectOptions' = APIConnectOptions(max_retry=3, retry_interval=2.0, timeout=10.0)) -> 'ChunkedStream'
 |
 |  update_options(self, *, model: 'NotGivenOr[str]' = NOT_GIVEN) -> 'None'
 |      Args:
 |          model (str): TTS model to use.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  model
 |      Get the model name/identifier for this TTS instance.
 |
 |      Returns:
 |          The model name if available, "unknown" otherwise.
 |
 |      Note:
 |          Plugins should override this property to provide their model information.
 |
 |  provider
 |      Get the provider name/identifier for this TTS instance.
 |
 |      Returns:
 |          The provider name if available, "unknown" otherwise.
 |
 |      Note:
 |          Plugins should override this property to provide their provider information.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  __parameters__ = ()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from livekit.agents.tts.tts.TTS:
 |
 |  async __aenter__(self) -> 'TTS'
 |
 |  async __aexit__(self, exc_type: 'type[BaseException] | None', exc: 'BaseException | None', exc_tb: 'TracebackType | None') -> 'None'
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from livekit.agents.tts.tts.TTS:
 |
 |  capabilities
 |

ℹ️ Turn 14/75 — turn=14 phases=['api_verified'] tests=not yet run history_len=12

run_command: python3 -c "from livekit.agents import AgentSession, Agent; help(AgentSession)" 2>&1 | head -100

exit: 0

Help on class AgentSession in module livekit.agents.voice.agent_session:

class AgentSession(livekit.rtc.event_emitter.EventEmitter, typing.Generic)
 |  AgentSession(*, stt: 'NotGivenOr[stt.STT | STTModels | str]' = NOT_GIVEN, vad: 'NotGivenOr[vad.VAD]' = NOT_GIVEN, llm: 'NotGivenOr[llm.LLM | llm.RealtimeModel | LLMModels | str]' = NOT_GIVEN, tts: 'NotGivenOr[tts.TTS | TTSModels | str]' = NOT_GIVEN, turn_handling: 'NotGivenOr[TurnHandlingOptions]' = NOT_GIVEN, tools: 'NotGivenOr[list[llm.Tool | llm.Toolset]]' = NOT_GIVEN, mcp_servers: 'NotGivenOr[list[mcp.MCPServer]]' = NOT_GIVEN, max_tool_steps: 'int' = 3, use_tts_aligned_transcript: 'NotGivenOr[bool]' = NOT_GIVEN, tts_text_transforms: 'NotGivenOr[Sequence[TextTransforms] | None]' = NOT_GIVEN, min_consecutive_speech_delay: 'float' = 0.0, userdata: 'NotGivenOr[Userdata_T]' = NOT_GIVEN, video_sampler: 'NotGivenOr[_VideoSampler | None]' = NOT_GIVEN, preemptive_generation: 'bool' = True, aec_warmup_duration: 'float | None' = 3.0, ivr_detection: 'bool' = False, user_away_timeout: 'float | None' = 15.0, conn_options: 'NotGivenOr[SessionConnectOptions]' = NOT_GIVEN, loop: 'asyncio.AbstractEventLoop | None' = None, min_endpointing_delay: 'NotGivenOr[float]' = NOT_GIVEN, max_endpointing_delay: 'NotGivenOr[float]' = NOT_GIVEN, false_interruption_timeout: 'NotGivenOr[float | None]' = NOT_GIVEN, turn_detection: 'NotGivenOr[TurnDetectionMode]' = NOT_GIVEN, discard_audio_if_uninterruptible: 'NotGivenOr[bool]' = NOT_GIVEN, min_interruption_duration: 'NotGivenOr[float]' = NOT_GIVEN, min_interruption_words: 'NotGivenOr[int]' = NOT_GIVEN, allow_interruptions: 'NotGivenOr[bool]' = NOT_GIVEN, resume_false_interruption: 'NotGivenOr[bool]' = NOT_GIVEN, agent_false_interruption_timeout: 'NotGivenOr[float | None]' = NOT_GIVEN) -> 'None'
 |
 |  Method resolution order:
 |      AgentSession
 |      livekit.rtc.event_emitter.EventEmitter
 |      typing.Generic
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  async __aenter__(self) -> 'AgentSession'
 |
 |  async __aexit__(self, exc_type: 'type[BaseException] | None', exc: 'BaseException | None', exc_tb: 'TracebackType | None') -> 'None'
 |
 |  __init__(self, *, stt: 'NotGivenOr[stt.STT | STTModels | str]' = NOT_GIVEN, vad: 'NotGivenOr[vad.VAD]' = NOT_GIVEN, llm: 'NotGivenOr[llm.LLM | llm.RealtimeModel | LLMModels | str]' = NOT_GIVEN, tts: 'NotGivenOr[tts.TTS | TTSModels | str]' = NOT_GIVEN, turn_handling: 'NotGivenOr[TurnHandlingOptions]' = NOT_GIVEN, tools: 'NotGivenOr[list[llm.Tool | llm.Toolset]]' = NOT_GIVEN, mcp_servers: 'NotGivenOr[list[mcp.MCPServer]]' = NOT_GIVEN, max_tool_steps: 'int' = 3, use_tts_aligned_transcript: 'NotGivenOr[bool]' = NOT_GIVEN, tts_text_transforms: 'NotGivenOr[Sequence[TextTransforms] | None]' = NOT_GIVEN, min_consecutive_speech_delay: 'float' = 0.0, userdata: 'NotGivenOr[Userdata_T]' = NOT_GIVEN, video_sampler: 'NotGivenOr[_VideoSampler | None]' = NOT_GIVEN, preemptive_generation: 'bool' = True, aec_warmup_duration: 'float | None' = 3.0, ivr_detection: 'bool' = False, user_away_timeout: 'float | None' = 15.0, conn_options: 'NotGivenOr[SessionConnectOptions]' = NOT_GIVEN, loop: 'asyncio.AbstractEventLoop | None' = None, min_endpointing_delay: 'NotGivenOr[float]' = NOT_GIVEN, max_endpointing_delay: 'NotGivenOr[float]' = NOT_GIVEN, false_interruption_timeout: 'NotGivenOr[float | None]' = NOT_GIVEN, turn_detection: 'NotGivenOr[TurnDetectionMode]' = NOT_GIVEN, discard_audio_if_uninterruptible: 'NotGivenOr[bool]' = NOT_GIVEN, min_interruption_duration: 'NotGivenOr[float]' = NOT_GIVEN, min_interruption_words: 'NotGivenOr[int]' = NOT_GIVEN, allow_interruptions: 'NotGivenOr[bool]' = NOT_GIVEN, resume_false_interruption: 'NotGivenOr[bool]' = NOT_GIVEN, agent_false_interruption_timeout: 'NotGivenOr[float | None]' = NOT_GIVEN) -> 'None'
 |      `AgentSession` is the LiveKit Agents runtime that glues together
 |      media streams, speech/LLM components, and tool orchestration into a
 |      single real-time voice agent.
 |

ℹ️ Turn 15/75 — turn=15 phases=['api_verified'] tests=not yet run history_len=13

run_command: python3 -c "from livekit.agents import Agent; help(Agent)" 2>&1 | head -60

exit: 0

Help on class Agent in module livekit.agents.voice.agent:

class Agent(builtins.object)
 |  Agent(*, instructions: 'str | Instructions', id: 'str | None' = None, chat_ctx: 'NotGivenOr[llm.ChatContext | None]' = NOT_GIVEN, tools: 'list[llm.Tool | llm.Toolset] | None' = None, stt: 'NotGivenOr[stt.STT | STTModels | str | None]' = NOT_GIVEN, vad: 'NotGivenOr[vad.VAD | None]' = NOT_GIVEN, turn_handling: 'NotGivenOr[TurnHandlingOptions]' = NOT_GIVEN, llm: 'NotGivenOr[llm.LLM | llm.RealtimeModel | LLMModels | str | None]' = NOT_GIVEN, tts: 'NotGivenOr[tts.TTS | TTSModels | str | None]' = NOT_GIVEN, mcp_servers: 'NotGivenOr[list[mcp.MCPServer] | None]' = NOT_GIVEN, min_consecutive_speech_delay: 'NotGivenOr[float]' = NOT_GIVEN, use_tts_aligned_transcript: 'NotGivenOr[bool]' = NOT_GIVEN, turn_detection: 'NotGivenOr[TurnDetectionMode | None]' = NOT_GIVEN, min_endpointing_delay: 'NotGivenOr[float]' = NOT_GIVEN, max_endpointing_delay: 'NotGivenOr[float]' = NOT_GIVEN, allow_interruptions: 'NotGivenOr[bool]' = NOT_GIVEN) -> 'None'
 |
 |  Methods defined here:
 |
 |  __init__(self, *, instructions: 'str | Instructions', id: 'str | None' = None, chat_ctx: 'NotGivenOr[llm.ChatContext | None]' = NOT_GIVEN, tools: 'list[llm.Tool | llm.Toolset] | None' = None, stt: 'NotGivenOr[stt.STT | STTModels | str | None]' = NOT_GIVEN, vad: 'NotGivenOr[vad.VAD | None]' = NOT_GIVEN, turn_handling: 'NotGivenOr[TurnHandlingOptions]' = NOT_GIVEN, llm: 'NotGivenOr[llm.LLM | llm.RealtimeModel | LLMModels | str | None]' = NOT_GIVEN, tts: 'NotGivenOr[tts.TTS | TTSModels | str | None]' = NOT_GIVEN, mcp_servers: 'NotGivenOr[list[mcp.MCPServer] | None]' = NOT_GIVEN, min_consecutive_speech_delay: 'NotGivenOr[float]' = NOT_GIVEN, use_tts_aligned_transcript: 'NotGivenOr[bool]' = NOT_GIVEN, turn_detection: 'NotGivenOr[TurnDetectionMode | None]' = NOT_GIVEN, min_endpointing_delay: 'NotGivenOr[float]' = NOT_GIVEN, max_endpointing_delay: 'NotGivenOr[float]' = NOT_GIVEN, allow_interruptions: 'NotGivenOr[bool]' = NOT_GIVEN) -> 'None'
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  llm_node(self, chat_ctx: 'llm.ChatContext', tools: 'list[llm.Tool]', model_settings: 'ModelSettings') -> 'AsyncIterable[llm.ChatChunk | str | FlushSentinel] | Coroutine[Any, Any, AsyncIterable[llm.ChatChunk | str | FlushSentinel]] | Coroutine[Any, Any, str] | Coroutine[Any, Any, llm.ChatChunk] | Coroutine[Any, Any, None]'
 |      A node in the processing pipeline that processes text generation with an LLM.
 |
 |      By default, this node uses the agent's LLM to process the provided context. It may yield
 |      plain text (as `str`) for straightforward text generation, or `llm.ChatChunk` objects that
 |      can include text and optional tool calls. `ChatChunk` is helpful for capturing more complex
 |      outputs such as function calls, usage statistics, or other metadata.
 |
 |      You can override this node to customize how the LLM is used or how tool invocations
 |      and responses are handled.
 |
 |      Args:
 |          chat_ctx (llm.ChatContext): The context for the LLM (the conversation history).
 |          tools (list[FunctionTool]): A list of callable tools that the LLM may invoke.
 |          model_settings (ModelSettings): Configuration and parameters for model execution.
 |
 |      Yields/Returns:
 |          str: Plain text output from the LLM.
 |          llm.ChatChunk: An object that can contain both text and optional tool calls.
 |
 |  async on_enter(self) -> 'None'
 |      Called when the task is entered
 |
 |  async on_exit(self) -> 'None'
 |      Called when the task is exited
 |
 |  async on_user_turn_completed(self, turn_ctx: 'llm.ChatContext', new_message: 'llm.ChatMessage') -> 'None'
 |      Called when the user has finished speaking, and the LLM is about to respond
 |
 |      This is a good opportunity to update the chat context or edit the new message before it is
 |      sent to the LLM.
 |
 |  realtime_audio_output_node(self, audio: 'Async

ℹ️ Turn 16/75 — turn=16 phases=['api_verified'] tests=not yet run history_len=14

run_command: python3 -c "from livekit.agents import cli; help(cli)" 2>&1 | head -50

exit: 0

Help on package livekit.agents.cli in livekit.agents:

NAME
    livekit.agents.cli

PACKAGE CONTENTS
    cli
    discover
    log
    proto
    readchar
    watcher

CLASSES
    builtins.object
        livekit.agents.cli.cli.AgentsConsole

    class AgentsConsole(builtins.object)
     |  AgentsConsole() -> 'None'
     |
     |  Methods defined here:
     |
     |  __init__(self) -> 'None'
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  acquire_io(self, *, loop: 'asyncio.AbstractEventLoop', session: 'AgentSession') -> 'None'
     |
     |  print(self, child: 'RenderableType', *, tag: 'str' = '', tag_style: 'Style | None' = None) -> 'None'
     |
     |  set_microphone_enabled(self, enable: 'bool', *, device: 'int | str | None' = None) -> 'None'
     |
     |  set_speaker_enabled(self, enable: 'bool', *, device: 'int | str | None' = None) -> 'None'
     |
     |  wait_for_io_acquisition(self) -> 'None'
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  get_instance() -> 'AgentsConsole'
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  input_name
     |
     |  io_acquired
     |
     |  io_context
     |
     |  io_loop

ℹ️ Turn 17/75 — turn=17 phases=['api_verified'] tests=not yet run history_len=15

run_command: python3 -c "from livekit.agents import cli; print(dir(cli))"

exit: 0

['AgentsConsole', 'NOT_IN_ALL', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__pdoc__', '__spec__', '_module', 'cli', 'log', 'n', 'proto', 'readchar', 'run_app']

ℹ️ Turn 18/75 — turn=18 phases=['api_verified'] tests=not yet run history_len=16

run_command: python3 -c "from livekit.agents.cli import run_app; help(run_app)" 2>&1 | head -100

exit: 0

Help on function run_app in module livekit.agents.cli.cli:

run_app(server: 'AgentServer | WorkerOptions') -> 'None'


ℹ️ Turn 19/75 — turn=19 phases=['api_verified'] tests=not yet run history_len=17

run_command: python3 -c "from livekit.agents import AgentServer; help(AgentServer)" 2>&1 | head -50

exit: 0

Help on class AgentServer in module livekit.agents.worker:

class AgentServer(livekit.rtc.event_emitter.EventEmitter)
 |  AgentServer(*, job_executor_type: 'JobExecutorType' = <JobExecutorType.PROCESS: 'process'>, load_threshold: 'float | ServerEnvOption[float]' = ServerEnvOption(dev_default=inf, prod_default=0.7), job_memory_warn_mb: 'float' = 500, job_memory_limit_mb: 'float' = 0, drain_timeout: 'int' = 1800, num_idle_processes: 'int | ServerEnvOption[int]' = ServerEnvOption(dev_default=0, prod_default=2), shutdown_process_timeout: 'float' = 10.0, session_end_timeout: 'float' = 300.0, initialize_process_timeout: 'float' = 10.0, permissions: 'WorkerPermissions' = WorkerPermissions(can_publish=True, can_subscribe=True, can_publish_data=True, can_update_metadata=True, can_publish_sources=[], hidden=False), max_retry: 'int' = 16, ws_url: 'str | None' = None, api_key: 'str | None' = None, api_secret: 'str | None' = None, host: 'str' = '', port: 'int | ServerEnvOption[int]' = ServerEnvOption(dev_default=0, prod_default=8081), http_proxy: 'NotGivenOr[str | None]' = NOT_GIVEN, multiprocessing_context: "Literal['spawn', 'forkserver']" = 'forkserver', setup_fnc: 'Callable[[JobProcess], Any] | None' = None, load_fnc: 'Callable[[AgentServer], float] | Callable[[], float] | None' = None, prometheus_port: 'int | None' = None, prometheus_multiproc_dir: 'str | None' = None, log_level: 'str | ServerEnvOption[str]' = ServerEnvOption(dev_default='DEBUG', prod_default='INFO')) -> 'None'
 |
 |  Method resolution order:
 |      AgentServer
 |      livekit.rtc.event_emitter.EventEmitter
 |      typing.Generic
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, *, job_executor_type: 'JobExecutorType' = <JobExecutorType.PROCESS: 'process'>, load_threshold: 'float | ServerEnvOption[float]' = ServerEnvOption(dev_default=inf, prod_default=0.7), job_memory_warn_mb: 'float' = 500, job_memory_limit_mb: 'float' = 0, drain_timeout: 'int' = 1800, num_idle_processes: 'int | ServerEnvOption[int]' = ServerEnvOption(dev_default=0, prod_default=2), shutdown_process_timeout: 'float' = 10.0, session_end_timeout: 'float' = 300.0, initialize_process_timeout: 'float' = 10.0, permissions: 'WorkerPermissions' = WorkerPermissions(can_publish=True, can_subscribe=True, can_publish_data=True, can_update_metadata=True, can_publish_sources=[], hidden=False), max_retry: 'int' = 16, ws_url: 'str | None' = None, api_key: 'str | None' = None, api_secret: 'str | None' = None, host: 'str' = '', port: 'int | ServerEnvOption[int]' = ServerEnvOption(dev_default=0, prod_default=8081), http_proxy: 'NotGivenOr[str | None]' = NOT_GIVEN, multiprocessing_context: "Literal['spawn', 'forkserver']" = 'forkserver', setup_fnc: 'Callable[[JobProcess], Any] | None' = None, load_fnc: 'Callable[[AgentServer], float] | Callable[[], float] | None' = None, prometheus_port: 'int | None' = None, prometheus_multiproc_dir: 'str | None' = None, log_level: 'str | ServerEnvOption[str]' = ServerEnvOption(dev_default='DEBUG', prod_default='INFO')) -> 'None'
 |      Initialize a new instance of EventEmitter.
 |
 |  async aclose(self) -> 'None'
 |
 |  async drain(self, timeout: 'NotGivenOr[int | None]' = NOT_GIVEN) -> 'None'
 |      When timeout isn't None, it will raise asyncio.TimeoutError if the processes didn't finish in time.
 |
 |  rtc_session(self, func: 'Callable[[JobContext], Awaitable[None]] | None' = None, *, agent_name: 'str' = '', type: 'ServerType' = <ServerType.ROOM: 0>, on_request: 'Callable[[JobRequest], Any] | None' = None, on_session_end: 'Callable[[JobContext], Any] | None' = None) -> 'Callable[[JobContext], Awaitable[None]] | Callable[[Callable[[JobContext], Awaitable[None]]], Callable[[JobContext], Awaitable[None]]]'
 |      Decorator or direct registrar for the RTC session entrypoint.
 |
 |      Usage:
 |          @server.rtc_session(agent_name="survey_agent")
 |          async def my_agent(job_ctx: JobContext): ...
 |
 |          server.rtc_session(my_agent, agent_na

ℹ️ Turn 20/75 — turn=20 phases=['api_verified'] tests=not yet run history_len=18

run_command: pip install livekit-plugins-openai --quiet 2>&1 | tail -3

exit: 0


[notice] A new release of pip is available: 25.0.1 -> 26.0.1
[notice] To update, run: pip install --upgrade pip

ℹ️ Turn 21/75 — turn=21 phases=['api_verified'] tests=not yet run history_len=19

run_command: python3 -c "from livekit.plugins import openai; print(dir(openai))"

exit: 0

['EmbeddingData', 'LLM', 'LLMStream', 'NOT_IN_ALL', 'OpenAIPlugin', 'OpenRouterProviderPreferences', 'OpenRouterWebPlugin', 'Plugin', 'STT', 'STTModels', 'TTS', 'TTSModels', 'TTSVoices', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__pdoc__', '__spec__', '__version__', '_module', 'create_embeddings', 'embeddings', 'llm', 'log', 'logger', 'models', 'n', 'realtime', 'responses', 'stt', 'tools', 'tts', 'utils', 'version']

ℹ️ Turn 22/75 — turn=22 phases=['api_verified'] tests=not yet run history_len=20

run_command: pip index versions livekit-plugins-silero 2>&1 | head -5

exit: 0

WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
livekit-plugins-silero (1.5.2)
Available versions: 1.5.2, 1.5.1, 1.5.0, 1.4.6, 1.4.5, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.3.12, 1.3.11, 1.3.10, 1.3.9, 1.3.8, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.2.18, 1.2.17, 1.2.16, 1.2.15, 1.2.14, 1.2.13, 1.2.12, 1.2.11, 1.2.9, 1.2.8, 1.2.7, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.7, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.23, 1.0.22, 1.0.21, 1.0.20, 1.0.19, 1.0.18, 1.0.17, 1.0.16, 1.0.15, 1.0.14, 1.0.13, 1.0.12, 1.0.11, 0.7.6, 0.7.5, 0.7.4, 0.7.3, 0.7.2, 0.7.1, 0.7.0, 0.6.4, 0.6.3, 0.6.2, 0.6.1, 0.6.0, 0.5.3, 0.5.2, 0.5.1, 0.5.0, 0.4.0, 0.3.0, 0.2.0, 0.1.1, 0.1.0, 0.0.8, 0.0.7
  INSTALLED: 1.5.2
  LATEST:    1.5.2

ℹ️ Turn 23/75 — turn=23 phases=['api_verified'] tests=not yet run history_len=21

run_command: echo "OPENAI_API_KEY is set: ${OPENAI_API_KEY:+yes}"

exit: 0

OPENAI_API_KEY is set: 

ℹ️ Turn 24/75 — turn=24 phases=['api_verified'] tests=not yet run history_len=22

run_command: pip search livekit-plugins 2>&1 || pip install livekit-plugins-anthropic==9999 2>&1 | head -15

exit: 0

ERROR: XMLRPC request failed [code: -32500]
RuntimeError: PyPI no longer supports 'pip search' (or XML-RPC search). Please use https://pypi.org/search (via a browser) instead. See https://warehouse.pypa.io/api-reference/xml-rpc.html#deprecated-methods for more information.
ERROR: Could not find a version that satisfies the requirement livekit-plugins-anthropic==9999 (from versions: 0.0.1, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.2.8, 0.2.9, 0.2.10, 0.2.11, 0.2.12, 0.2.13, 0.2.14, 1.0.0.dev4, 1.0.0.dev5, 1.0.0rc1, 1.0.0rc2, 1.0.0rc3, 1.0.0rc4, 1.0.0rc5, 1.0.0rc6, 1.0.0rc7, 1.0.0rc8, 1.0.0rc9, 1.0.0, 1.0.1, 1.0.2, 1.0.10, 1.0.11, 1.0.12, 1.0.13, 1.0.14, 1.0.15, 1.0.16, 1.0.17, 1.0.18, 1.0.19, 1.0.20, 1.0.21, 1.0.22, 1.0.23, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9, 1.2.10, 1.2.11, 1.2.12, 1.2.13, 1.2.14, 1.2.15, 1.2.16, 1.2.17, 1.2.18, 1.3.0rc1, 1.3.0rc2, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11, 1.3.12, 1.4.0rc1, 1.4.0rc2, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.5.0rc1, 1.5.0rc2, 1.5.0, 1.5.1, 1.5.2)

[notice] A new release of pip is available: 25.0.1 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
ERROR: No matching distribution found for livekit-plugins-anthropic==9999

ℹ️ Turn 25/75 — turn=25 phases=['api_verified'] tests=not yet run history_len=23

run_command: echo "ANTHROPIC_API_KEY is set: ${ANTHROPIC_API_KEY:+yes}"

exit: 0

ANTHROPIC_API_KEY is set: 

ℹ️ Turn 26/75 — turn=26 phases=['api_verified'] tests=not yet run history_len=24

run_command: pip install livekit-plugins-google==9999 2>&1 | head -5

exit: 0

ERROR: Could not find a version that satisfies the requirement livekit-plugins-google==9999 (from versions: 0.0.2, 0.1.0, 0.1.1, 0.1.2, 0.2.0, 0.3.dev0, 0.3.0, 0.4.dev0, 0.4.dev1, 0.4.0, 0.5.dev0, 0.5.0, 0.5.1, 0.6.dev0, 0.6.0.dev1, 0.6.0.dev2, 0.6.0.dev7, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.10.2, 0.10.3, 0.10.4, 0.10.5, 0.10.6, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4, 0.11.5, 1.0.0.dev4, 1.0.0.dev5, 1.0.0rc1, 1.0.0rc2, 1.0.0rc3, 1.0.0rc4, 1.0.0rc5, 1.0.0rc6, 1.0.0rc7, 1.0.0rc8, 1.0.0rc9, 1.0.0, 1.0.1, 1.0.2, 1.0.10, 1.0.11, 1.0.12, 1.0.13, 1.0.14, 1.0.15, 1.0.16, 1.0.17, 1.0.18, 1.0.19, 1.0.20, 1.0.21, 1.0.22, 1.0.23, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9, 1.2.11, 1.2.12, 1.2.13, 1.2.14, 1.2.15, 1.2.16, 1.2.17, 1.2.18, 1.3.0rc1, 1.3.0rc2, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11, 1.3.12, 1.4.0rc1, 1.4.0rc2, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.5.0rc1, 1.5.0rc2, 1.5.0, 1.5.1, 1.5.2)

[notice] A new release of pip is available: 25.0.1 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
ERROR: No matching distribution found for livekit-plugins-google==9999

ℹ️ Turn 27/75 — turn=27 phases=['api_verified'] tests=not yet run history_len=25

run_command: echo "GOOGLE_API_KEY is set: ${GOOGLE_API_KEY:+yes}"

exit: 0

GOOGLE_API_KEY is set: 

ℹ️ Turn 28/75 — turn=28 phases=['api_verified'] tests=not yet run history_len=26

run_command: echo "GROQ_API_KEY is set: ${GROQ_API_KEY:+yes}"

exit: 0

GROQ_API_KEY is set: 

ℹ️ Turn 29/75 — turn=29 phases=['api_verified'] tests=not yet run history_len=27

run_command: env | grep -i "_API_KEY\|_API_SECRET\|_URL" | sed 's/=.*/=***/' | sort

exit: 0

DEEPGRAM_API_KEY=***
LIVEKIT_API_KEY=***
LIVEKIT_URL=***

ℹ️ Turn 30/75 — turn=30 phases=['api_verified'] tests=not yet run history_len=28
📄 wrote src/agent.py
ℹ️ Turn 31/75 — turn=31 phases=['api_verified', 'source'] tests=not yet run history_len=28
📄 wrote src/init.py
ℹ️ Turn 32/75 — turn=32 phases=['api_verified', 'source'] tests=not yet run history_len=28
📄 wrote requirements.txt
ℹ️ Turn 33/75 — turn=33 phases=['api_verified', 'source'] tests=not yet run history_len=28
📄 wrote .env.example
ℹ️ Turn 34/75 — turn=34 phases=['api_verified', 'env_example', 'source'] tests=not yet run history_len=28

run_command: mkdir -p tests

exit: 0
ℹ️ Turn 35/75 — turn=35 phases=['api_verified', 'env_example', 'source'] tests=not yet run history_len=29
📄 wrote tests/init.py
ℹ️ Turn 36/75 — turn=36 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=29
📄 wrote tests/test_deepgram_connection.py
ℹ️ Turn 37/75 — turn=37 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=29
📄 wrote tests/test_livekit_connection.py
ℹ️ Turn 38/75 — turn=38 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=29
📄 wrote tests/test_integration.py
ℹ️ Turn 39/75 — turn=39 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=29
📄 wrote tests/run_tests.py
ℹ️ Turn 40/75 — turn=40 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=29

run_command: pip install python-dotenv livekit-api --quiet 2>&1 | tail -3

exit: 0


[notice] A new release of pip is available: 25.0.1 -> 26.0.1
[notice] To update, run: pip install --upgrade pip

ℹ️ Turn 41/75 — turn=41 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=30

run_command: cd /workspace && python tests/test_deepgram_connection.py

exit: 1

============================================================
Deepgram Connection Tests
============================================================

Testing plugin initialization...
  ✓ STT initialized - model: nova-3, provider: Deepgram
  ✓ TTS initialized - model: aura-2-andromeda-en, provider: Deepgram
Testing Deepgram TTS...
  ✗ TTS error: Connection error.
Testing Deepgram STT...
  ✗ STT error: Connection error.

============================================================
Tests: 1/3 passed

stderr:

failed to synthesize speech: Connection error., retrying in 0.1s
failed to synthesize speech: Connection error., retrying in 2.0s
failed to synthesize speech: Connection error., retrying in 2.0s
failed to synthesize speech: Connection error., retrying in 0.1s
failed to synthesize speech: Connection error., retrying in 2.0s
failed to synthesize speech: Connection error., retrying in 2.0s
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/livekit/plugins/deepgram/tts.py", line 203, in _run
    async with self._tts._ensure_session().post(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/livekit/plugins/deepgram/tts.py", line 156, in _ensure_session
    self._session = utils.http_context.http_session()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/livekit/agents/utils/http_context.py", line 47, in http_session
    raise RuntimeError(
RuntimeError: Attempted to use an http session outside of a job context. This is probably because you are trying to use a plugin without using the agent worker api. You may need to create your own aiohttp.ClientSession, pass it into the plugin constructor as a kwarg, and manage its lifecycle.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/workspace/tests/test_deepgram_connection.py", line 91, in test_deepgram_stt
    async for chunk in tts.synthesize(test_phrase):
  File "/usr/local/lib/python3.12/site-packages/livekit/agents/tts/tts.py", line 355, in __anext__
    raise exc  # noqa: B904
    ^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/livekit/agents/tts/tts.py", line 199, in _traceable_main_task
    await self._main_task()
  File "/usr/local/lib/python3.12/site-packages/livekit/agents/tts/tts.py", line 292, in _main_task
    await self._run(output_emitter)
  File "/usr/local/lib/python3.12/site-packages/livekit/plugins/deepgram/tts

ℹ️ Turn 42/75 — turn=42 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=31
📄 wrote tests/test_deepgram_connection.py
ℹ️ Turn 43/75 — turn=43 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=31

run_command: cd /workspace && python tests/test_deepgram_connection.py

exit: 1

============================================================
Deepgram Connection Tests
============================================================

Testing plugin initialization...
  ✓ STT initialized - model: nova-3, provider: Deepgram
  ✓ TTS initialized - model: aura-2-andromeda-en, provider: Deepgram
Testing Deepgram TTS...
  ✓ TTS generated 89520 bytes of audio
Testing Deepgram STT...
  - Generated 18 audio frames for transcription
  ✗ STT error: 'SpeechEvent' object has no attribute 'is_final'

============================================================
Tests: 2/3 passed

stderr:

Traceback (most recent call last):
  File "/workspace/tests/test_deepgram_connection.py", line 115, in test_deepgram_stt
    if event.is_final and event.alternatives:
       ^^^^^^^^^^^^^^
AttributeError: 'SpeechEvent' object has no attribute 'is_final'

ℹ️ Turn 44/75 — turn=44 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=32

run_command: python3 -c "from livekit.agents.stt import SpeechEvent; help(SpeechEvent)" 2>&1 | head -60

exit: 0

Help on class SpeechEvent in module livekit.agents.stt.stt:

class SpeechEvent(builtins.object)
 |  SpeechEvent(type: 'SpeechEventType', request_id: 'str' = '', alternatives: 'list[SpeechData]' = <factory>, recognition_usage: 'RecognitionUsage | None' = None) -> None
 |
 |  SpeechEvent(type: 'SpeechEventType', request_id: 'str' = '', alternatives: 'list[SpeechData]' = <factory>, recognition_usage: 'RecognitionUsage | None' = None)
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __init__(self, type: 'SpeechEventType', request_id: 'str' = '', alternatives: 'list[SpeechData]' = <factory>, recognition_usage: 'RecognitionUsage | None' = None) -> None
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __annotations__ = {'alternatives': 'list[SpeechData]', 'recognition_us...
 |
 |  __dataclass_fields__ = {'alternatives': Field(name='alternatives',type...
 |
 |  __dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,or...
 |
 |  __hash__ = None
 |
 |  __match_args__ = ('type', 'request_id', 'alternatives', 'recognition_u...
 |
 |  recognition_usage = None
 |
 |  request_id = ''


ℹ️ Turn 45/75 — turn=45 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=33

run_command: python3 -c "from livekit.agents.stt import SpeechEventType; print(list(SpeechEventType))"

exit: 0

[<SpeechEventType.START_OF_SPEECH: 'start_of_speech'>, <SpeechEventType.INTERIM_TRANSCRIPT: 'interim_transcript'>, <SpeechEventType.PREFLIGHT_TRANSCRIPT: 'preflight_transcript'>, <SpeechEventType.FINAL_TRANSCRIPT: 'final_transcript'>, <SpeechEventType.RECOGNITION_USAGE: 'recognition_usage'>, <SpeechEventType.END_OF_SPEECH: 'end_of_speech'>]

ℹ️ Turn 46/75 — turn=46 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=34
📄 wrote tests/test_deepgram_connection.py
ℹ️ Turn 47/75 — turn=47 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=34

run_command: cd /workspace && python tests/test_deepgram_connection.py

exit: 0

============================================================
Deepgram Connection Tests
============================================================

Testing plugin initialization...
  ✓ STT initialized - model: nova-3, provider: Deepgram
  ✓ TTS initialized - model: aura-2-andromeda-en, provider: Deepgram
Testing Deepgram TTS...
  ✓ TTS generated 78960 bytes of audio
Testing Deepgram STT...
  - Generated 20 audio frames for transcription
  ✓ STT transcribed: 'The quick brown fox jumps over the lazy dog'
  ✓ Transcription accuracy check passed (8 matching words)

============================================================
All tests passed! ✓

stderr:

Deepgram keepalive task exited: Cannot write to closing transport

⚙️ Rules fired: ['R4']
ℹ️ Turn 48/75 — turn=48 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=35

run_command: cd /workspace && python tests/test_livekit_connection.py

exit: 2

============================================================
LiveKit Connection Tests
============================================================

SKIP: Missing LiveKit credentials: LIVEKIT_API_SECRET

ℹ️ Turn 49/75 — turn=49 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=36

run_command: cd /workspace && python tests/test_integration.py

exit: 0

============================================================
Integration Tests
============================================================

Testing module imports...
  ✓ All modules imported successfully
Testing Deepgram models...
  - Available model definitions loaded
  ✓ Nova-3 STT model available
  ✓ Aura-2 TTS model available
Testing AgentSession creation...
  ✓ AgentSession created successfully
    - STT model: nova-3
    - TTS model: aura-2-andromeda-en
Testing agent module...
  ✓ Agent module loaded, entrypoint found

============================================================
All tests passed! ✓

stderr:

�[0;93m2026-04-14 19:47:30.133300909 [W:onnxruntime:Default, device_discovery.cc:132 GetPciBusId] Skipping pci_bus_id for PCI path at "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/5620e0c7-8062-4dce-aeb7-520c7ef76171" because filename ""5620e0c7-8062-4dce-aeb7-520c7ef76171"" dit not match expected pattern of [0-9a-f]+:[0-9a-f]+:[0-9a-f]+[.][0-9a-f]+�[m

ℹ️ Turn 50/75 — turn=50 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=37

run_command: cd /workspace && python tests/run_tests.py

exit: 0

============================================================
Deepgram Connection Tests
============================================================

Testing plugin initialization...
  ✓ STT initialized - model: nova-3, provider: Deepgram
  ✓ TTS initialized - model: aura-2-andromeda-en, provider: Deepgram
Testing Deepgram TTS...
  ✓ TTS generated 75120 bytes of audio
Testing Deepgram STT...
  - Generated 19 audio frames for transcription
  ✓ STT transcribed: 'The quick brown fox jumps over the lazy dog,'
  ✓ Transcription accuracy check passed (7 matching words)

============================================================
All tests passed! ✓
============================================================
LiveKit Connection Tests
============================================================

SKIP: Missing LiveKit credentials: LIVEKIT_API_SECRET
============================================================
Integration Tests
============================================================

Testing module imports...
  ✓ All modules imported successfully
Testing Deepgram models...
  - Available model definitions loaded
  ✓ Nova-3 STT model available
  ✓ Aura-2 TTS model available
Testing AgentSession creation...
  ✓ AgentSession created successfully
    - STT model: nova-3
    - TTS model: aura-2-andromeda-en
Testing agent module...
  ✓ Agent module loaded, entrypoint found

============================================================
All tests passed! ✓

============================================================
Running: /workspace/tests/test_deepgram_connection.py
============================================================


============================================================
Running: /workspace/tests/test_livekit_connection.py
============================================================


============================================================
Running: /workspace/tests/test_integration.py
============================================================


============================================================
TEST SUMMARY
============================================================
  test_deepgram_connection.py: PASS ✓
  test_livekit_connection.py: SKIP ⊘
  test_integration.py: PASS ✓

All tests passed!

stderr:

Deepgram keepalive task exited: Cannot write to closing transport
�[0;93m2026-04-14 19:47:45.037498162 [W:onnxruntime:Default, device_discovery.cc:132 GetPciBusId] Skipping pci_bus_id for PCI path at "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/5620e0c7-8062-4dce-aeb7-520c7ef76171" because filename ""5620e0c7-8062-4dce-aeb7-520c7ef76171"" dit not match expected pattern of [0-9a-f]+:[0-9a-f]+:[0-9a-f]+[.][0-9a-f]+�[m

ℹ️ Turn 51/75 — turn=51 phases=['api_verified', 'env_example', 'source', 'tests'] tests=not yet run history_len=38
📄 wrote README.md
ℹ️ Turn 52/75 — turn=52 phases=['api_verified', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=38
📄 wrote BLOG.md
ℹ️ Turn 53/75 — turn=53 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=38

run_command: pip install playwright --quiet 2>&1 | tail -2

exit: 0

[notice] A new release of pip is available: 25.0.1 -> 26.0.1
[notice] To update, run: pip install --upgrade pip

ℹ️ Turn 54/75 — turn=54 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=39

run_command: playwright install chromium 2>&1 | tail -5

exit: 0
ℹ️ Turn 55/75 — turn=55 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=40
📄 wrote tools/create_screenshot.py
ℹ️ Turn 56/75 — turn=56 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=40

run_command: cd /workspace && python tools/create_screenshot.py

exit: 0

Screenshot saved as screenshot.png

ℹ️ Turn 57/75 — turn=57 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=41

run_command: ls -la /workspace/screenshot.png

exit: 0

-rw-r--r-- 1 root root 78394 Apr 14 19:49 /workspace/screenshot.png

ℹ️ Turn 58/75 — turn=58 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=42
ℹ️ Turn 59/75 — turn=59 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=42

run_command: rm -rf /workspace/src/__pycache__ /workspace/tools

exit: 0
ℹ️ Turn 60/75 — turn=60 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=43
⚙️ Rules fired: ['R7']
ℹ️ Turn 61/75 — turn=61 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=43

run_command: cd /workspace && python tests/run_tests.py

exit: 0

============================================================
Deepgram Connection Tests
============================================================

Testing plugin initialization...
  ✓ STT initialized - model: nova-3, provider: Deepgram
  ✓ TTS initialized - model: aura-2-andromeda-en, provider: Deepgram
Testing Deepgram TTS...
  ✓ TTS generated 91440 bytes of audio
Testing Deepgram STT...
  - Generated 19 audio frames for transcription
  ✓ STT transcribed: 'The quick brown fox jumps over the lazy dog.'
  ✓ Transcription accuracy check passed (8 matching words)

============================================================
All tests passed! ✓
============================================================
LiveKit Connection Tests
============================================================

SKIP: Missing LiveKit credentials: LIVEKIT_API_SECRET
============================================================
Integration Tests
============================================================

Testing module imports...
  ✓ All modules imported successfully
Testing Deepgram models...
  - Available model definitions loaded
  ✓ Nova-3 STT model available
  ✓ Aura-2 TTS model available
Testing AgentSession creation...
  ✓ AgentSession created successfully
    - STT model: nova-3
    - TTS model: aura-2-andromeda-en
Testing agent module...
  ✓ Agent module loaded, entrypoint found

============================================================
All tests passed! ✓

============================================================
Running: /workspace/tests/test_deepgram_connection.py
============================================================


============================================================
Running: /workspace/tests/test_livekit_connection.py
============================================================


============================================================
Running: /workspace/tests/test_integration.py
============================================================


============================================================
TEST SUMMARY
============================================================
  test_deepgram_connection.py: PASS ✓
  test_livekit_connection.py: SKIP ⊘
  test_integration.py: PASS ✓

All tests passed!

stderr:

Deepgram keepalive task exited: Cannot write to closing transport
�[0;93m2026-04-14 19:49:51.822979668 [W:onnxruntime:Default, device_discovery.cc:132 GetPciBusId] Skipping pci_bus_id for PCI path at "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/5620e0c7-8062-4dce-aeb7-520c7ef76171" because filename ""5620e0c7-8062-4dce-aeb7-520c7ef76171"" dit not match expected pattern of [0-9a-f]+:[0-9a-f]+:[0-9a-f]+[.][0-9a-f]+�[m

ℹ️ Turn 62/75 — turn=62 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=44

run_command: cd /workspace && ls -la && echo "---" && cat .env.example

exit: 0

total 128
drwxr-xr-x 4 1001 1001  4096 Apr 14 19:49 .
drwxr-xr-x 1 root root  4096 Apr 14 19:49 ..
-rw------- 1 1001 1001   239 Apr 14 19:45 .env.example
-rw------- 1 1001 1001 12651 Apr 14 19:48 BLOG.md
-rw------- 1 1001 1001  4649 Apr 14 19:48 README.md
-rw------- 1 1001 1001   296 Apr 14 19:45 requirements.txt
-rw-r--r-- 1 root root 78394 Apr 14 19:49 screenshot.png
drwxr-xr-x 3 root root  4096 Apr 14 19:49 src
drwxr-xr-x 2 root root  4096 Apr 14 19:47 tests
---
# Deepgram API key for speech-to-text and text-to-speech
DEEPGRAM_API_KEY=

# LiveKit server connection
LIVEKIT_URL=wss://your-livekit-server.livekit.cloud
LIVEKIT_API_KEY=
LIVEKIT_API_SECRET=

# OpenAI API key for the LLM
OPENAI_API_KEY=

ℹ️ Turn 63/75 — turn=63 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=45

run_command: grep -r "DEEPGRAM_API_KEY\|LIVEKIT\|OPENAI" /workspace/src/ --include="*.py" | head -5

exit: 0
ℹ️ Turn 64/75 — turn=64 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=46
ℹ️ Turn 65/75 — turn=65 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=46
ℹ️ Turn 66/75 — turn=66 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=46

run_command: rm -rf /workspace/src/__pycache__

exit: 0
ℹ️ Turn 67/75 — turn=67 phases=['api_verified', 'blog', 'env_example', 'readme', 'source', 'tests'] tests=not yet run history_len=47
ℹ️ Agent signalled completion after 67 turns — constraints verified ✓

@github-actions github-actions bot added type:example New example app automated Opened by the build pipeline labels Apr 14, 2026
@lukeocodes
Copy link
Copy Markdown
Member

Closing to rebuild with updated pipeline (clean PR body, needs-credentials label).

@lukeocodes lukeocodes closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Opened by the build pipeline type:example New example app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

livekit guides to demos

1 participant