Tap into CrewAI events to build custom integrations and monitoring
BaseEventListener
setup_listeners
methodmy_custom_listener.py
, define your listener class and create an instance:__init__.py
, import the listener instances to ensure they’re loaded:agentops_listener
is registered. In the CrewAI codebase, you’ll find:
agentops_listener
is loaded when the crewai.utilities.events
package is imported.
BaseEvent
and include:
CrewKickoffCompletedEvent
includes crew_name
and output
fields.
src/crewai/utilities/events/third_party/__init__.py
:
agentops_listener
is loaded when the crewai.utilities.events
package is imported.
scoped_handlers
context manager: