Skip to content

Conversation

@Tushar-ml
Copy link
Contributor

@Tushar-ml Tushar-ml commented Dec 21, 2025

This is an integration PR of Simplismart's open source stt, tts and LLM models

Summary by CodeRabbit

  • New Features

    • Added Simplismart plugin providing Speech-to-Text and Text-to-Speech (including streaming/real-time) with support for multiple STT and TTS models and configurable options.
    • Configuration via SIMPLISMART_API_KEY environment variable.
  • Documentation

    • New README with installation and onboarding instructions.

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

@CLAassistant
Copy link

CLAassistant commented Dec 21, 2025

CLA assistant check
All committers have signed the CLA.

@Hormold
Copy link
Contributor

Hormold commented Dec 22, 2025

Hello and thanks for the PR! How can we test it? I checked your web app and can't find any TTS models or endpoints to test with.
I've had success with public big Whisper-v3, and it works pretty fast 💨

@Tushar-ml
Copy link
Contributor Author

sure @Hormold , we are releasing it by today, and let you know

@simplipratik
Copy link
Contributor

Hey @Hormold,
You can use this code snippet to test the integration. As @Tushar-ml said, Livekit compatible TTS models will be released on Simplismart platform today as well, if you'd prefer that.

Happy to help if you have any more questions.

Example code snippet:

from livekit.agents import (
    Agent,
    AgentSession,
    JobContext,
    RunContext,
    WorkerOptions,
    cli,
    function_tool,
)
from livekit.plugins import silero
from livekit.plugins import simplismart, openai
from dotenv import load_dotenv
import os

load_dotenv()

SIMPLISMART_API_KEY = os.getenv("SIMPLISMART_API_KEY")

@function_tool
async def lookup_weather(
    context: RunContext,
    location: str,
):
    """Used to look up weather information."""

    return {"weather": "sunny", "temperature": 70}


async def entrypoint(ctx: JobContext):
    await ctx.connect()

    agent = Agent(
        instructions="You are a friendly voice assistant built by LiveKit.",
    )
    session = AgentSession(
        vad=silero.VAD.load(),
        # any combination of STT, LLM, TTS, or realtime API can be used        
        stt=simplismart.STT(base_url="https://api.simplismart.live/predict", api_key=SIMPLISMART_API_KEY, model="openai/whisper-large-v3-turbo"),
        llm=openai.LLM(model="google/gemma-3-4b-it", api_key=SIMPLISMART_API_KEY, base_url="https://api.simplismart.live"),
        tts=simplismart.TTS(base_url="https://api.simplismart.live/tts", api_key=SIMPLISMART_API_KEY, model="Simplismart/orpheus-3b-0.1-ft"),
    )

    await session.start(agent=agent, room=ctx.room)


if __name__ == "__main__":
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))

@Hormold
Copy link
Contributor

Hormold commented Dec 23, 2025

I tested it, and the voice sounds pretty smooth! The LLM isn't working for me; it's stuck with Gemma (7b and 28b) and Llama (70b). It works, but it's very, very slow.

@simplipratik
Copy link
Contributor

simplipratik commented Dec 24, 2025

@Hormold Thanks for testing this out, glad to hear you liked the voice quality!

For the LLM latency, I’d recommend trying a smaller model like Gemma 3 4B (google/gemma-3-4b-it). Larger models can have higher TTFT, which is likely what you’re seeing. I’ll also dig deeper on our side to see if there’s anything we can further optimize.

In the meantime, if the STT and TTS components look good, could we go ahead and merge this PR?

Merry Christmas in advance 🎄

@dakshisdakshs
Copy link
Contributor

Happy New Year folks! 🎉

Just wanted to gently check in on this PR and see if there’s any update from your side @Hormold

Happy to dive in and iterate if there’s anything that can help speed things up. (Additional tests, docs or tweaks)

@simplipratik
Copy link
Contributor

Hey @Hormold,

I've fixed the formatting issue. Let me know if anything else is needed!

@tinalenguyen
Copy link
Member

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

Adds a new SimpliSmart LiveKit plugin providing Speech-to-Text (HTTP + WebSocket streaming) and Text-to-Speech (HTTP streaming) integrations, package metadata, versioning, logging, and docs; includes pydantic option models and comprehensive error handling.

Changes

