Skip to content

add comments to agent side and inference side fallback adapters#5654

Merged
tmshapland merged 1 commit into
mainfrom
ts/fallback-adapter-comment-update
May 5, 2026
Merged

add comments to agent side and inference side fallback adapters#5654
tmshapland merged 1 commit into
mainfrom
ts/fallback-adapter-comment-update

Conversation

@tmshapland
Copy link
Copy Markdown
Contributor

We're updating the docs to describe how users can write model fallbacks on the LiveKit Agent side and on the LiveKit Inference side. We would like the comments to make it easy to find the code for the agent side fallback and the inference side fallback.

@tmshapland tmshapland requested a review from theomonnom May 5, 2026 23:03
@tmshapland tmshapland self-assigned this May 5, 2026
@chenghao-mou chenghao-mou requested a review from a team May 5, 2026 23:03
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment on lines +37 to +39
"""Agent Fallback Adapter for LLM. Manages multiple STT instances with automatic fallback
when the primary provider fails.
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 LLM FallbackAdapter docstring incorrectly says "STT instances" instead of "LLM instances"

The newly added class docstring for the LLM FallbackAdapter at livekit-agents/livekit/agents/llm/fallback_adapter.py:37 says "Manages multiple STT instances" but this class manages LLM instances (as seen from self._llm_instances and the llm: list[LLM] parameter). This is a copy-paste error from the STT fallback adapter docstring.

Suggested change
"""Agent Fallback Adapter for LLM. Manages multiple STT instances with automatic fallback
when the primary provider fails.
"""
"""Agent Fallback Adapter for LLM. Manages multiple LLM instances with automatic fallback
when the primary provider fails.
"""
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +49 to +50
"""Agent Fallback Adapter for TTS. Manages multiple STT instances with automatic fallback
when the primary provider fails.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 TTS FallbackAdapter docstring incorrectly says "STT instances" instead of "TTS instances"

The updated class docstring for the TTS FallbackAdapter at livekit-agents/livekit/agents/tts/fallback_adapter.py:49 says "Manages multiple STT instances" but this class manages TTS instances (as seen from self._tts_instances and the tts: list[TTS] parameter). This is a copy-paste error from the STT fallback adapter docstring.

Suggested change
"""Agent Fallback Adapter for TTS. Manages multiple STT instances with automatic fallback
when the primary provider fails.
"""Agent Fallback Adapter for TTS. Manages multiple TTS instances with automatic fallback
when the primary provider fails.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@tmshapland tmshapland merged commit d72a11c into main May 5, 2026
26 checks passed
@tmshapland tmshapland deleted the ts/fallback-adapter-comment-update branch May 5, 2026 23:08
Copy link
Copy Markdown
Contributor

This is an automated Claude Code Routine created by @toubatbrian. Right now it is in experimentation stage. The automation will start porting this PR into agents-js automatically.

The Python PR adds searchable "Agent Fallback Adapter" / "Inference Fallback Adapter" prefixes to the docstrings on the agent-side fallback adapters (LLM/STT/TTS) and the inference-side FallbackModel typed dicts so users can quickly locate the relevant code from docs. I'll mirror the same searchable prefixes onto the JS equivalents:

  • agents/src/llm/fallback_adapter.ts
  • agents/src/stt/fallback_adapter.ts
  • agents/src/tts/fallback_adapter.ts
  • agents/src/inference/stt.ts (STTFallbackModel)
  • agents/src/inference/tts.ts (TTSFallbackModel)

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants