22 lines
716 B
Python
22 lines
716 B
Python
from typing import Any, Dict
|
|
|
|
from .narrative import build_block_from_events
|
|
|
|
|
|
def news_adapter_event(headline: str, uri: str, confidence: float = 0.9) -> Dict[str, Any]:
|
|
"""Create a normalized event payload from a news headline. This is an adapter stub.
|
|
|
|
In real usage this would parse entities, extract sentiment, etc. Here we keep a simple,
|
|
deterministic mapping for deterministic replay testing.
|
|
"""
|
|
return {
|
|
"type": "news",
|
|
"headline": headline,
|
|
"uri": uri,
|
|
"confidence": float(confidence),
|
|
}
|
|
|
|
|
|
def transcript_adapter_event(speaker: str, text: str, ts: str) -> Dict[str, Any]:
|
|
return {"type": "transcript", "speaker": speaker, "text": text, "ts": ts}
|