Skip to content

messaging.audience

audience

Audience selection contracts for campaign messaging.

Classes

AudienceBuilder

Bases: Protocol

Materializes campaign recipients from a host-defined filter.

Source code in src/codex_platform/messaging/audience.py
class AudienceBuilder(Protocol):
    """Materializes campaign recipients from a host-defined filter."""

    def count(self, audience_filter: dict[str, Any]) -> int:
        """Return the number of recipients matching the filter."""
        ...

    def materialize(self, audience_filter: dict[str, Any]) -> Iterable[CampaignRecipientDraft]:
        """Stream recipient drafts matching the filter."""
        ...
Functions
count(audience_filter)

Return the number of recipients matching the filter.

Source code in src/codex_platform/messaging/audience.py
def count(self, audience_filter: dict[str, Any]) -> int:
    """Return the number of recipients matching the filter."""
    ...
materialize(audience_filter)

Stream recipient drafts matching the filter.

Source code in src/codex_platform/messaging/audience.py
def materialize(self, audience_filter: dict[str, Any]) -> Iterable[CampaignRecipientDraft]:
    """Stream recipient drafts matching the filter."""
    ...