Skip to content

Conversation

@ftsef
Copy link

@ftsef ftsef commented Jan 20, 2026

Summary by CodeRabbit

  • New Features
    • Added configurable AssemblyAI streaming endpoints (US default or EU) for live transcription connections.
  • Documentation
    • Updated docs describing endpoint options and how to configure them during setup.

✏️ Tip: You can customize this high-level summary in your review settings.

@CLAassistant
Copy link

CLAassistant commented Jan 20, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

Adds a base_url parameter to STT and SpeechStream, stores it as _base_url, and uses it to build the AssemblyAI WebSocket connection instead of a hardcoded URL.

Changes

Cohort / File(s) Summary
AssemblyAI STT & SpeechStream
livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py
Added base_url parameter to STT.__init__ (default wss://streaming.assemblyai.com) and stored as _base_url. STT.stream() forwards base_url=self._base_url to SpeechStream. SpeechStream.__init__ now accepts/stores base_url, and _connect_ws() constructs the WebSocket URL from self._base_url instead of a hardcoded value.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant STT
    participant SpeechStream
    participant AssemblyAI_WS

    Client->>STT: request stream(start)
    STT->>SpeechStream: create stream(..., base_url)
    SpeechStream->>AssemblyAI_WS: open WebSocket at base_url
    SpeechStream->>AssemblyAI_WS: send audio frames
    AssemblyAI_WS-->>SpeechStream: deliver transcription events
    SpeechStream-->>STT: forward transcriptions
    STT-->>Client: emit transcription results
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 I hopped the nets from default to new,
A tiny URL to guide my view;
I weave the frames, connect with care,
Base_url leads me anywhere. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an option to configure the AssemblyAI EU streaming endpoint via the new base_url parameter.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 380d2df and 253899d.

📒 Files selected for processing (1)
  • livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Format code with ruff
Run ruff linter and auto-fix issues
Run mypy type checker in strict mode
Maintain line length of 100 characters maximum
Ensure Python 3.9+ compatibility
Use Google-style docstrings

Files:

  • livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py
🧬 Code graph analysis (1)
livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py (1)
livekit-agents/livekit/agents/utils/http_context.py (1)
  • http_session (40-51)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: type-check (3.13)
  • GitHub Check: unit-tests
  • GitHub Check: type-check (3.9)

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@longcw longcw left a comment

Choose a reason for hiding this comment

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

looks good to me! something nit

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
`@livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py`:
- Around line 80-86: The docstring for the parameter endpoint_url is incomplete;
update the parameter description (in the function/method docstring that includes
endpoint_url) to explicitly state the default endpoint, e.g. "Defaults to the US
endpoint (wss://streaming.assemblyai.com/v3/ws)." Ensure the sentence replaces
the dangling "Defaults to US" phrase and clearly names the default URL.
- Around line 359-365: The URL building currently concatenates
self._endpoint_url and a new query string which breaks if self._endpoint_url
already contains query params; instead parse self._endpoint_url (using
urllib.parse.urlparse), merge its existing query params (urllib.parse.parse_qs)
with the filtered_config dict (ensuring boolean -> "true"/"false" conversion
already in filtered_config), flatten/encode the combined params with
urllib.parse.urlencode(doseq=True), reconstruct the full URL with
urllib.parse.urlunparse, and then call await self._session.ws_connect(url,
headers=headers); update the logic around filtered_config, self._endpoint_url,
urlencode, and the ws_connect call to use the merged-safe URL.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between acabf18 and eba2714.

📒 Files selected for processing (1)
  • livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Format code with ruff
Run ruff linter and auto-fix issues
Run mypy type checker in strict mode
Maintain line length of 100 characters maximum
Ensure Python 3.9+ compatibility
Use Google-style docstrings

Files:

  • livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: type-check (3.9)
  • GitHub Check: unit-tests
  • GitHub Check: type-check (3.13)
🔇 Additional comments (2)
livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py (2)

95-156: Endpoint URL is correctly threaded into new streams.

This cleanly ensures all streams use the configured endpoint.


200-208: SpeechStream stores endpoint URL cleanly.

No concerns with the propagation pattern here.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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.

4 participants