OSSS.ai.events.sinks¶
OSSS.ai.events.sinks
¶
Event Sinks for OSSS Event System.
This module provides various event sinks for handling workflow events, including console output, file storage, and in-memory collection for testing and development.
EventSink
¶
ConsoleEventSink
¶
FileEventSink
¶
InMemoryEventSink
¶
Bases: EventSink
Event sink that stores events in memory for testing and development.
emit(event)
async
¶
Store the event in memory.
get_events(event_type=None, workflow_id=None, agent_name=None)
¶
Get stored events with optional filtering.
get_recent_events(count=10)
¶
Get the most recent events.
get_statistics()
¶
Get event statistics for this sink.
clear_events()
¶
Clear all stored events and return count of cleared events.
close()
async
¶
Clear stored events.
create_file_sink(file_path, max_file_size_mb=100, rotate_files=True, event_types=None, agent_names=None)
¶
Create a file event sink with optional filtering.