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 narratornarrate_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 fullVerdict(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-importsanthropic(Pitfall C); install viapip 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b012a552ba3e2d8e173d32e8c74a02cb76668a710bdaab357d247c97dfdd6bd
|
|
| MD5 |
745ebb4be880792ced77e15287e7ae2a
|
|
| BLAKE2b-256 |
c7919052914c1a9832e2eb4f3c5901d3458a4edd7ecc30c1a9ed75f1ee37a540
|
Provenance
The following attestation bundles were made for wifi_diag_narrator-0.1.1.tar.gz:
Publisher:
release.yml on wolfwdavid/wifi-diag-narrator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wifi_diag_narrator-0.1.1.tar.gz -
Subject digest:
8b012a552ba3e2d8e173d32e8c74a02cb76668a710bdaab357d247c97dfdd6bd - Sigstore transparency entry: 1512452635
- Sigstore integration time:
-
Permalink:
wolfwdavid/wifi-diag-narrator@229426462102500db244c338095452d14032c5a3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wolfwdavid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@229426462102500db244c338095452d14032c5a3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file wifi_diag_narrator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: wifi_diag_narrator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f13dc07f929207893ec01ea36b4d3321dd9a5606f7340877f03e5bc425a818dd
|
|
| MD5 |
6cdb2f32c6a4fb9388e1a9a8cee3a373
|
|
| BLAKE2b-256 |
10fc49dc0ca92cc66fcabd49e4abed9073d4af76ac0e66adeafdbf08419d8c69
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wifi_diag_narrator-0.1.1-py3-none-any.whl -
Subject digest:
f13dc07f929207893ec01ea36b4d3321dd9a5606f7340877f03e5bc425a818dd - Sigstore transparency entry: 1512452731
- Sigstore integration time:
-
Permalink:
wolfwdavid/wifi-diag-narrator@229426462102500db244c338095452d14032c5a3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wolfwdavid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@229426462102500db244c338095452d14032c5a3 -
Trigger Event:
push
-
Statement type: