Skip to content

Enrichment

domain.tag.ports.enrichment

Summary

Tag enrichment port: expose the shared tag enrichment pipeline as an async callable.

Classes

TagEnrichmentAdaptor

TagEnrichmentAdaptor(**kwargs)

Adaptor exposing the tag enrichment pipeline as an async callable.

Initialize the adaptor with the shared tags pipeline.

Parameters:

Name Type Description Default
**kwargs dict

Ignored; kept for dependency-injection compatibility.

{}
Functions
__call__ async
__call__(payload: dict) -> dict

Run the tag enrichment pipeline on payload.

Defaults the tags key to ["misc"] when the pipeline produces nothing.

Parameters:

Name Type Description Default
payload dict

Enrichment input, e.g. expense text and hints.

required

Returns:

Name Type Description
dict dict

Enriched payload whose tags list is always non-empty.

Functions

get_tag_enrichment_svc

get_tag_enrichment_svc(**kwargs) -> TagEnrichmentAdaptor

Build a tag enrichment service adaptor.

Parameters:

Name Type Description Default
**kwargs dict

Passed through to the adaptor constructor.

{}

Returns:

Name Type Description
TagEnrichmentAdaptor TagEnrichmentAdaptor

Ready-to-use tag enrichment adaptor.