Cohort / File(s) Summary
Plugin infra
livekit-plugins-simplismart/livekit/plugins/simplismart/__init__.py, livekit-plugins-simplismart/livekit/plugins/simplismart/log.py, livekit-plugins-simplismart/livekit/plugins/simplismart/version.py
Adds SimplismartPlugin and registers it at import, module logger, and version = "1.3.9".
Packaging / workspace
livekit-plugins-simplismart/pyproject.toml, pyproject.toml
New project pyproject for the plugin, dependencies, build config; registers plugin in workspace sources.
Type defs
livekit-plugins-simplismart/livekit/plugins/simplismart/models.py
Adds Literal type aliases TTSModels and STTModels for supported models.
STT implementation
livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py
Implements SimplismartSTTOptions (Pydantic), non-streaming HTTP recognition, streaming WebSocket SpeechStream, session management, chunking, transcript handling, and mapped API error types.
TTS implementation
livekit-plugins-simplismart/livekit/plugins/simplismart/tts.py
Implements SimplismartTTSOptions, TTS class with synthesize() returning ChunkedStream, HTTP streaming of PCM audio, and API error translation.
Documentation
livekit-plugins-simplismart/README.md
New README describing features, install, and environment setup (SIMPLISMART_API_KEY).

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant STT as STT Instance
    participant SpeechStream
    participant WebSocket as WS Conn
    participant SimplismartAPI as Simplismart API
    participant Emitter as Speech Event Emitter

    Client->>STT: stream(language, conn_options)
    STT->>SpeechStream: create SpeechStream
    Client->>SpeechStream: push_frame(audio)
    SpeechStream->>WebSocket: _connect_ws()
    WebSocket->>SimplismartAPI: open WS (Auth header)
    WebSocket-->>SpeechStream: connection established
    SpeechStream->>WebSocket: send_initial_config (model, language, VAD)
    loop audio loop
      Client->>SpeechStream: push_frame(chunk)
      SpeechStream->>WebSocket: send chunk (base64)
      SimplismartAPI-->>WebSocket: transcript message
      WebSocket->>SpeechStream: on_message
      SpeechStream->>Emitter: emit SpeechEvent (FINAL_TRANSCRIPT / partial)
    end
    Client->>SpeechStream: close
    WebSocket->>SimplismartAPI: close WS
Loading
sequenceDiagram
    participant Client
    participant TTS as TTS Instance
    participant ChunkedStream
    participant HTTP as HTTP Client
    participant SimplismartAPI as Simplismart API
    participant Emitter as Audio Emitter

    Client->>TTS: synthesize(text, conn_options)
    TTS->>ChunkedStream: create ChunkedStream
    Client->>ChunkedStream: run(output_emitter)
    ChunkedStream->>HTTP: POST /tts (Auth, payload)
    HTTP->>SimplismartAPI: send request
    loop stream audio
      SimplismartAPI-->>HTTP: audio chunk (PCM)
      HTTP->>Emitter: push(audio chunk)
    end
    HTTP->>Emitter: flush() / close
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • tinalenguyen

Poem

🐰 I hopped into code with a joyful heart,
STT and TTS now ready to start.
Chunks and webs, tokens in flight,
SimpliSmart sings through day and night.
Happy hopping—transcribe and delight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.92% 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 'Simplismart Integration in Livekit' accurately describes the main objective of the pull request, which adds comprehensive Simplismart STT, TTS, and LLM support to the LiveKit agents framework.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

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: 9

🤖 Fix all issues with AI agents
In
`@livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/models.py`:
- Around line 5-7: STTModels contains a concatenated string
"openai/whisper-large-v2openai/whisper-large-v3"; update the Literal for
STTModels to separate this into individual entries so it includes
"openai/whisper-large-v2", "openai/whisper-large-v3", and keep
"openai/whisper-large-v3-turbo" as a separate entry (i.e., adjust the STTModels
Literal values accordingly).

