Skip to content

feat(gs-ai): add AI telemetry health explainer#30

Open
root3315 wants to merge 1 commit into
masterfrom
feat/ai-telemetry-explainer
Open

feat(gs-ai): add AI telemetry health explainer#30
root3315 wants to merge 1 commit into
masterfrom
feat/ai-telemetry-explainer

Conversation

@root3315

Copy link
Copy Markdown
Owner

What

Adds an optional AI assistant to the ground station that turns decoded subsystem telemetry into a plain-language operator status report.

Why

Operators currently read raw decoded fields (battery SOC, CPU temp, pointing error…) and judge health manually. This module produces an at-a-glance natural-language assessment and is a clean hook for an LLM-backed narrative — without making the ground station depend on a network service.

Design

  • Rule-based engine is the default backend. Deterministic thresholds for EPS (battery SOC, net power), OBC (CPU temp, error count), ADCS (pointing error), GNSS (fix) roll up to a nominal → advisory → warning → critical severity ladder. Runs fully offline, so tests are deterministic and CI needs no secrets.
  • Optional Google Gemini backend (use_gemini=True + api_key) produces richer narrative text. The optional google-generativeai import is lazy and isolated.
  • Graceful degradation: any Gemini failure (missing library, no network, bad key) falls back to the rule-based text — operations never break.

Changes

File
ground-station/utils/ai_telemetry.py New module (rule engine + Gemini backend), mypy-strict clean
ground-station/tests/test_ai_telemetry.py 10 unit tests (rule paths + fallback + exception hierarchy)
ground-station/pages/12_ai_assistant.py Demo Streamlit page with sample scenarios
ground-station/tests/test_pages_smoke.py Page count 11 → 12
ground-station/requirements.txt Optional google-generativeai documented (commented)

Gates

  • pytest118 passed, 1 skipped (10 new)
  • black --line-length 79 — clean
  • mypy --strict utils/ai_telemetry.py — clean
  • No existing module touched; new code is additive

Generated by Claude Code

Add an optional AI assistant to the ground station that turns decoded
subsystem telemetry into a plain-language operator status report.

A deterministic rule-based engine (battery SOC, OBC temperature, ADCS
pointing error, GNSS fix, error counts) is the default backend so the
module runs fully offline and tests stay deterministic. An optional
Google Gemini backend produces richer narrative when an API key is
configured; any backend failure degrades gracefully to the rule-based
text, so a missing key or network outage never breaks operations.

Ships utils/ai_telemetry.py, a demo Streamlit page (12_ai_assistant),
and 10 unit tests. Updates the pages smoke-test count to 12.
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.

1 participant