ReferenceAPI referenceagentspartyruntime

Transcript

The outcome of a run: delivered envelopes in canonical order.

Reads like a conversation: iterating yields envelopes, str prints one Sender:Label -> Receiver line per message, and messages / last compare against the declared message classes.

Attributes

attributeenvelopestuple[Envelope, ...]
attributemessagestuple[type[Message], ...]

The declared class of every delivered message, in delivery order.

A transcript produced by Session carries a message on every envelope; the cast silences the None branch of the field's type.

attributeended_atRole

The receiver of the last delivered message.

Functions

funclast(self, kind) -> M | None

The most recent message of kind, if any.

› Source code
def last(self, kind: type[M]) -> M | None:
    """The most recent message of *kind*, if any."""
    for envelope in reversed(self.envelopes):
        if envelope.message.__class__ is kind:
            return cast(M, envelope.message)
    return None
paramkindtype[M]

Returns

agentsparty.runtime.M | None
func__init__(self, envelopes) -> None
paramenvelopestuple[Envelope, ...]

Returns

None

On this page