In
`@livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py`:
- Around line 283-295: Aiohttp ClientSession created as stream_session is never
closed; modify the SpeechStream implementation to own and close that session by
overriding its async cleanup (e.g., async def aclose or async def __aexit__) to
call await super().aclose() and then if the session attribute (e.g.,
self._session or the name used for http_session) exists and is not closed, await
session.close(); ensure the SpeechStream constructor stores the passed
http_session so the cleanup can reference it.
- Line 319: The field self._request_id in the class constructor is set to
id(self) (an int) but SpeechEvent.request_id must be a str; change the
assignment in the constructor (where self._request_id is set) to produce a
string — either cast the id to a string (str(id(self))) or, preferably, generate
a UUID string (e.g., str(uuid.uuid4())) and add the corresponding import; ensure
SpeechEvent.request_id is assigned this string value so types match.
- Around line 439-459: Annotate metrics with an explicit type (e.g., metrics:
dict[str, float] = {}) to satisfy mypy, and ensure SpeechData.language is always
a str by normalizing self._opts.language into a non-None value before
constructing speech_data (e.g., compute lang: str = self._opts.language or "" or
use typing.cast(str, self._opts.language) / validate and raise if None), then
pass that lang to SpeechData; reference symbols: metrics, request_data,
SpeechEvent/RecognitionUsage, self._event_ch.send_nowait, speech_data,
SpeechData, and self._opts.language.
- Around line 237-242: The code in stt.py reads start_time/end_time from
response_json["timestamps"] without checking for emptiness which can raise
IndexError for silent audio; update the block where detected_language,
start_time, end_time, request_id, text are set to first check if
response_json.get("timestamps") is a non-empty list and only then use
response_json["timestamps"][0][0] and response_json["timestamps"][-1][1],
otherwise set safe defaults (e.g., None or 0) for start_time/end_time; keep
request_id and text handling as-is but consider using
response_json.get("transcription", []) when joining to avoid errors if
transcription is missing.
- Around line 356-358: The raise of APIStatusError in the reconnection path
currently only passes message but the constructor requires status_code,
request_id, and body; update the raise in the reconnection block (where
APIStatusError is thrown to trigger a reconnection in the _run loop) to supply
those required arguments — e.g. set status_code (use 500 or the actual
HTTP/status code if available), request_id (use the current request/connection
id if available or None/empty string), and body (include a dict or string
containing the original message and any context) so the APIStatusError(...) call
includes all required parameters.
- Around line 280-284: The SimplismartSTTOptions class doesn't define a model
field but you're passing model=opts_model into its constructor (stream_opts =
SimplismartSTTOptions(...)); remove model from that call and instead store
opts_model on the SpeechStream instance (e.g., add a model attribute to the
SpeechStream initialization and use that when needed), or alternatively add a
model: str (or appropriate type) field to the SimplismartSTTOptions pydantic
model and update its definition; update any usage sites that expect the model
from stream_opts to read from the new SpeechStream.model (or from the added
SimplismartSTTOptions.model) to avoid the Pydantic validation error.
- Around line 202-206: The assignment to `language` is causing a mypy error
because `self._opts.language` is typed `str | None` while `language` expects
`str | NOT_GIVEN`; change the selection logic to only use `self._opts.language`
when the incoming `language` is actually given. Replace the current line that
sets `language = self._opts.language if isinstance(language, type(NOT_GIVEN))
else language` with a guard that checks whether `language` is given (use the
`is_given` helper from `livekit.agents.utils.misc` or equivalent), e.g., set
`language_to_use = language if is_given(language) else self._opts.language`, and
then use `language_to_use` (or cast appropriately) where `language` is needed so
mypy sees a `str | None` vs `NotGiven` distinction is respected.
- Line 40: The import line currently brings rtc via livekit.agents.utils which
isn't exported; update the import so rtc is imported directly from livekit
(e.g., replace "from livekit.agents.utils import AudioBuffer, rtc" with separate
imports: "from livekit.agents.utils import AudioBuffer" and "from livekit import
rtc") so AudioBuffer remains from livekit.agents.utils and rtc is sourced
directly from livekit as used elsewhere in the codebase.
🧹 Nitpick comments (2)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/tts.py (1)

6-6: Remove commented-out code.

The logger import is commented out but may be useful for debugging. Either uncomment and use it, or remove the comment entirely.

♻️ Proposed fix
-# from .log import logger
+from .log import logger

Then use logger for error logging in the except blocks in ChunkedStream._run.

livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (1)

68-68: Consider: max_tokens should likely be int, not float.

Token counts are typically integers. Using float here may be unintentional.

♻️ Proposed fix
-    max_tokens: float | None = 400
+    max_tokens: int | None = 400
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d774d26 and b109877.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py
  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py
  • livekit-plugins/livekit-plugins-simplismart/README.md
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/__init__.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/log.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/models.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/py.typed
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/tts.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/version.py
  • livekit-plugins/livekit-plugins-simplismart/pyproject.toml
  • pyproject.toml
🧰 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-openai/livekit/plugins/openai/models.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/__init__.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/version.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/log.py
  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/tts.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/models.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py
🧠 Learnings (4)
📚 Learning: 2026-01-18T01:08:55.648Z
Learnt from: davidzhao
Repo: livekit/agents PR: 4548
File: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/responses/llm.py:77-81
Timestamp: 2026-01-18T01:08:55.648Z
Learning: In the OpenAI responses LLM (`livekit-plugins-openai/livekit/plugins/openai/responses/llm.py`), reasoning effort defaults are intentionally set lower than OpenAI's API defaults for voice interactions: "none" for gpt-5.1/gpt-5.2 and "minimal" for other reasoning-capable models like gpt-5, to avoid enabling reasoning by default in voice contexts.

Applied to files:

  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py
  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py
📚 Learning: 2026-01-19T23:21:47.799Z
Learnt from: vishal-seshagiri-infinitusai
Repo: livekit/agents PR: 4559
File: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/responses/llm.py:122-123
Timestamp: 2026-01-19T23:21:47.799Z
Learning: Note from PR `#4559`: response_format was added as a passthrough to the OpenAI Responses API in livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/responses/llm.py, but this is scoped only to the Google provider and not for OpenAI. Reviewers should ensure that this passthrough behavior is gated by the provider (Google) and that OpenAI paths do not inadvertently reuse the same passthrough. Consider adding explicit provider checks, and update tests to verify that only the Google provider uses this passthrough while the OpenAI provider ignores it.

Applied to files:

  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py
  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py
📚 Learning: 2026-01-16T07:44:56.353Z
Learnt from: CR
Repo: livekit/agents PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-16T07:44:56.353Z
Learning: Follow the Plugin System pattern where plugins in livekit-plugins/ are separate packages registered via the Plugin base class

Applied to files:

  • pyproject.toml
📚 Learning: 2026-01-16T07:44:56.353Z
Learnt from: CR
Repo: livekit/agents PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-16T07:44:56.353Z
Learning: Implement Model Interface Pattern for STT, TTS, LLM, and Realtime models with provider-agnostic interfaces, fallback adapters for resilience, and stream adapters for different streaming patterns

Applied to files:

  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/models.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py
🧬 Code graph analysis (2)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/__init__.py (3)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (1)
  • STT (75-296)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/tts.py (1)
  • TTS (31-95)
livekit-agents/livekit/agents/plugin.py (2)
  • Plugin (13-56)
  • register_plugin (31-36)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (6)
livekit-agents/livekit/agents/_exceptions.py (3)
  • APIConnectionError (84-88)
  • APIStatusError (45-81)
  • APITimeoutError (91-95)
livekit-agents/livekit/agents/types.py (1)
  • APIConnectOptions (54-88)
livekit-agents/livekit/agents/utils/http_context.py (1)
  • http_session (40-51)
livekit-agents/livekit/agents/stt/stt.py (5)
  • STTCapabilities (78-82)
  • SpeechEvent (70-74)
  • SpeechData (53-61)
  • SpeechEventType (32-49)
  • RecognitionUsage (65-66)
livekit-agents/livekit/agents/utils/log.py (1)
  • log_exceptions (9-41)
livekit-agents/livekit/agents/utils/audio.py (1)
  • AudioByteStream (41-157)
🪛 GitHub Actions: CI
livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py

[error] 1-1: Ruff formatting check failed. 1 file would be reformatted by 'ruff format --check'.

livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py

[error] 40-40: Module "livekit.agents.utils" does not explicitly export attribute "rtc". [attr-defined]


[error] 205-205: Incompatible types in assignment (expression has type "str | NotGiven | None", variable has type "str | NotGiven"). [assignment]


[error] 441-441: Need type annotation for "metrics" (hint: "metrics: dict[, ] = ..."). [var-annotated]


[error] 457-457: Argument "language" to "SpeechData" has incompatible type "str | None"; expected "str". [arg-type]


[error] 464-464: Argument "request_id" to "SpeechEvent" has incompatible type "int"; expected "str". [arg-type]

🔇 Additional comments (14)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/version.py (1)

1-15: Version constant looks good.
Clear, minimal module for dynamic versioning.

livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/log.py (1)

1-3: LGTM for centralized logger.
Simple and appropriate module-level logger definition.

pyproject.toml (1)

43-43: Workspace entry addition looks good.
No concerns with the new uv source entry.

livekit-plugins/livekit-plugins-simplismart/README.md (1)

1-18: Docs look clear and concise.
Feature overview and setup steps are easy to follow.

livekit-plugins/livekit-plugins-simplismart/pyproject.toml (1)

1-39: Packaging metadata/config looks solid.
No concerns with the Hatch setup or project metadata.

livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py (1)

293-318: Fix ruff-format CI failure by adding trailing comma.
The SimplismartChatModels list is missing a trailing comma on the last element. Add a trailing comma after "Qwen/Qwen3-14B" to satisfy ruff format.

🛠️ Required fix
-    "Qwen/Qwen3-14B"
+    "Qwen/Qwen3-14B",
]
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/models.py (1)

