Skip to content

NamedTranscript

autogen.beta.network.views.builtin.NamedTranscript #

Like :class:FullTranscript but prefixes non-self lines with the sender name.

Used in N-party channels (3+ participants) where the assistant/user role bit alone can't tell the LLM which "other" said which message. Each non-self envelope is projected as ModelRequest([TextInput(f"[{sender_name}]: {body}")]) so the LLM sees a name-prefixed stream instead of an unattributed collapse.

Self envelopes still project as ModelMessage(text) — the assistant role already says "I said this," no label needed.

name class-attribute instance-attribute #

name = 'named_transcript'

project async #

project(wal, *, participant_id, channel, render_envelope, name_for=default_name_resolver)
Source code in autogen/beta/network/views/builtin.py
async def project(
    self,
    wal: list[Envelope],
    *,
    participant_id: str,
    channel: ChannelMetadata,
    render_envelope: EnvelopeRenderer,
    name_for: NameResolver = default_name_resolver,
) -> list[BaseEvent]:
    events: list[BaseEvent] = []
    for envelope in wal:
        if not visible_to(envelope, participant_id):
            continue
        text = render_envelope(envelope)
        if text is None:
            continue
        events.append(_to_named_event(envelope, text, participant_id, name_for))
    return events