Skip to content

API Reference parrot.services.comm_center.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.services.comm_center.models

View source

Request-side data models for the CommCenter recipient pipeline.

RecipientIn is the single normalized shape every ingestion transport (inline JSON, multipart/form-data, base64) produces (spec §2 Data Models, §3 Module 4). SkippedRow documents why a row never reached the NotifyWorker stream (spec §5 — skipped rows must be reported, never silently dropped). SenderRequest/SenderResponse are the POST /sender bulk-send request/response bodies (TASK-2159).

Class PreparedBatch

Result of CommCenterService.prepare() — no I/O has happened yet.

Everything up to (not including) publishing: the resolved computed functions, the partially-rendered template, and the split between recipients ready to publish (queued) and those excluded (skipped). This is the only shape dry_run (TASK-2162) ever returns to the caller.

Fields:

Field Type Default Description
resolved_functions dict
template Optional[str] None
subject Optional[str] None
queued list
skipped list
dry_run bool False
preview Optional[str] None

Class PreparedMessage

One recipient that passed validation, with its finished wire payload.

payload is exactly what :func:parrot.services.comm_center.dispatch (TASK-2158) will xadd unchanged — this is the last step prepare() performs before any publishing would happen.

Fields:

Field Type Default Description
recipient RecipientIn
payload dict
row_number Optional[int] None

Class RecipientIn

One normalized recipient row from JSON, Excel, or CSV.

Extra columns beyond the canonical five (name, username, email, phone, address) are preserved verbatim in extra and forwarded as pass-2 render kwargs (spec §3 Module 3/4).

Fields:

Field Type Default Description
name str
username Optional[str] None
email Optional[str] None
phone Optional[str] None
address Optional[str] None
provider Optional[str] None
extra dict

Class SenderRequest

POST /sender request body — the bulk-send endpoint (spec §2).

Exactly one of template_id, template_name, template, or template_file must be provided; exactly one of recipients (inline JSON) or file_b64 must be provided when the transport is JSON (multipart uploads carry recipients as a file part instead, never through this model).

Fields:

Field Type Default Description
provider str
template_id Optional[uuid.UUID] None
template_name Optional[str] None
template Optional[str] None
template_file Optional[str] None
subject Optional[str] None
recipients Optional[list] None
file_b64 Optional[str] None
filename Optional[str] None
dry_run bool False

Class SenderResponse

POST /sender response body (spec §2, §5 acceptance criteria).

Fields:

Field Type Default Description
batch_id Optional[uuid.UUID] None
status str
total int
queued int
skipped int
resolved_functions dict
skipped_details list
preview Optional[str] None

Class SingleMessageRequest

POST /message request body — one recipient, one provider (spec G13).

provider is required and explicit — unlike SenderRequest, there is exactly one recipient, so there is no per-record override to resolve. Exactly one of template_id/template_name/template/ template_file must be provided, same resolution as the bulk endpoint.

Fields:

Field Type Default Description
provider str
recipient RecipientIn
template_id Optional[uuid.UUID] None
template_name Optional[str] None
template Optional[str] None
template_file Optional[str] None
subject Optional[str] None
dry_run bool False

Class SingleMessageResponse

POST /message response body (spec §2, G13).

status is one of queued/publish_failed/skipped/ dry_run; reason is populated for skipped/publish_failed.

Fields:

Field Type Default Description
batch_id Optional[uuid.UUID] None
message_id Optional[str] None
status str
reason Optional[str] None
resolved_functions dict
preview Optional[str] None

Class SkippedRow

A recipient row excluded from the send, with the reason why.

Reported back to the caller (spec §5) — the batch proceeds with the remaining rows rather than aborting.

Fields:

Field Type Default Description
row int
reason str

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally