Skip to content

[Feature Request]: Extend Events with hooks #2066

@marklysze

Description

@marklysze

Is your feature request related to a problem? Please describe.

Events in AG2 are key actions emitted from an AG2 workflow, it would be beneficial to be able to hook onto certain events, such as human-input, termination, etc.

Events are emitted as part of the run and run_group_chat methods which return a RunResponse.

See this Notebook for examples of run, run_group_chat (at the end), and iterating through events:
https://docs.ag2.ai/latest/docs/use-cases/notebooks/notebooks/run_and_event_processing/

Events classes can be found here:
https://github.com/ag2ai/ag2/tree/main/autogen/events

Some initial thoughts:

  • Extend BaseEvent, the base class for events, with the ability to add hooks that get activated when the event is created.
  • When using run you get a RunResponseProtocol, perhaps there could be a way to utilise this or extend it.

CC @Lancetnik

Note: Additional events may need to be added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions