Generate pain XML (async, large batches)
generate_message_asyncGenerate validated ISO 20022 payment XML asynchronously for large batches without blocking the event loop. Pass message type and records to produce XML in a background thread.
Instructions
Generate validated pain XML off the event loop, for large batches.
Behaves exactly like ``generate_message`` but runs the synchronous
renderer in a worker thread so an agent can interleave a long
generation with other tool calls. Use ``generate_message`` for small
or interactive batches; use this only when the record count is large
enough that blocking would matter.
Delegates to :func:`pain001.async_adapter.generate_xml_string_async`.
Returns the validated XML, or a JSON-encoded ``{"error": ...}`` payload.
Args:
message_type: A supported ISO 20022 pain message type.
records: One or more flat payment records.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | One or more flat payment records (each a dict of field name → value) to render into the XML; use this async variant only when the batch is large. See get_input_schema. | |
| message_type | Yes | A supported ISO 20022 pain message type. Must be exactly one of: 'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05', 'pain.001.001.06', 'pain.001.001.07', 'pain.001.001.08', 'pain.001.001.09', 'pain.001.001.10', 'pain.001.001.11', 'pain.001.001.12', 'pain.008.001.02' (see list_message_types). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |