Skip to main content

Templated + LLM narrator for AI Internet Diagnostic — citation guardrail + structured outputs.

Project description

wifi-diag-narrator

Templated + Anthropic Haiku 4.5 narrator package for the AI Internet Diagnostic project.

Supporting infrastructure. This package supplies the LLM-narrator + citation-validation guardrail used by the Space and the agent. For results-first numbers, architecture, and live demo, see the Model repo README.

Install

pip install wifi-diag-narrator

Public API

  • narrate(verdict, telemetry, frames) — Anthropic Structured Outputs narrator
  • narrate_templated(verdict) — LLM-free templated narrator (used by agent local-only mode)
  • strip_invalid_citations(narration) — citation-guardrail enforcer

See the Model repo for the architecture diagram and full pipeline context.


wifi-diag-narrator

Narrator + citation guardrail for AI Internet Diagnostic.

Two narrators with the same Verdict output shape:

  • narrate_templated(verdict, frames) — deterministic, no network egress. Used by the agent's local-only mode (Phase 4) and as a fallback. Always returns a full Verdict (LLM-05).
  • narrate(verdict, frames, model="claude-haiku-4-5") — Anthropic Haiku 4.5 with Structured Outputs (Pydantic-derived JSON schema), tenacity retry, prompt caching (D-NARRATOR-07/08/10). Used by the Space's cache-regeneration pipeline (Phase 3 plan 03-05). Lazy-imports anthropic (Pitfall C); install via pip install wifi-diag-narrator[llm].

Citation guardrail

Every EvidenceItem.telemetry_path must (a) be a real TelemetryFrame field, (b) resolve to non-null in the actual telemetry payload (D-NARRATOR-02). Invalid citations are stripped silently (D-NARRATOR-01).

Install

# Templated narrator only (zero network deps; agent local-only mode):
pip install wifi-diag-narrator==0.1.0

# With Anthropic LLM narrator (Space cache-regen pipeline):
pip install wifi-diag-narrator[llm]==0.1.0

Public API

from wifi_diag_narrator import (
    EVIDENCE_RULES,             # dict[DisconnectClass, list[str]]
    narrate_templated,          # deterministic, no network
    strip_invalid_citations,    # post-LLM guardrail
    is_valid_citation,          # single-citation check
    build_system_prompt,        # for prompt-caching workflows
)

# LLM path (requires anthropic + ANTHROPIC_API_KEY):
from wifi_diag_narrator.anthropic_narrator import narrate

Versioning

Strict SemVer aligned with wifi-diag-schema:

  • Major = breaking change to the narrator's public API
  • Minor = additive (new template, new evidence rule)
  • Patch = doc-only / wording-only

Release

Tag a release as vX.Y.Z; the release.yml workflow runs OIDC Trusted Publishing automatically.

License

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wifi_diag_narrator-0.1.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wifi_diag_narrator-0.1.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file wifi_diag_narrator-0.1.1.tar.gz.

File metadata

  • Download URL: wifi_diag_narrator-0.1.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wifi_diag_narrator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8b012a552ba3e2d8e173d32e8c74a02cb76668a710bdaab357d247c97dfdd6bd
MD5 745ebb4be880792ced77e15287e7ae2a
BLAKE2b-256 c7919052914c1a9832e2eb4f3c5901d3458a4edd7ecc30c1a9ed75f1ee37a540

See more details on using hashes here.

Provenance

The following attestation bundles were made for wifi_diag_narrator-0.1.1.tar.gz:

Publisher: release.yml on wolfwdavid/wifi-diag-narrator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wifi_diag_narrator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for wifi_diag_narrator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f13dc07f929207893ec01ea36b4d3321dd9a5606f7340877f03e5bc425a818dd
MD5 6cdb2f32c6a4fb9388e1a9a8cee3a373
BLAKE2b-256 10fc49dc0ca92cc66fcabd49e4abed9073d4af76ac0e66adeafdbf08419d8c69

See more details on using hashes here.

Provenance

The following attestation bundles were made for wifi_diag_narrator-0.1.1-py3-none-any.whl:

Publisher: release.yml on wolfwdavid/wifi-diag-narrator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page