1-3: LGTM!

The TTSModels type alias is correctly defined with proper Literal syntax.

livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/__init__.py (2)

36-41: LGTM!

The plugin class follows the standard LiveKit plugin registration pattern correctly, passing the required arguments to the parent Plugin class.


24-28: LGTM!

The public exports are well-defined and the documentation cleanup pattern is consistent with other LiveKit plugins.

livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py (2)

879-921: LGTM!

The with_simplismart static constructor follows the established pattern used by other provider integrations (Cerebras, Fireworks, DeepSeek, etc.). API key validation, environment variable fallback, and parameter propagation are all correctly implemented.


50-50: LGTM!

The SimplismartChatModels import is correctly added to the existing model imports.

livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/tts.py (2)

31-75: LGTM!

The TTS class is well-structured with proper API key validation, session management, and configuration options. The Pydantic model SimplismartTTSOptions cleanly encapsulates the generation parameters.


98-143: LGTM!

The ChunkedStream implementation correctly handles streaming audio synthesis with proper initialization, chunk processing, and error translation. The emitter lifecycle (initialize → push → flush) is correctly implemented.

livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (1)

75-149: LGTM on STT class structure.

The STT class is well-designed with comprehensive parameter documentation, proper capability declaration, and support for both streaming and non-streaming modes. The URL transformation for WebSocket streaming (line 141) is a clean approach.

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

