Hey- Anyone had any issues where the TTS agent jus...
# agents
m
Hey- Anyone had any issues where the TTS agent just stops talking and doesn't come back? It seems like the STT is still working as it picks up me saying "hello?" to try get back the agent. Im getting 0 errors for this in the logs its just silently failing. Config: TTS:
elevenlabs
LLM:
claude-3-5-sonnet-20241022
STT:
StreamAdapter
->
deepgram
->
nova-3-general
Turn Detection:
EnglishModel
VAD:
True
r
I am not sure what would cause that. If you try other providers do you get the same result?
m
i believe it does happen with other providers but it sometimes works, i reverted my code back to the best working stage: i have
enable_ssml_parsing
set to true and its in a
TTSStreamAdapter
which is also in a
TTSFallbackAdapter
This just worked and had not cut off in the whole 7 minutes call, there doesnt seem to be a pattern?
Copy code
return TTSStreamAdapter(
                tts=elevenlabs.TTS(
                    voice_id=voices.provider_id, model=voices.model_name, encoding="mp3_44100_96", enable_ssml_parsing=True
                )
            )
Here is my agent session handle.
I'm just really confused as its quite inconstant and no errors being shown, we keep getting customers telling us the agent just stopped speaking and they couldn't get it to come back.
Copy code
failed to generate LLM completion, retrying in 0.1s
Traceback (most recent call last):
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/plugins/anthropic/llm.py", line 254, in _run
    async for event in stream:
  File "/home/appuser/.local/lib/python3.11/site-packages/anthropic/_streaming.py", line 185, in __aiter__
    async for item in self._iterator:
  File "/home/appuser/.local/lib/python3.11/site-packages/anthropic/_streaming.py", line 228, in __stream__
    raise self._client._make_status_error(
anthropic.APIStatusError: {'type': 'error', 'error': {'details': None, 'type': 'overloaded_error', 'message': 'Overloaded'}}

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

Traceback (most recent call last):
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/llm/llm.py", line 177, in _main_task
    return await self._run()
           ^^^^^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/plugins/anthropic/llm.py", line 280, in _run
    raise APIStatusError(
livekit.agents._exceptions.APIStatusError: {'type': 'error', 'error': {'details': None, 'type': 'overloaded_error', 'message': 'Overloaded'}} (status_code=200, request_id=req_011CSFKChkfG9sgnn7PHE7qi, body={'type': 'error', 'error': {'details': None, 'type': 'overloaded_error', 'message': 'Overloaded'}}, retryable=True)
i just got this error message, never seen it before so unsure if this is a different issue as this makes the agent come back after ~10 seconds
f
i exp similar issue as i find that if my llm response with 200 but no valid delat content.
m
yeh i think this is the case @few-analyst-46
@few-analyst-46 are you using claude?
maybe this should be a noted as a bug?
r
I experience similar thing where LLM returned back the response tokens how ever the TTS never provided the speech. I was using Deepgram TTS model. In my case though I tried to investigate and found TTS API was rate_limiting the calls. The error thrown on console was weird, I found using Deepgram dashboard logs in cloud. May be you want to see similar for your provider.
m
Thanks a lot @rhythmic-printer-24192 i will take a lot
👍 1
f
my case is my own proxied openai compatible api
m
still facing issues- our team are struggling to find the issue here
r
What version are of libraries are you using?
pip freeze |grep livekit
m
Copy code
livekit==1.0.12
livekit-agents==1.2.5
livekit-api==1.0.5
livekit-blingfire==1.0.0
livekit-plugins-anthropic==1.2.5
livekit-plugins-assemblyai==1.2.5
livekit-plugins-cartesia==1.2.5
livekit-plugins-deepgram==1.2.5
livekit-plugins-elevenlabs==1.2.5
livekit-plugins-google==1.2.5
livekit-plugins-noise-cancellation==0.2.5
livekit-plugins-openai==1.2.5
livekit-plugins-silero==1.2.5
livekit-plugins-turn-detector==1.2.5
livekit-protocol==1.0.5
r
I am not quite sure how to reproduce this. Can you reproduce with https://github.com/livekit/agents/blob/main/examples/voice_agents/basic_agent.py and provide some steps I can use to cause the issue?
Do you have a session ID I can lookup for where this happend. It would start with something like
RM_
m
yeh i can share this- give me a moment
RM_aAWwPciyGQ9Y
@refined-appointment-81829
it happends near the end of the video, it sometimes happens in 1 minutes or not untill 8 minutes its very random- it just doesnt repsond, we think its actually and LLM, STT or TTS issue hard to narrow down but we know sometimes the STT stays alive as the transcript exported from livekit has "hello?" where we try get the agent back
i have been testing with openai:
Copy code
Error predicting end of turn
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 500, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/ipc/job_proc_lazy_main.py", line 101, in do_inference
    inf_resp = await fut
               ^^^^^^^^^
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/voice/audio_recognition.py", line 364, in _bounce_eou_task
    end_of_turn_probability = await turn_detector.predict_end_of_turn(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/plugins/turn_detector/base.py", line 229, in predict_end_of_turn
    result = await asyncio.wait_for(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 502, in wait_for
    raise exceptions.TimeoutError() from exc
its really delayed but its not cutting out now also seeing this error and
inference is slower than realtime
• TTS openai • LLM gpt-4o-mini