Skip to main content
iso8583sim.llm.explainer

MessageExplainer

Explains ISO 8583 messages in plain English using an LLM. This class uses an LLM provider to generate human-readable explanations of ISO 8583 messages, making them easier to understand for developers and analysts. Example
“This is a VISA authorization request for $100.00…”
Initialize the MessageExplainer. Parameters
LLMProvider | str | None
default:"None"
LLM provider to use. Can be:
  • LLMProvider instance: Use directly
  • str: Provider name (‘anthropic’, ‘openai’, ‘google’, ‘ollama’)
  • None: Auto-detect available provider

provider

Return the LLM provider being used.

explain()

Explain an ISO 8583 message in plain English. Parameters
ISO8583Message | str
required
ISO8583Message object or raw message string to explain
bool
default:"False"
If True, include more technical details
str
Human-readable explanation of the message

explain_field()

Explain a specific ISO 8583 field value. Parameters
int
required
The field number (e.g., 2, 39, 55)
str
required
The field value to explain
str
Human-readable explanation of the field and its value

explain_error()

Explain a validation or parsing error in context. Parameters
str
required
The error message to explain
ISO8583Message | str
required
The message that caused the error
str
Human-readable explanation of the error and how to fix it

explain_response_code()

Explain an ISO 8583 response code. Parameters
str
required
The response code (e.g., “00”, “51”, “05”)
str
Human-readable explanation of the response code