Skip to content

Development

James edited this page May 10, 2026 · 3 revisions

Development

Repository Layout

Integration source lives in custom_components/groq/.

Important modules:

  • config_flow.py: account setup, reauthentication, options, and service subentry flows
  • api.py: shared async Groq API client
  • model_registry.py: model capability discovery and fallback metadata
  • feature_registry.py: feature definitions
  • services.py: Home Assistant response services
  • conversation.py: Text Generation and Assist support
  • ai_task.py: AI Task support
  • stt.py: Speech-to-Text entity
  • tts.py: Text-to-Speech entity and audio processing
  • tts_engine.py: TTS API adapter
  • diagnostics.py: redacted diagnostics

Tests live under tests/components/groq/.

Test Harness

Tests run in the Home Assistant Docker-based harness:

scripts/test

Run a targeted test command:

scripts/test python -m pytest tests/components/groq -q

CI Parity Checks

scripts/test python scripts/validate_quality_scale.py
scripts/test python scripts/importtime_profile.py --strict-integration-warnings
scripts/test python -m pytest --cov=custom_components.groq --cov-report=term-missing --cov-fail-under=80 -q

Development Notes

  • Keep network calls async and non-blocking.
  • Do not log API keys, prompts, image bytes, audio bytes, or sensitive Home Assistant data.
  • Prefer Home Assistant-native entity surfaces where they exist: conversation, stt, and tts.
  • Use response services for one-shot operations that return generated data.
  • Add tests for config validation, network error paths, model gating, and service behavior.

Clone this wiki locally