dakshisdakshs and others added 3 commits January 21, 2026 01:22
…mplismart/models.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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-simplismart/livekit/plugins/simplismart/stt.py`:
- Around line 228-234: The APIStatusError raised in the error branch uses only
message and status_code but the exception requires request_id and body as well;
update the raise to include request_id (e.g. extract from
res.headers.get("x-request-id")) and body (use the error_text already read) so
the call to APIStatusError includes message, status_code, request_id, and body;
refer to the symbols APIStatusError, res, logger and reuse error_text for the
body field.
- Around line 236-245: The code reads detected_language with
response_json["info"]["language"] which can raise KeyError; change it to safely
access nested keys using response_json.get("info", {}).get("language", "") (or
None) so missing or malformed responses don't crash; update any downstream uses
of detected_language to handle the default value and keep
request_id/text/timestamps handling consistent with the existing .get() patterns
(refer to the response_json variable and the detected_language identifier in
this block).
🧹 Nitpick comments (3)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (3)

271-298: Unused model and **kwargs parameters.

The model parameter (line 275) is accepted but never used—it's not passed to SimplismartSTTOptions or stored on the stream. Similarly, **kwargs (line 277) is captured but discarded.

Either remove these parameters or implement their intended behavior.

♻️ Option 1: Remove unused parameters
     def stream(
         self,
         *,
         language: NotGivenOr[str] = NOT_GIVEN,
-        model: NotGivenOr[STTModels | str] = NOT_GIVEN,
         conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS,
-        **kwargs: Any,
     ) -> "SpeechStream":
♻️ Option 2: Use model parameter
     def stream(
         self,
         *,
         language: NotGivenOr[str] = NOT_GIVEN,
         model: NotGivenOr[STTModels | str] = NOT_GIVEN,
         conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS,
-        **kwargs: Any,
     ) -> "SpeechStream":
         """Create a streaming transcription session."""
         opts_language = language if is_given(language) else self._opts.language
+        opts_model = model if is_given(model) else self._model

         # Create options for the stream
         stream_opts = SimplismartSTTOptions(language=opts_language)
+        
+        # Store model for use in stream
+        stream_model = opts_model

451-465: Usage metrics are placeholders with hardcoded zero values.

The metrics dict is always empty, resulting in audio_duration and processing_latency always being 0.0. Additionally, request_id for the usage event is json.dumps(request_data), which embeds redundant data.

If the Simplismart API provides actual metrics in the response, consider parsing and using them. Otherwise, consider whether emitting a RECOGNITION_USAGE event with dummy data provides value.


261-269: Consider using % formatting in logger calls for lazy evaluation.

Several logger calls use f-strings (lines 230, 262, 265, 268, 440, 493). Using %-style formatting defers string interpolation until the log level check passes.

♻️ Example refactor
-            logger.error(f"Simplismart API timeout: {e}")
+            logger.error("Simplismart API timeout: %s", e)
             raise APITimeoutError("Simplismart API request timed out") from e
         except aiohttp.ClientError as e:
-            logger.error(f"Simplismart API client error: {e}")
+            logger.error("Simplismart API client error: %s", e)
             raise APIConnectionError(f"Simplismart API connection error: {e}") from e
         except Exception as e:
-            logger.error(f"Error during Simplismart STT processing: {e}")
+            logger.error("Error during Simplismart STT processing: %s", e)
             raise APIConnectionError(f"Unexpected error in Simplismart STT: {e}") from e
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c51452c and e15006f.

📒 Files selected for processing (2)
  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.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-simplismart/livekit/plugins/simplismart/stt.py
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: livekit/agents PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-16T07:44:56.353Z
Learning: Implement Model Interface Pattern for STT, TTS, LLM, and Realtime models with provider-agnostic interfaces, fallback adapters for resilience, and stream adapters for different streaming patterns
📚 Learning: 2026-01-16T07:44:56.353Z
Learnt from: CR
Repo: livekit/agents PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-16T07:44:56.353Z
Learning: Implement Model Interface Pattern for STT, TTS, LLM, and Realtime models with provider-agnostic interfaces, fallback adapters for resilience, and stream adapters for different streaming patterns

Applied to files:

  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/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.13)
  • GitHub Check: type-check (3.9)
  • GitHub Check: unit-tests
🔇 Additional comments (6)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (6)

15-47: LGTM!

Imports are well-organized and the rtc import issue from previous reviews has been correctly addressed by importing directly from livekit.


50-73: LGTM!

The SimplismartSTTOptions Pydantic model is well-structured with appropriate defaults for VAD, speech boundaries, and decoding parameters.


76-184: LGTM!

The constructor is well-documented with comprehensive parameter descriptions. The API key validation, streaming URL transformation, and use of WeakSet for stream management are all appropriate patterns.


301-322: LGTM!

The SpeechStream class initialization properly stores configuration, converts request_id to string, and sets up the reconnection event. The resource leak issue from previous reviews has been addressed with the aclose method.


324-409: LGTM!

The _run method implements a robust streaming pattern with proper task management, reconnection handling, and graceful cancellation. The tasks_group.exception() call correctly suppresses the "exception was never retrieved" warning.


424-427: LGTM!

The aclose method properly cleans up the ClientSession resource, addressing the resource leak concern from previous reviews.

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

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-simplismart/livekit/plugins/simplismart/stt.py`:
- Around line 264-272: The catch‑all except in the STT request handling is
currently catching APIStatusError and losing its status/body context; add an
explicit except APIStatusError as e: raise to re-raise it unchanged before the
general except Exception block so APIStatusError from the Simplismart STT flow
is preserved (keep the existing except asyncio.TimeoutError, except
aiohttp.ClientError, and except Exception handlers intact and immediately place
the except APIStatusError handler above except Exception).
- Around line 350-409: The reconnect logic never observes a reconnect trigger
and may crash on CancelledError; modify recv_task/send_task so that when the
websocket closes unexpectedly or they need a reconnect they call
self._reconnect_event.set() (refer to recv_task, send_task, and where
APIStatusError is raised), change the wait to await asyncio.wait on the
individual task handles plus wait_reconnect_task (i.e. use the list [send_task,
recv_task, wait_reconnect_task] rather than waiting on tasks_group), and remove
the unconditional tasks_group.exception() call—instead iterate over completed
tasks and call task.result() re-raising only non-CancelledError exceptions
(ignore CancelledError) before deciding to break or continue the outer loop;
keep gracefully_cancel(...) to cancel outstanding work in finally.
♻️ Duplicate comments (1)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (1)

274-299: stream() accepts model but never uses it (caller choice is ignored).

