Skip to content

feat(fishaudio): add realtime STT - #8357

Merged
tinalenguyen merged 2 commits into
livekit:mainfrom
cshape:cale/fishaudio-realtime-stt
Nov 4, 2026
Merged

tinalenguyen merged 2 commits into
livekit:mainfrom
cshape:cale/fishaudio-realtime-stt

Conversation

@cshape

@cshape cshape commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

summary

Adds fishaudio.STT: streaming STT on Fish Audio's realtime ASR (transcribe-stream-1). Reads FISH_API_KEY; no new dependencies.

from livekit.agents import AgentSession, TurnHandlingOptions
from livekit.plugins import fishaudio

session = AgentSession(stt=fishaudio.STT(), ...)  # LiveKit's turn detection
session = AgentSession(
    stt=fishaudio.STT(),
    turn_handling=TurnHandlingOptions(turn_detection="stt"),  # Fish Audio's
    ...
)
  • Works with LiveKit's VAD and turn detector: it declares manual_flush, so the session finalizes Fish Audio's turn when it ends the user's turn.
  • With turn_detection="stt", Fish Audio ends each turn. Its default auto mode ignores speech that isn't the user's (noise, other speakers); vad and manual modes are available too.
  • Interim, preflight (eager end of turn, on by default) and final transcripts, with word timings.
  • Keyterms, and the agent's replies as recognition context (chat_context).
  • Reconnects when the server restarts or a session reaches its maximum duration.
  • Streaming only. The language is detected automatically.

test plan

  • tests/test_plugin_fishaudio_stt.py (unit, fake WebSocket): 36 passed.
  • tests/test_stt.py --stt -k fishaudio: passed.
  • ruff and mypy clean.
  • Live voice sessions under LiveKit's audio and text turn detectors and turn_detection="stt".

If #8147 lands first, I'll port this to _run_connection_tasks.

Streams audio to Fish Audio's realtime ASR (transcribe-stream-1). Works
with LiveKit's turn detection, or with Fish Audio's own via
turn_detection="stt".
@cshape
cshape requested a review from a team as a code owner November 3, 2026 18:31

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

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.

Devin Review found 4 potential issues.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

…at max duration

- STT.aclose() closes its active streams.
- A session closed at its maximum duration (4413) reconnects even if it recognized nothing.
- Drop the local empty final on a flush with no open turn: it could end the session's
  wait before Fish Audio reported the speech. Document manual mode for push-to-talk.

@tinalenguyen tinalenguyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

tested and it lgtm!

@tinalenguyen
tinalenguyen merged commit a294f17 into livekit:main Nov 4, 2026
23 of 24 checks passed
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.

2 participants