Skip to content

[Flutter SDK] Add configuration validation for LLM, STT, and TTS (#450)#456

Open
DevDesai444 wants to merge 13 commits intoRunanywhereAI:mainfrom
DevDesai444:configValidation#450
Open

[Flutter SDK] Add configuration validation for LLM, STT, and TTS (#450)#456
DevDesai444 wants to merge 13 commits intoRunanywhereAI:mainfrom
DevDesai444:configValidation#450

Conversation

@DevDesai444
Copy link
Copy Markdown

@DevDesai444 DevDesai444 commented Mar 15, 2026

Summary

Fixes #450 by adding the missing Flutter-side configuration validation for LLM, STT, and TTS before invalid values cross the FFI boundary into the native C++ layer.

Flutter already validated VAD, but LLM and STT configuration models were missing and TTS had no validate() implementation. This PR brings Flutter behavior closer to Swift/Kotlin parity for these components.

Problem

Today, invalid Flutter configuration values can reach native code without a Dart-level error.

Examples:

  • negative LLM temperature
  • zero or invalid max token counts
  • invalid STT sample rates
  • invalid TTS speaking rate, pitch, or volume

Swift and Kotlin already reject these values earlier. Flutter did not.

Changes

Added missing Flutter configuration models

  • Added LLMConfiguration
  • Added STTConfiguration

Added missing validation

  • Implemented validate() for TTSConfiguration

Enforced validation before native calls

  • Validate LLM generation parameters before generate() / generateStream() hit FFI
  • Validate STT settings before transcription
  • Validate TTS settings before synthesis

Exported config types publicly

  • Exported LLM/STT/TTS configuration types from the package root

Preserved validation errors at the public API layer

  • Updated RunAnywhere.generate() so SDKError.validationFailed(...) is rethrown instead of being masked as a generic generation failure

Files touched

  • sdk/runanywhere-flutter/packages/runanywhere/lib/features/llm/llm_configuration.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/features/stt/stt_configuration.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/system_tts_service.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_llm.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_stt.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_tts.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart

Expected behavior after this PR

Invalid values now fail in Dart first with clear validation errors, for example:

  • Temperature must be between 0 and 2.0
  • Max tokens must be between 1 and context length
  • Sample rate must be between 1 and 48000 Hz
  • Speaking rate must be between 0.5 and 2.0

Notes

  • This keeps the current Flutter public API shape intact and adds validation at the configuration/bridge boundary.
  • VAD behavior is unchanged.
  • This PR focuses on validation parity and does not add new public runtime features beyond the missing config models.

Testing

  • Verified the patch structure and git diff cleanliness locally
  • I was not able to run dart format, dart analyze, or Flutter tests in this shell because dart/flutter were not available on PATH

Summary by CodeRabbit

  • New Features

    • Added public configuration objects for LLM, STT, and TTS with validation and defaults.
    • Exposed these configurations in the public SDK API.
  • Improvements

    • Generation and streaming now respect and carry model context-length metadata end-to-end.
    • Runtime parameter validation is applied before operations to catch invalid inputs early.
  • Bug Fixes

    • Improved error propagation for validation failures during transcription, synthesis, and generation.

Greptile Summary

This PR adds Dart-side configuration validation for LLM, STT, and TTS components in the Flutter SDK, bringing it to parity with the Swift and Kotlin SDKs. Invalid parameters (e.g., negative temperature, out-of-range sample rates) now fail with clear SDKError.validationFailed messages before crossing the FFI boundary into C++.

  • Added LLMConfiguration and STTConfiguration models implementing ComponentConfiguration with validate() methods matching Swift/Kotlin ranges
  • Added validate() implementation to the existing TTSConfiguration class (speakingRate, pitch, volume)
  • Wired validation calls into DartBridgeLLM.generate(), DartBridgeLLM.generateStream(), DartBridgeSTT.transcribe(), and DartBridgeTTS.synthesize() before FFI calls
  • Fixed RunAnywhere.generate() to rethrow SDKError instead of masking it as a generic generation failure
  • Exported new configuration types from the package root barrel file
  • Note: The LLM bridge hardcodes contextLength: 32768 when validating, which means the maxTokens <= contextLength check will always pass for values under 32768 regardless of the actual model's context window — this weakens the intended protection

Confidence Score: 4/5

  • This PR is safe to merge — it adds defensive validation that improves robustness without changing existing behavior for valid inputs.
  • The validation ranges match Swift/Kotlin parity exactly. The code is clean and follows the existing VADConfiguration pattern. One concern is the hardcoded contextLength=32768 in LLM validation which weakens the maxTokens upper-bound check, but this is a design limitation rather than a regression — invalid values that previously crossed FFI unchecked will still be caught for clearly invalid ranges (negative, zero, NaN/Infinity). No tests were run due to environment constraints.
  • Pay close attention to dart_bridge_llm.dart — the hardcoded contextLength: 32768 in _validateGenerationParameters makes the maxTokens <= contextLength check effectively a no-op for realistic values.

Important Files Changed

Filename Overview
sdk/runanywhere-flutter/packages/runanywhere/lib/features/llm/llm_configuration.dart New LLM configuration model with validate() matching Swift/Kotlin ranges. Validation logic is sound; ranges match peer SDKs.
sdk/runanywhere-flutter/packages/runanywhere/lib/features/stt/stt_configuration.dart New STT configuration model with sampleRate and maxAlternatives validation. Ranges match Swift/Kotlin SDKs exactly.
sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/system_tts_service.dart Added validate() to existing TTSConfiguration. Validates speakingRate, pitch, and volume with isFinite checks and range bounds matching Swift/Kotlin.
sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_llm.dart Adds validation before generate/generateStream. Hardcodes contextLength to 32768 in _validateGenerationParameters, which weakens the maxTokens upper-bound check.
sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_stt.dart Adds STTConfiguration validation before transcription. Clean integration with minimal changes.
sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_tts.dart Adds TTSConfiguration validation before synthesis. Correctly maps rate/pitch/volume parameters to TTSConfiguration fields.
sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart Adds on SDKError { rethrow; } to prevent validation errors from being masked as generic generation failures. Correct and necessary fix.
sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart Exports the three new/updated configuration types from the package root. Uses show TTSConfiguration to avoid exporting the entire system_tts_service barrel.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Public API Call] --> B{Which component?}
    B -->|generate / generateStream| C[DartBridgeLLM]
    B -->|transcribe| D[DartBridgeSTT]
    B -->|synthesize| E[DartBridgeTTS]

    C --> F[LLMConfiguration.validate]
    D --> G[STTConfiguration.validate]
    E --> H[TTSConfiguration.validate]

    F -->|Invalid| I[Throw SDKError.validationFailed]
    G -->|Invalid| I
    H -->|Invalid| I

    F -->|Valid| J[FFI Call to C++]
    G -->|Valid| J
    H -->|Valid| J

    I --> K{Caller}
    K -->|RunAnywhere.generate| L["on SDKError { rethrow }"]
    K -->|Other methods| M[Propagates naturally]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_llm.dart
Line: 383-396

Comment:
**Hardcoded `contextLength` defeats `maxTokens` validation**

The `contextLength` is hardcoded to `32768` (the maximum allowed), which means the `maxTokens <= contextLength` check in `LLMConfiguration.validate()` will never reject any value under 32768. A user could pass `maxTokens: 32768` even though the loaded model may have a much smaller context window (e.g. 2048 or 4096), sending an invalid value across the FFI boundary — exactly what this PR is trying to prevent.

Consider passing the actual model's context length here. Since `DartBridgeLLM` manages the C++ lifecycle, the real context length may be queryable from the native layer, or you could store it when the model is loaded and pass it through to validation.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart
Line: 1847-1848

Comment:
**Missing parallel `SDKError` rethrow in `generateStream`, `transcribe`, and `synthesize`**

The `on SDKError { rethrow; }` clause was added here for `generate`, but the sibling `generateStream` method (line ~1930) calls `DartBridge.llm.generateStream()` outside any try-catch. While this works because validation errors propagate naturally (they're thrown synchronously before the stream is returned), it creates an inconsistency in error handling patterns.

More importantly, `transcribe` (line 684) and `synthesize` (line 947) both have a generic `catch (e) { ... rethrow; }` which *does* preserve the `SDKError` via `rethrow`. This means the `generate` method was the only place actively swallowing `SDKError` (via `throw SDKError.generationFailed('$e')`). This fix is correct — just calling it out for completeness that only `generate` had this masking issue.

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: 115e330

Greptile also left 2 inline comments on this PR.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 15, 2026

📝 Walkthrough

Walkthrough

Adds LLM, STT, and TTS configuration classes with validate() implementations; threads model contextLength through model registry and LLM bridge; and invokes runtime validation in dart_bridge_llm/stt/tts and in public RunAnywhere flows to prevent invalid parameters crossing the FFI boundary.

Changes

Cohort / File(s) Summary
Configuration classes
sdk/runanywhere-flutter/packages/runanywhere/lib/features/llm/llm_configuration.dart, sdk/runanywhere-flutter/packages/runanywhere/lib/features/stt/stt_configuration.dart, sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/tts_configuration.dart
Added LLMConfiguration, STTConfiguration, and TTSConfiguration implementing ComponentConfiguration with explicit range checks in validate() (LLM: contextLength 1–32768, temperature 0–2.0 finite, maxTokens 1–contextLength; STT: sampleRate 1–48000, maxAlternatives 1–10; TTS: speakingRate 0.5–2.0, pitch 0.5–2.0, volume 0.0–1.0).
Dart bridges / runtime validation
sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_llm.dart, .../dart_bridge_stt.dart, .../dart_bridge_tts.dart
Added runtime validation calls prior to FFI operations. LLM: stores/uses _loadedContextLength, adds _validateGenerationParameters(...) and _requireLoadedContextLength(), and validates in generate/generateStream. STT/TTS: construct configs and call .validate() before transcription/synthesis.
Model registry & model metadata
sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_model_registry.dart
Propagated contextLength through model saving/loading and conversions (public ↔ FFI ↔ internal), added contextLength on internal ModelInfo and ensured default/null handling (0 ↔ null).
Public exports & TTS service updates
sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart, sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart, sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/system_tts_service.dart
Exported new configuration files from library; replaced in-file TTSConfiguration usage with imported TTSConfiguration; updated RunAnywhere flows to pass dynamic contextLength from model info and to rethrow SDKError explicitly in several paths for consistent error propagation.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client
  participant RunAnywhere as RunAnywhere API
  participant DartBridge as DartBridgeLLM
  participant Native as Native/FFI
  Client->>RunAnywhere: call generate(prompt, config)
  RunAnywhere->>DartBridge: generate(..., modelInfo?.contextLength, params)
  DartBridge->>DartBridge: _requireLoadedContextLength()
  DartBridge->>DartBridge: _validateGenerationParameters(contextLength,maxTokens,temperature,systemPrompt,streaming)
  alt validation passes
    DartBridge->>Native: call native generate with validated params
    Native-->>DartBridge: generation result / stream
    DartBridge-->>RunAnywhere: result / stream
    RunAnywhere-->>Client: deliver result/stream
  else validation fails
    DartBridge-->>RunAnywhere: throw SDKError.validationFailed
    RunAnywhere-->>Client: propagate SDKError
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

flutter-sdk, enhancement

Suggested reviewers

  • Siddhesh2377
  • shubhammalhotra28
  • sanchitmonga22

Poem

🐇 I hopped through code to check each range,

Temperatures, tokens—no more strange,
LLM, STT, TTS in tidy rows,
Validation guards where FFI flows,
A happy rabbit hops, and proudly shows.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title '[Flutter SDK] Add configuration validation for LLM, STT, and TTS (#450)' clearly and concisely summarizes the main change: adding configuration validation for three components to achieve parity with Swift/Kotlin SDKs.
Description check ✅ Passed The PR description is comprehensive with clear sections: Summary, Problem, Changes, Files touched, Expected behavior, Notes, and Testing. It explains the issue, solution, and provides context on what was changed and why.
Linked Issues check ✅ Passed The PR implements all coding requirements from issue #450: adds LLMConfiguration and STTConfiguration classes with validate() methods, implements TTSConfiguration.validate(), enforces validation at bridge boundaries (generate, generateStream, transcribe, synthesize), and exports config types publicly. All objectives are met.
Out of Scope Changes check ✅ Passed All changes are within scope of issue #450. The PR adds configuration validation for LLM, STT, and TTS, fixes SDKError rethrow in RunAnywhere.generate(), updates model registry for contextLength tracking, and exports config types. No unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Tip

CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.

Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present.

Comment on lines +383 to +396
void _validateGenerationParameters({
required int maxTokens,
required double temperature,
String? systemPrompt,
bool streamingEnabled = false,
}) {
LLMConfiguration(
contextLength: 32768,
maxTokens: maxTokens,
temperature: temperature,
systemPrompt: systemPrompt,
streamingEnabled: streamingEnabled,
).validate();
}
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.

Hardcoded contextLength defeats maxTokens validation

The contextLength is hardcoded to 32768 (the maximum allowed), which means the maxTokens <= contextLength check in LLMConfiguration.validate() will never reject any value under 32768. A user could pass maxTokens: 32768 even though the loaded model may have a much smaller context window (e.g. 2048 or 4096), sending an invalid value across the FFI boundary — exactly what this PR is trying to prevent.

Consider passing the actual model's context length here. Since DartBridgeLLM manages the C++ lifecycle, the real context length may be queryable from the native layer, or you could store it when the model is loaded and pass it through to validation.

Prompt To Fix With AI
This is a comment left during a code review.
Path: sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_llm.dart
Line: 383-396

Comment:
**Hardcoded `contextLength` defeats `maxTokens` validation**

The `contextLength` is hardcoded to `32768` (the maximum allowed), which means the `maxTokens <= contextLength` check in `LLMConfiguration.validate()` will never reject any value under 32768. A user could pass `maxTokens: 32768` even though the loaded model may have a much smaller context window (e.g. 2048 or 4096), sending an invalid value across the FFI boundary — exactly what this PR is trying to prevent.

Consider passing the actual model's context length here. Since `DartBridgeLLM` manages the C++ lifecycle, the real context length may be queryable from the native layer, or you could store it when the model is loaded and pass it through to validation.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +1847 to +1848
} on SDKError {
rethrow;
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.

Missing parallel SDKError rethrow in generateStream, transcribe, and synthesize

The on SDKError { rethrow; } clause was added here for generate, but the sibling generateStream method (line ~1930) calls DartBridge.llm.generateStream() outside any try-catch. While this works because validation errors propagate naturally (they're thrown synchronously before the stream is returned), it creates an inconsistency in error handling patterns.

More importantly, transcribe (line 684) and synthesize (line 947) both have a generic catch (e) { ... rethrow; } which does preserve the SDKError via rethrow. This means the generate method was the only place actively swallowing SDKError (via throw SDKError.generationFailed('$e')). This fix is correct — just calling it out for completeness that only generate had this masking issue.

Prompt To Fix With AI
This is a comment left during a code review.
Path: sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart
Line: 1847-1848

Comment:
**Missing parallel `SDKError` rethrow in `generateStream`, `transcribe`, and `synthesize`**

The `on SDKError { rethrow; }` clause was added here for `generate`, but the sibling `generateStream` method (line ~1930) calls `DartBridge.llm.generateStream()` outside any try-catch. While this works because validation errors propagate naturally (they're thrown synchronously before the stream is returned), it creates an inconsistency in error handling patterns.

More importantly, `transcribe` (line 684) and `synthesize` (line 947) both have a generic `catch (e) { ... rethrow; }` which *does* preserve the `SDKError` via `rethrow`. This means the `generate` method was the only place actively swallowing `SDKError` (via `throw SDKError.generationFailed('$e')`). This fix is correct — just calling it out for completeness that only `generate` had this masking issue.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/system_tts_service.dart (1)

15-15: Consider a dedicated tts_configuration.dart.

TTSConfiguration is now shared by the bridge and the package root export, so keeping it inside system_tts_service.dart couples a reusable model to a concrete service module.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/system_tts_service.dart`
at line 15, TTSConfiguration is a reusable model but currently defined inside
system_tts_service.dart which couples it to the concrete service; extract the
class into a new file named tts_configuration.dart, move the TTSConfiguration
declaration there, update imports to import 'tts_configuration.dart' wherever
TTSConfiguration is referenced (including system_tts_service.dart and the
package root / bridge exports), and ensure the package export/entry point
exposes TTSConfiguration from the new file instead of from
system_tts_service.dart.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_llm.dart`:
- Around line 383-395: The hardcoded context length (32768) in
_validateGenerationParameters causes incorrect validation; update the call to
LLMConfiguration.validate to use the active model's contextLength instead of
32768 by either adding a contextLength parameter to
_validateGenerationParameters (and passing the loaded model.contextLength in the
caller) or performing the maxTokens vs contextLength check in the caller where
model metadata is available; reference the _validateGenerationParameters
function and LLMConfiguration.validate to locate and change the validation input
so oversized maxTokens are rejected before the FFI hop.

---

Nitpick comments:
In
`@sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/system_tts_service.dart`:
- Line 15: TTSConfiguration is a reusable model but currently defined inside
system_tts_service.dart which couples it to the concrete service; extract the
class into a new file named tts_configuration.dart, move the TTSConfiguration
declaration there, update imports to import 'tts_configuration.dart' wherever
TTSConfiguration is referenced (including system_tts_service.dart and the
package root / bridge exports), and ensure the package export/entry point
exposes TTSConfiguration from the new file instead of from
system_tts_service.dart.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ed05361a-d750-489e-86eb-4b58d1448d6e

📥 Commits

Reviewing files that changed from the base of the PR and between 405ff93 and 115e330.

📒 Files selected for processing (8)
  • sdk/runanywhere-flutter/packages/runanywhere/lib/features/llm/llm_configuration.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/features/stt/stt_configuration.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/system_tts_service.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_llm.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_stt.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_tts.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart

@shubhammalhotra28
Copy link
Copy Markdown
Contributor

cc @Siddhesh2377

@Siddhesh2377
Copy link
Copy Markdown
Collaborator

Noted ✅

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart (1)

768-778: Consider adding SDKError rethrow for consistency.

transcribe() at Lines 689-690 explicitly rethrows SDKError before the generic catch, but transcribeWithResult() does not. While the error is still propagated via rethrow, it would be logged as a generic error in telemetry, which may be misleading for validation failures.

♻️ Suggested fix for consistency
       return STTResult(
         text: result.text,
         confidence: result.confidence,
         durationMs: audioDurationMs,
         language: result.language,
       );
+    } on SDKError {
+      rethrow;
     } catch (e) {
       // Track transcription failure
       TelemetryService.shared.trackError(
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart`
around lines 768 - 778, transcribeWithResult() currently logs and rethrows
errors only in the generic catch block, causing SDKError instances to be
recorded as generic failures; update the try/catch so that SDKError is
explicitly caught and rethrown before the generic catch (mirror the pattern used
in transcribe()), and ensure the TelemetryService.shared.trackError call in the
generic catch uses the original error details when available; look for function
transcribeWithResult(), the existing catch block that calls
TelemetryService.shared.trackError and logger.error('Transcription failed: $e'),
and add a preceding catch for SDKError to rethrow unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart`:
- Around line 768-778: transcribeWithResult() currently logs and rethrows errors
only in the generic catch block, causing SDKError instances to be recorded as
generic failures; update the try/catch so that SDKError is explicitly caught and
rethrown before the generic catch (mirror the pattern used in transcribe()), and
ensure the TelemetryService.shared.trackError call in the generic catch uses the
original error details when available; look for function transcribeWithResult(),
the existing catch block that calls TelemetryService.shared.trackError and
logger.error('Transcription failed: $e'), and add a preceding catch for SDKError
to rethrow unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0b321539-7ff5-4955-af39-c2826adfdca0

📥 Commits

Reviewing files that changed from the base of the PR and between 115e330 and 1fc42e6.

📒 Files selected for processing (7)
  • sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/system_tts_service.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/tts_configuration.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_llm.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_model_registry.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_tts.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart
🚧 Files skipped from review as they are similar to previous changes (3)
  • sdk/runanywhere-flutter/packages/runanywhere/lib/runanywhere.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_tts.dart
  • sdk/runanywhere-flutter/packages/runanywhere/lib/features/tts/system_tts_service.dart

@DevDesai444
Copy link
Copy Markdown
Author

@Siddhesh2377 can you review this PR ?

@Siddhesh2377
Copy link
Copy Markdown
Collaborator

Sure @DevDesai444 ☺️

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.

[Flutter SDK] Missing configuration validation for LLM, STT, and TTS components (parity with Swift/Kotlin)

3 participants