i tried to use fallback for tts ``` tts_...
# ask-ai
b
i tried to use fallback for tts
Copy code
tts_config_priority_one = eleven_tts
    tts_config_priority_two = deepgram_tts_config

    tts_config_with_fallback = livekitAgentsSTT.FallbackAdapter(
        [
            tts_config_priority_one,
            tts_config_priority_two
        ]
    )

    session = AgentSession(
        vad=vadConfig,
        # any combination of STT, LLM, TTS, or realtime API can be used
        llm=openai.LLM(model="gpt-4o-mini"),
        stt=sttConfig,
        tts=tts_config_with_fallback,
with this code and getting this error
Copy code
2025-08-07 15:04:22,707 - ERROR livekit.agents - unhandled exception while running the job task
Traceback (most recent call last):
  File "/home/mohammedusamaahmed/usama1/Voice-Agents/voice-agents-repos/voice-agents-backend/src/main.py", line 324, in entrypointx
    await agentToRun.entrypoint(ctx)
  File "/home/mohammedusamaahmed/usama1/Voice-Agents/voice-agents-repos/voice-agents-backend/src/screening_assistant.py", line 976, in entrypoint
    tts_config_with_fallback = livekitAgentsSTT.FallbackAdapter(
  File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.10/site-packages/livekit/agents/stt/fallback_adapter.py", line 73, in __init__
    interim_results=all(t.capabilities.interim_results for t in stt),
  File "/home/mohammedusamaahmed/usama1/Voice-Agents/newLivekitVersion/1_0_21_newLivekitVersionVenv/lib/python3.10/site-packages/livekit/agents/stt/fallback_adapter.py", line 73, in <genexpr>
    interim_results=all(t.capabilities.interim_results for t in stt),
AttributeError: 'TTSCapabilities' object has no attribute 'interim_results' {"pid": 1756448, "job_id": "AJ_WTCM9Te5r99L"}
what ould be the possible reason
t
Thanks for reaching out, Mohammed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The error occurs because the FallbackAdapter for TTS is incorrectly trying to access the
interim_results
property, which is not part of the TTS
TTSCapabilities
interface. This property is specific to STT capabilities. To resolve this issue, ensure that the FallbackAdapter for TTS only uses the supported properties of
TTSCapabilities
, which are
streaming
and
aligned_transcript
. You can modify the initialization as follows:
Copy code
super().__init__(
    capabilities=TTSCapabilities(
        streaming=all(t.capabilities.streaming for t in tts),
        aligned_transcript=all(t.capabilities.aligned_transcript for t in tts),
    ),
    sample_rate=sample_rate,
    num_channels=num_channels,
)
This adjustment will prevent the
AttributeError
and ensure the FallbackAdapter works correctly for TTS.
b
i called STT instead of tts my bad
t
Hey there! It looks like the hiccup happened because STT was used instead of TTS in your code. If you want, I’m here to help you sort it out or tackle any other questions you might have—just give me a shout!