corvix.enrichment.base

Provider interfaces and shared context for enrichment.

Classes

JsonFetchClient

Client capability required by enrichment providers.

EnrichmentProvider

Protocol implemented by enrichment providers.

EnrichmentContext

Per-cycle provider context with request budget and URL cache.

Module Contents

class corvix.enrichment.base.JsonFetchClient[source][source]

Bases: Protocol

Client capability required by enrichment providers.

fetch_json_url(url: str, timeout_seconds: float = 30.0) corvix.types.JsonValue[source][source]

Fetch JSON from a fully-qualified API URL.

class corvix.enrichment.base.EnrichmentProvider[source][source]

Bases: Protocol

Protocol implemented by enrichment providers.

name: str[source][source]
enrich(notification: corvix.domain.Notification, client: JsonFetchClient, ctx: EnrichmentContext) dict[str, object][source][source]
class corvix.enrichment.base.EnrichmentContext[source][source]

Per-cycle provider context with request budget and URL cache.

max_requests_per_cycle: int[source][source]
url_cache: dict[str, corvix.types.JsonValue][source][source]
request_count: int = 0[source][source]
get_json(client: JsonFetchClient, url: str, timeout_seconds: float) corvix.types.JsonValue[source][source]

Fetch and cache a JSON payload for this cycle.