Skip to content

feat: webrtc and AI plugins #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 235 commits into
base: main
Choose a base branch
from
Open

feat: webrtc and AI plugins #90

wants to merge 235 commits into from

Conversation

vivekd22
Copy link
Contributor

@vivekd22 vivekd22 commented Jul 7, 2025

No description provided.

d3xvn and others added 30 commits August 20, 2025 11:55
- Add 50 comprehensive test methods covering all event types (STT, TTS, STS, VAD, Generic)
- Fix BaseEvent.to_dict() method to properly include event_type field using dataclasses.fields()
- Add 14 serialization/deserialization tests covering round-trip accuracy
- Test event creation, validation, edge cases, and factory functions
- Ensure all 63 tests pass including existing functionality
- Fix serialization to properly handle init=False fields like event_type
- Add 14 new test methods for event metrics calculation functions
- Test calculate_stt_metrics() with empty events, basic counts, processing times, confidence, and mixed data
- Test calculate_tts_metrics() with empty events, basic counts, synthesis times, and real-time factors
- Test calculate_vad_metrics() with empty events, basic counts, durations, probabilities, and mixed data
- Test realistic event sequence with all three metrics functions
- Use pytest.approx() for floating point comparisons to handle precision issues
- Account for default values in VAD events (duration_ms=0.0, speech_probability=0.0)
- Total test count now 64 with comprehensive coverage of metrics functionality
- Change VADAudioEvent and VADPartialEvent duration_ms and speech_probability from float = 0.0 to Optional[float] = None
- This allows proper distinction between '0.0' (valid measurement) and 'None' (not provided)
- Update VAD metrics calculation to properly filter out None values before computing averages
- Fix test expectations to match the actual behavior (VADPartialEvent speech_probability is not included in VADAudioEvent metrics)
- All 64 tests now passing with improved data handling
- Add TestEventFiltering class with 3 test methods:
  * EventFilter creation with various parameters
  * EventFilter.matches() method testing for all filter types
  * Edge cases (None events, empty sets)
- Add TestEventRegistry class with 7 test methods:
  * Registry creation and basic properties
  * Event registration and counting
  * Max events limit enforcement
  * Event filtering with EventFilter
  * Statistics and error summary generation
  * Event listener functionality
  * Registry clearing
- Add TestEventLogger class with 3 test methods:
  * Logger creation and properties
  * Individual event logging
  * Batch event logging (individual calls)
- Add TestGlobalEventSystem class with 2 test methods:
  * Global registry and logger access
  * Global event consistency through register_global_event
- Total test count now 79 with comprehensive coverage of:
  * Event filtering (type, session, plugin, time, confidence)
  * Event registry (storage, querying, statistics)
  * Event logging (structured output, registry integration)
  * Global event system (consistency, accessibility)
- Change EventFilter.matches() confidence filtering from permissive to strict
- Previously: events without confidence attribute passed through filters
- Now: events without confidence attribute are excluded when min_confidence is set
- This ensures filter results only contain events that actually meet confidence criteria
- Prevents misleading results where events without confidence data appear in high-confidence filtered results
- Makes filtering behavior consistent with other filter types (time, session, plugin)
- Update test to reflect corrected behavior (2 events instead of 3 in confidence filter)
- All 79 tests passing with improved filtering logic
- Fix VADPartialEvent and VADAudioEvent constructor calls with invalid parameters
- Update event handlers in tests to expect event objects instead of PcmData
- Fix numpy array truthiness issue in event logging
- Improve event filtering robustness in global event system tests
- Fix event handler signatures in VAD, TTS, and STS tests
- Resolve all internal plugin test failures (117 tests now passing)

The remaining 24 test failures are due to missing external dependencies
(deepgram and elevenlabs packages), not code issues.
- Fix event handler signatures across all plugins to expect event objects
- Fix ElevenLabs TTS async/await issue in synthesize() method
- Fix Deepgram STT test metadata expectations
- Fix FAL STT error event assertions
- Fix Cartesia TTS event handler signatures
- Install missing external dependencies
- Move event system examples to proper location

All plugins now have full test coverage and are production-ready.
feat: Add new global event system and models
Allow for optionally passing in STT clients
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.

5 participants