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_atRoleThe receiver of the last delivered message.
Functions
funclast(self, kind) -> M | NoneThe 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 Noneparamkindtype[M]Returns
agentsparty.runtime.M | Nonefunc__init__(self, envelopes) -> Noneparamenvelopestuple[Envelope, ...]Returns
None