Skip to content

docs(fallback): add searchable Agent/Inference Fallback Adapter prefixes#1399

Closed
toubatbrian wants to merge 1 commit into
mainfrom
claude/quirky-galileo-HfQ8z
Closed

docs(fallback): add searchable Agent/Inference Fallback Adapter prefixes#1399
toubatbrian wants to merge 1 commit into
mainfrom
claude/quirky-galileo-HfQ8z

Conversation

@toubatbrian
Copy link
Copy Markdown
Contributor

Summary

Ports the docstring update from livekit/agents#5654 ("add comments to agent side and inference side fallback adapters") into agents-js. The Python PR adds searchable "Agent Fallback Adapter for X" and "Inference Fallback Adapter" prefixes to the relevant docstrings so the LiveKit docs team can deep-link to the correct piece of code (agent-side fallback vs. inference-side fallback) from user-facing documentation.

Files updated

Agent-side fallback adapters — added the "Agent Fallback Adapter for LLM/STT/TTS. Manages multiple X instances with automatic fallback when the primary provider fails." prefix:

  • agents/src/llm/fallback_adapter.tsFallbackAdapter class docstring
  • agents/src/stt/fallback_adapter.tsFallbackAdapter class docstring (preserved the existing detailed body about probe streams and StreamAdapter wrapping)
  • agents/src/tts/fallback_adapter.tsFallbackAdapter class docstring (preserved the existing Features list and example)

Inference-side fallback model configs — replaced the generic "A fallback model with optional extra configuration" comment with the searchable "Inference Fallback Adapter: configuration for a fallback STT/TTS model that runs server-side in LiveKit Inference, providing automatic fallback between providers." prefix:

  • agents/src/inference/stt.tsSTTFallbackModel interface
  • agents/src/inference/tts.tsTTSFallbackModel interface

Implementation notes / parity caveats

  • Interface vs. TypedDict. Python's FallbackModel is a TypedDict; the JS equivalent is a TS interface named STTFallbackModel / TTSFallbackModel (the TS files prefix the type with the modality to distinguish the STT and TTS variants). The doc text is the same; only the symbol it sits on differs.
  • Typo fixed during port. The Python diff says "Manages multiple STT instances" on both the LLM and TTS adapters (it's a copy-paste from the STT adapter wording in the original PR). The JS port substitutes the correct modality on each adapter ("Manages multiple LLM instances" / "Manages multiple TTS instances") since it's clearly unintentional rather than a language difference.
  • Existing JS docs are richer than Python's pre-PR text. The JS docstrings already documented behavior in detail (probe streams for STT recovery, Features list and @example block for TTS, etc.). Rather than overwriting that content with the shorter Python prefix, this PR prepends the searchable prefix to the first line and preserves the existing body so the published TSDoc keeps the additional context. This matches the spirit of the Python PR (make the code findable) without losing JS-specific documentation.

Changeset

@livekit/agents: patch.

Test plan

  • pnpm api:check passes (no exported types changed; only doc comments)
  • pnpm build passes
  • Visual diff confirms the new prefixes are present and the existing detailed docs are preserved

cc @toubatbrian @livekit/agent-devs

Ports livekit/agents#5654 from livekit/agents.


Generated by Claude Code

Mirror the docstring update from livekit/agents#5654 so the agent-side
fallback adapters (LLM/STT/TTS) and the inference-side FallbackModel
typed configs are easy to locate from the docs.

Ports livekit/agents#5654 from livekit/agents.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

🦋 Changeset detected

Latest commit: 249aa39

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 29 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@toubatbrian toubatbrian closed this May 6, 2026
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