This is a behavioral mismatch: callers can pass model but it has no effect in streaming. Either remove the parameter or wire it through to the WS config.

🛠️ Proposed fix (wire model into the stream)
     def stream(
         self,
         *,
         language: NotGivenOr[str] = NOT_GIVEN,
         model: NotGivenOr[STTModels | str] = NOT_GIVEN,
         conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS,
         **kwargs: Any,
     ) -> "SpeechStream":
         """Create a streaming transcription session."""
         opts_language = language if is_given(language) else self._opts.language
+        opts_model = model if is_given(model) else self._model

         # Create options for the stream
         stream_opts = SimplismartSTTOptions(language=opts_language)

         # Create a fresh session for this stream to avoid conflicts
         stream_session = aiohttp.ClientSession()
@@
         stream = SpeechStream(
             stt=self,
             opts=stream_opts,
             conn_options=conn_options,
             api_key=self._api_key,
             http_session=stream_session,
+            model=opts_model,
         )
 class SpeechStream(stt.SpeechStream):
@@
     def __init__(
         self,
         *,
         stt: STT,
         opts: SimplismartSTTOptions,
         conn_options: APIConnectOptions,
         api_key: str,
         http_session: aiohttp.ClientSession,
+        model: STTModels | str,
     ) -> None:
         self._opts = opts
         super().__init__(stt=stt, conn_options=conn_options, sample_rate=self._SAMPLE_RATE)
         self._api_key = api_key
         self._session = http_session
         self._reconnect_event = asyncio.Event()
         self._request_id = str(id(self))
         self.ws_url = stt._base_url
+        self._model = model
     async def _send_initial_config(self, ws: aiohttp.ClientWebSocketResponse) -> None:
         """Send initial configuration message with language for Simplismart models."""
         try:
-            config_message = {"language": self._opts.language}
+            config_message = {"language": self._opts.language, "model": self._model}
             await ws.send_json(config_message)
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e15006f and 26eb3ef.

📒 Files selected for processing (1)
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/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-simplismart/livekit/plugins/simplismart/stt.py
🧠 Learnings (1)
📚 Learning: 2026-01-16T07:44:56.353Z
Learnt from: CR
Repo: livekit/agents PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-16T07:44:56.353Z
Learning: Implement Model Interface Pattern for STT, TTS, LLM, and Realtime models with provider-agnostic interfaces, fallback adapters for resilience, and stream adapters for different streaming patterns

Applied to files:

  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/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: unit-tests
  • GitHub Check: type-check (3.13)
  • GitHub Check: type-check (3.9)

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

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: 1

