Conversation
…es' and enhance event forwarding for metrics and error handling
… recognition recovery logic
…ing and error handling
…pter.js to enhance STT module integration
|
|
Please do not review it yet. It is still a work in progress. |
…to 'stt.FallbackAdapter' for consistency in STT module.
…gnition logic, including renaming recovery tasks and making timeout options optional.
… leaks and ensure proper stream management.
…ging for input forwarding errors and closing streams on removal to enhance resource management.
…handling for recognition and streaming tasks, ensuring proper resource management and error logging during recovery attempts.
| export class FallbackAdapter extends STT { | ||
| label = 'stt.FallbackAdapter'; |
There was a problem hiding this comment.
🟡 Missing TypeDoc documentation on exported classes/interfaces violates CONTRIBUTING.md
CONTRIBUTING.md requires: "If writing new methods/interfaces/enums/classes, document them. This project uses TypeDoc for automatic API documentation generation, and every new addition has to be properly documented." The FallbackAdapter class, FallbackAdapterOptions interface, AvailabilityChangedEvent interface, and public methods (stream, close, emitAvailabilityChanged, status getter) all lack JSDoc documentation. The TTS equivalent at agents/src/tts/fallback_adapter.ts:52-80 has extensive documentation with class description, features list, and usage example.
Was this helpful? React with 👍 or 👎 to provide feedback.
…empts, enhancing error handling and introducing delay between retries. Update FallbackSpeechStream to improve resource management by ensuring proper closure of output streams and adjusting logging levels for input forwarding errors.
…improving error handling during recognition attempts.
…ream errors more effectively, ensuring proper resource management and improved error reporting during STT transitions.
…and retry intervals, enhancing responsiveness during STT operations.
…dation for configuration options and improved error logging during stream management, ensuring robustness in STT operations.
| available: boolean; | ||
| } | ||
|
|
||
| export class FallbackAdapter extends STT { |
There was a problem hiding this comment.
🟡 Missing TypeDoc documentation on new exported classes and interfaces violates CONTRIBUTING.md
CONTRIBUTING.md mandates: "If writing new methods/interfaces/enums/classes, document them. This project uses TypeDoc for automatic API documentation generation, and every new addition has to be properly documented." The exported FallbackAdapter class, AvailabilityChangedEvent interface, and all public members (sttInstances, attemptTimeoutMs, maxRetryPerSTT, retryIntervalMs, status, emitAvailabilityChanged, stream, close) lack any JSDoc documentation. The TTS equivalent at agents/src/tts/fallback_adapter.ts properly documents every exported class, interface, and public member with JSDoc comments (e.g., lines 13-32, 34-41, 52-79, 82-87, 133-138, 149-164, 232-246, 248-258, 260-268).
Prompt for agents
Add JSDoc documentation to all exported and public members in agents/src/stt/fallback_adapter.ts, following the pattern established in agents/src/tts/fallback_adapter.ts. Specifically:
1. Add a JSDoc block above the FallbackAdapter class (line 40) describing its purpose, features, and an @example block.
2. Add JSDoc to each field of the AvailabilityChangedEvent interface (lines 35-38).
3. Add JSDoc to each public property of FallbackAdapter: sttInstances (line 43), attemptTimeoutMs (line 44), maxRetryPerSTT (line 45), retryIntervalMs (line 46).
4. Add JSDoc to public methods: status getter (line 99), emitAvailabilityChanged (line 110), stream (line 258), close (line 265).
5. Add JSDoc to the FallbackAdapterOptions interface (line 27) and its fields (lines 28-32).
Refer to agents/src/tts/fallback_adapter.ts lines 13-87 for the documentation style to follow.
Was this helpful? React with 👍 or 👎 to provide feedback.
| recoveringStreamTask: Task<void> | null; | ||
| } | ||
|
|
||
| interface FallbackAdapterOptions { |
There was a problem hiding this comment.
🟡 FallbackAdapterOptions interface is not exported, unlike the TTS equivalent
The FallbackAdapterOptions interface at line 27 is not exported, meaning users cannot import this type to construct options objects with type safety. The TTS equivalent at agents/src/tts/fallback_adapter.ts:25 exports its FallbackAdapterOptions interface, and the TTS index at agents/src/tts/index.ts re-exports it. The STT index at agents/src/stt/index.ts:16 also doesn't re-export it. This is an inconsistency with the established pattern.
| interface FallbackAdapterOptions { | |
| export interface FallbackAdapterOptions { |
Was this helpful? React with 👍 or 👎 to provide feedback.
|
@toubatbrian, could you please review this code and test it once? I am also stuck on an issue that shows up while testing. When using logs: From what I can tell, the root cause is that each plugin's I am unsure about the fix here. One option might be to remove the inner retry loop entirely and let Would appreciate your guidance on how this should ideally be structured. I would also suggest running it once locally, as the issue becomes very clear when reproduced. |
|
For testing this, I modified the BasicAgent example to use both Sarvam and OpenAI STT. I intentionally did not provide the API key for Sarvam to trigger the failure and test the fallback behavior. If needed, I can also share the test code. |
No description provided.