Skip to content

ExecuteCodeBlockEvent

autogen.events.agent_events.ExecuteCodeBlockEvent #

ExecuteCodeBlockEvent(*, uuid=None, code, language, code_block_count, recipient)

Bases: BaseEvent

Source code in autogen/events/agent_events.py
def __init__(
    self,
    *,
    uuid: Optional[UUID] = None,
    code: str,
    language: str,
    code_block_count: int,
    recipient: Union["Agent", str],
):
    super().__init__(
        uuid=uuid,
        code=code,
        language=language,
        code_block_count=code_block_count,
        recipient=recipient.name if hasattr(recipient, "name") else recipient,
    )

code instance-attribute #

code

language instance-attribute #

language

code_block_count instance-attribute #

code_block_count

recipient instance-attribute #

recipient

uuid instance-attribute #

uuid

print #

print(f=None)
Source code in autogen/events/agent_events.py
def print(self, f: Optional[Callable[..., Any]] = None) -> None:
    f = f or print

    f(
        colored(
            f"\n>>>>>>>> EXECUTING CODE BLOCK {self.code_block_count} (inferred language is {self.language})...",
            "red",
        ),
        flush=True,
    )