🤖 Fix all issues with AI agents
In
`@livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py`:
- Around line 143-145: Update the docstring for the Simplismart STT initializer
(constructor for the class or function that accepts base_url, streaming,
api_key, and http_session) to add entries for base_url, streaming, api_key, and
http_session in the Args section describing types, default values, and behavior;
also resolve the inconsistency about streaming by either removing the streaming
parameter or explicitly documenting its current unsupported status and intended
future behavior (e.g., "streaming: bool, optional — whether to use websocket
streaming; currently not publicly available, parameter accepted but will
raise/behave as X until enabled"), and ensure any code that builds the websocket
URL (the conditional branch using base_url and urlparse in the constructor) is
referenced in the docstring so callers understand how base_url is interpreted.
♻️ Duplicate comments (1)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (1)

52-76: Add docstrings to SimplismartSTTOptions class.

The class lacks documentation explaining each parameter's purpose and valid values. This was previously requested for generated docs and user clarity.

📝 Suggested documentation
 class SimplismartSTTOptions(BaseModel):
+    """Configuration options for SimpliSmart STT requests.
+    
+    Attributes:
+        language: Language code for transcription (e.g., "en", "es").
+        task: Operation to perform - "transcribe" or "translate".
+        without_timestamps: If True, disables timestamp generation.
+        vad_model: Voice Activity Detection model ("silero" or "frame").
+        vad_filter: Whether to apply VAD filtering to input audio.
+        vad_onset: VAD onset threshold in seconds.
+        vad_offset: VAD offset threshold in seconds.
+        min_speech_duration_ms: Minimum speech segment duration in milliseconds.
+        max_speech_duration_s: Maximum speech segment duration in seconds.
+        min_silence_duration_ms: Minimum silence to split speech segments.
+        speech_pad_ms: Padding added to speech boundaries in milliseconds.
+        initial_prompt: Optional prompt for contextual biasing.
+        hotwords: Comma-separated hotwords to bias recognition.
+        num_speakers: Number of speakers for diarization (0 to disable).
+        compression_ratio_threshold: Threshold for output compression ratio.
+        beam_size: Beam size for decoder search.
+        temperature: Decoding temperature (0.0 for deterministic).
+        multilingual: Enable multilingual recognition.
+        max_tokens: Maximum output tokens.
+        log_prob_threshold: Log probability threshold for word filtering.
+        length_penalty: Penalty for longer transcriptions.
+        repetition_penalty: Penalty for repeated words.
+        strict_hallucination_reduction: Enable strict hallucination filtering.
+    """
     language: str | None = None
🧹 Nitpick comments (7)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (7)

15-18: Module docstring is minimal.

The module docstring could be expanded to include usage examples, configuration notes, and links to SimpliSmart documentation, which would help with generated docs. Consider adding details about streaming vs non-streaming modes and key configuration options.


111-142: Docstring is missing several constructor parameters.

The docstring documents most options but is missing: base_url, api_key, streaming, and http_session. These are important for users who need to configure custom deployments or manage sessions.

📝 Suggested additions to docstring
         """
         Configuration options for the SimpliSmart STT (Speech-to-Text) engine.

         Note:
             Streaming transcription is not publicly available at this time.

         Args:
+            base_url (str): API endpoint URL (default: SIMPLISMART_BASE_URL).
+            api_key (str | None): API key for authentication. Falls back to SIMPLISMART_API_KEY env var.
+            streaming (bool): Enable WebSocket streaming mode (default: False).
             language (str): Language code for transcription (default: "en").
             ...
+            http_session (aiohttp.ClientSession | None): Optional pre-configured HTTP session.
         """

274-276: Logger already captures traceback; format_exc() is redundant.

Using traceback.format_exc() in the log message is redundant. Consider using exc_info=True for cleaner logging, or keep the current approach if you prefer inline tracebacks.

♻️ Optional refactor
         except Exception as e:
-            logger.error(f"Error during Simplismart STT processing: {traceback.format_exc()}")
+            logger.error(f"Error during Simplismart STT processing: {e}", exc_info=True)
             raise APIConnectionError(f"Unexpected error in Simplismart STT: {e}") from e

432-447: Initial config only sends language parameter.

The _send_initial_config method only sends language in the config message. If the WebSocket endpoint supports additional configuration (model, VAD settings, etc.), consider forwarding them here for consistency with the batch API.


454-467: Usage event has placeholder metrics with no actual data.

The metrics dict is always empty, so audio_duration is always 0.0 and processing_latency is always 0.0. If the SimpliSmart WebSocket doesn't provide these metrics, consider removing the usage event emission, or populate it with calculated values (e.g., track audio duration from sent frames).

♻️ Option: Calculate audio duration from input

Track the total bytes sent in send_task and calculate duration:

# In SpeechStream.__init__
self._audio_bytes_sent = 0

# In send_task, after sending:
self._audio_bytes_sent += len(frame.data)

# In _handle_transcript_data:
audio_duration = self._audio_bytes_sent / (self._SAMPLE_RATE * 2)  # 16-bit = 2 bytes/sample

461-463: Unusual request_id format in usage event.

The usage event's request_id is set to json.dumps(request_data), which embeds a JSON object as the ID string. This is inconsistent with typical usage where request_id is a simple identifier. Consider using self._request_id directly for consistency with the speech_event.

♻️ Proposed fix
             usage_event = stt.SpeechEvent(
                 type=stt.SpeechEventType.RECOGNITION_USAGE,
-                request_id=json.dumps(request_data),
+                request_id=request_id,
                 recognition_usage=stt.RecognitionUsage(
                     audio_duration=metrics.get("audio_duration", 0.0),
                 ),
             )

484-492: Logging confidence that is always zero is misleading.

The debug log includes confidence in the extras, but speech_data.confidence is always 0.0 (the default). Either remove this from the log, or add a comment explaining that SimpliSmart doesn't return confidence scores.

♻️ Suggested fix
             logger.debug(
                 "Transcript processed successfully",
                 extra={
                     "request_id": self._request_id,
                     "text_length": len(transcript_text),
                     "language": self._opts.language,
-                    "confidence": speech_data.confidence,
                 },
             )
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 161e711 and 8a79150.

📒 Files selected for processing (1)
  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/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-simplismart/livekit/plugins/simplismart/stt.py
🧠 Learnings (1)
📚 Learning: 2026-01-16T07:44:56.353Z
Learnt from: CR
Repo: livekit/agents PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-16T07:44:56.353Z
Learning: Implement Model Interface Pattern for STT, TTS, LLM, and Realtime models with provider-agnostic interfaces, fallback adapters for resilience, and stream adapters for different streaming patterns

Applied to files:

  • livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py
🧬 Code graph analysis (1)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (4)
livekit-agents/livekit/agents/_exceptions.py (3)
  • APIConnectionError (84-88)
  • APIStatusError (45-81)
  • APITimeoutError (91-95)
livekit-agents/livekit/agents/utils/http_context.py (1)
  • http_session (40-51)
livekit-agents/livekit/agents/stt/stt.py (5)
  • STTCapabilities (78-82)
  • SpeechEvent (70-74)
  • SpeechData (53-61)
  • SpeechEventType (32-49)
  • RecognitionUsage (65-66)
livekit-agents/livekit/agents/utils/log.py (1)
  • log_exceptions (9-41)
⏰ 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: type-check (3.9)
  • GitHub Check: unit-tests
🔇 Additional comments (7)
livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py (7)

188-199: LGTM!

Properties are correctly implemented. The _ensure_session pattern properly uses the http_context.http_session() fallback, consistent with other LiveKit plugins.


252-259: SpeechData created without confidence value.

The SpeechData is created without setting confidence, which defaults to 0.0. This is appropriate since the SimpliSmart API response doesn't appear to return confidence scores. Good adherence to the guidance of not hardcoding confidence values.


307-328: LGTM!

The SpeechStream initialization correctly stores the session for cleanup, uses str(id(self)) for the request ID (addressing the previous type mismatch), and properly calculates chunk sizes for 50ms audio at 16kHz.


380-412: Reconnection and cleanup logic is well-structured.

The reconnection logic properly uses _reconnect_event.set() to trigger reconnects, handles task exceptions, and uses contextlib.suppress(asyncio.CancelledError) for cleanup. The WebSocket is properly closed in the finally block. This addresses previous review concerns.


427-430: Session cleanup is properly implemented.

The aclose method correctly calls super().aclose() and closes the HTTP session if it exists and isn't already closed. This addresses the previous resource leak concern.


288-289: Document that streaming intentionally uses limited options due to non-public API status.

Streaming options only include language because the SimpliSmart streaming WebSocket endpoint is not publicly available (as documented in line 115: "Streaming transcription is not publicly available at this time"). This intentional limitation aligns with the experimental nature of the streaming feature. If the endpoint is later made public with full parameter support, update _send_initial_config() to pass additional options from self._opts.


373-376: No issue. The SimpliSmart WebSocket API sends plain text transcripts in BINARY messages, not JSON. The code correctly decodes the message as UTF-8 text and passes it to _handle_transcript_data, which treats it as plain transcript text. This is distinct from the SimpliSmart HTTP API, which uses JSON-structured responses with fields like timestamps, transcription, and request_id.

Likely an incorrect or invalid review comment.

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

Comment on lines +143 to +145
if streaming:
base_url = f"wss://{urlparse(base_url).netloc}/ws/audio"

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

SimpliSmart STT WebSocket endpoint API documentation

💡 Result:

I couldn't find a dedicated SimpliSmart STT WebSocket endpoint document — here are the closest official docs/pages that describe SimpliSmart realtime/streaming and STT usage:

  • SimpliSmart API reference / overview (API keys, authentication, inference APIs). [1]
  • Quickstart / Inference guide (calling inference endpoints; OpenAI‑compatible usage). [2]
  • LiveKit integration guide (mentions real‑time STT and the STT REST endpoint https://api.simplismart.live/predict). This is the closest page referencing realtime/STT integration. [3]

If you want, I can:

  • keep searching for a specific WebSocket STT page (I can broaden to forums/GitHub), or
  • open those pages and extract the exact connection/auth examples for you. Which do you prefer?

Sources:
[1] https://docs.simplismart.ai/api-reference/introduction
[2] https://docs.simplismart.ai/quickstart/inference
[3] https://docs.simplismart.ai/guides/livekit


🏁 Script executed:

# Examine the file context around the URL conversion
cd livekit-plugins/livekit-plugins-simplismart || cd .
cat -n livekit/plugins/simplismart/stt.py | head -200 | tail -100

Repository: livekit/agents

Length of output: 5406


🏁 Script executed:

# Search for any test files or examples that might show correct endpoint format
find . -type f -name "*.py" | xargs grep -l "simplismart" | head -10

Repository: livekit/agents

Length of output: 386


🏁 Script executed:

# Look for test files or examples
find . -path "*/simplismart*" -type f \( -name "*test*" -o -name "*example*" \) -o -name "*.md"

Repository: livekit/agents

Length of output: 3549


🏁 Script executed:

# Search for any comments or context around streaming URLs in the codebase
rg -i "websocket|ws://" --type py -B3 -A3

Repository: livekit/agents

Length of output: 50371


🏁 Script executed:

# Check if base_url is typically constructed with paths
rg "base_url" livekit-plugins/livekit-plugins-simplismart/ --type py -B2 -A2

Repository: livekit/agents

Length of output: 4469


🏁 Script executed:

# Find the SIMPLISMART_BASE_URL definition
rg "SIMPLISMART_BASE_URL" livekit-plugins/livekit-plugins-simplismart/ --type py -B2 -A2

Repository: livekit/agents

Length of output: 2137


🏁 Script executed:

# Check the full STT init signature to understand parameters
sed -n '78,145p' livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py

Repository: livekit/agents

Length of output: 3666


Add missing parameter documentation to the docstring.

The base_url, streaming, api_key, and http_session parameters are not documented in the Args section of the docstring. Additionally, the docstring states "Streaming transcription is not publicly available at this time," yet streaming is exposed as a constructor parameter—this inconsistency should be clarified (either remove the parameter for now or document its intended behavior).

🤖 Prompt for AI Agents
In
`@livekit-plugins/livekit-plugins-simplismart/livekit/plugins/simplismart/stt.py`
around lines 143 - 145, Update the docstring for the Simplismart STT initializer
(constructor for the class or function that accepts base_url, streaming,
api_key, and http_session) to add entries for base_url, streaming, api_key, and
http_session in the Args section describing types, default values, and behavior;
also resolve the inconsistency about streaming by either removing the streaming
parameter or explicitly documenting its current unsupported status and intended
future behavior (e.g., "streaming: bool, optional — whether to use websocket
streaming; currently not publicly available, parameter accepted but will
raise/behave as X until enabled"), and ensure any code that builds the websocket
URL (the conditional branch using base_url and urlparse in the constructor) is
referenced in the docstring so callers understand how base_url is interpreted.

@tinalenguyen tinalenguyen merged commit 831c295 into livekit:main Jan 21, 2026
10 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jan 21, 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.

7 participants