Skip to main content

openhands.events.stream

EventStream Objects

@dataclass
class EventStream()

get_events

def get_events(start_id: int = 0,
end_id: int | None = None,
reverse: bool = False,
filter_out_type: tuple[type[Event], ...] | None = None,
filter_hidden=False) -> Iterable[Event]

Retrieve events from the event stream, optionally filtering out events of a given type and events marked as hidden.

Arguments:

  • start_id - The ID of the first event to retrieve. Defaults to 0.
  • end_id - The ID of the last event to retrieve. Defaults to the last event in the stream.
  • reverse - Whether to retrieve events in reverse order. Defaults to False.
  • filter_out_type - A tuple of event types to filter out. Typically used to filter out backend events from the agent.
  • filter_hidden - If True, filters out events with the 'hidden' attribute set to True.

Yields:

Events from the stream that match the criteria.