Uses of Class
org.springframework.ai.session.SessionEvent
Packages that use SessionEvent
Package
Description
JDBC-backed implementation of
SessionRepository.Helpers for
SessionRepository implementations.The contract tests of a
SessionRepository
implementation.-
Uses of SessionEvent in org.springframework.ai.session
Methods in org.springframework.ai.session that return SessionEventModifier and TypeMethodDescriptionSessionEvent.Builder.build()Builds the event, checking that the type and the message agree.Methods in org.springframework.ai.session that return types with arguments of type SessionEventModifier and TypeMethodDescriptionEventFilter.apply(List<SessionEvent> events) Applies this filter to the events of one session held in memory: withEventFilter.activeView()first reduces the log to its active view (CompactionBoundary.project(List)), then keeps the events thatEventFilter.matches(SessionEvent), then applies the window keeping turns whole.EventFilter.applyWindow(List<SessionEvent> matched) Applies the window to the filtered events of one session, oldest first, keeping turns whole: aEventFilter.Window.Lastwindow whose first event is not a turn start is extended back to the nearest turn start before it.InMemorySessionRepository.findEvents(String sessionId, EventFilter filter) SessionRepository.findEvents(String sessionId, EventFilter filter) The events of the session the filter selects, oldest first; an empty list for a session that does not exist.DefaultSessionService.getEvents(String sessionId, EventFilter filter) default List<SessionEvent>Every event of the log, oldest first.SessionService.getEvents(String sessionId, EventFilter filter) The events the filter selects, oldest first; seeEventFilter.Methods in org.springframework.ai.session with parameters of type SessionEventModifier and TypeMethodDescriptionvoidDefaultSessionService.appendEvent(SessionEvent event) voidInMemorySessionRepository.appendEvent(SessionEvent event) voidSessionRepository.appendEvent(SessionEvent event) Appends one event to the log of the session named bygetSessionId().voidSessionService.appendEvent(SessionEvent event) Appends an event to the session named bygetSessionId().booleanEventFilter.matches(SessionEvent event) Whether the event passes the per-event criteria: the event and message types and the synthetic flag.Method parameters in org.springframework.ai.session with type arguments of type SessionEventModifier and TypeMethodDescriptionbooleanInMemorySessionRepository.appendEvents(String sessionId, List<SessionEvent> events, long expectedVersion) booleanSessionRepository.appendEvents(String sessionId, List<SessionEvent> events, long expectedVersion) Appends several events in order, atomically, only if the log's version equalsexpectedVersion; otherwise nothing is written andfalseis returned.EventFilter.apply(List<SessionEvent> events) Applies this filter to the events of one session held in memory: withEventFilter.activeView()first reduces the log to its active view (CompactionBoundary.project(List)), then keeps the events thatEventFilter.matches(SessionEvent), then applies the window keeping turns whole.EventFilter.applyWindow(List<SessionEvent> matched) Applies the window to the filtered events of one session, oldest first, keeping turns whole: aEventFilter.Window.Lastwindow whose first event is not a turn start is extended back to the nearest turn start before it. -
Uses of SessionEvent in org.springframework.ai.session.compaction
Methods in org.springframework.ai.session.compaction that return types with arguments of type SessionEventModifier and TypeMethodDescriptionSummaryRequest.covered()Returns the value of thecoveredrecord component.CompactionResult.coveredEvents()Returns the value of thecoveredEventsrecord component.CompactionRequest.events()Returns the value of theeventsrecord component.CompactionResult.pinnedEvents()Returns the value of thepinnedEventsrecord component.SummaryRequest.preserved()Returns the value of thepreservedrecord component.CompactionResult.preservedEvents()Returns the value of thepreservedEventsrecord component.SummaryRequest.priorSummary()Returns the value of thepriorSummaryrecord component.static List<SessionEvent>CompactionBoundary.project(List<SessionEvent> log) The active view of a log, from its newest boundary: the pinned events, then the summary events, then the preserved events, then every event appended after the summary; a log without a boundary is its own view, and the boundary event is never in it.The eventsSessionService.compact(java.lang.String, org.springframework.ai.session.compaction.CompactionTrigger, org.springframework.ai.session.compaction.CompactionStrategy)appends for this result: theEventType.COMPACTIONboundary, then one synthetic event per summary message, all with one timestamp.Methods in org.springframework.ai.session.compaction with parameters of type SessionEventModifier and TypeMethodDescriptionstatic CompactionBoundaryCompactionBoundary.from(SessionEvent event) Reads the boundary recorded by aEventType.COMPACTIONevent.static StringEventText.of(SessionEvent event) The text of an event; empty for an event that carries no message.Method parameters in org.springframework.ai.session.compaction with type arguments of type SessionEventModifier and TypeMethodDescriptionChatModelSummarizer.Builder.eventFormatter(Function<SessionEvent, String> eventFormatter) How an event is rendered in the prompt;EventText.of(SessionEvent)by default.static @Nullable CompactionBoundaryCompactionBoundary.newest(List<SessionEvent> log) The newest boundary of a log, ornullwhen the log was never compacted.static CompactionRequestCompactionRequest.of(Session session, List<SessionEvent> events) A request for the session and its view, counting the turns.static List<SessionEvent>CompactionBoundary.project(List<SessionEvent> log) The active view of a log, from its newest boundary: the pinned events, then the summary events, then the preserved events, then every event appended after the summary; a log without a boundary is its own view, and the boundary event is never in it.Constructor parameters in org.springframework.ai.session.compaction with type arguments of type SessionEventModifierConstructorDescriptionCompactionRequest(Session session, List<SessionEvent> events, int currentTurnCount) Creates an instance of aCompactionRequestrecord class.CompactionResult(List<SessionEvent> coveredEvents, List<SessionEvent> pinnedEvents, List<SessionEvent> preservedEvents, List<Message> summary, int tokensEstimatedSaved, String strategy) Creates an instance of aCompactionResultrecord class.SummaryRequest(Session session, List<SessionEvent> priorSummary, List<SessionEvent> covered, List<SessionEvent> preserved) Creates an instance of aSummaryRequestrecord class. -
Uses of SessionEvent in org.springframework.ai.session.jdbc
Methods in org.springframework.ai.session.jdbc that return types with arguments of type SessionEventModifier and TypeMethodDescriptionJdbcSessionRepository.findEvents(String sessionId, EventFilter filter) Methods in org.springframework.ai.session.jdbc with parameters of type SessionEventMethod parameters in org.springframework.ai.session.jdbc with type arguments of type SessionEventModifier and TypeMethodDescriptionbooleanJdbcSessionRepository.appendEvents(String sessionId, List<SessionEvent> events, long expectedVersion) -
Uses of SessionEvent in org.springframework.ai.session.support
Methods in org.springframework.ai.session.support with parameters of type SessionEventModifier and TypeMethodDescriptionSessionEventCodec.encode(SessionEvent event) Encodes an event into its persisted shape. -
Uses of SessionEvent in org.springframework.ai.test.session
Methods in org.springframework.ai.test.session that return SessionEventModifier and TypeMethodDescriptionprotected static SessionEventprotected static SessionEventA status event, the simplest event that is not a message.protected static SessionEventA synthetic event, as a compaction strategy would produce it.Methods in org.springframework.ai.test.session that return types with arguments of type SessionEventModifier and TypeMethodDescriptionprotected static List<SessionEvent>AbstractSessionRepositoryContractTests.summaryTurn(String sessionId, String summary) A synthetic shadow-prompt + summary pair, as the summarizing strategy produces.Method parameters in org.springframework.ai.test.session with type arguments of type SessionEventModifier and TypeMethodDescriptionprotected voidAbstractSessionRepositoryContractTests.compact(String sessionId, List<SessionEvent> pinned, List<SessionEvent> summary, List<SessionEvent> preserved) Records a compaction the way the service does: appends a boundary naming the pinned, summary and preserved events, followed by the summary events, under the current version.AbstractSessionRepositoryContractTests.ids(List<SessionEvent> events, String... labels) The ids of the events with the given labels.AbstractSessionRepositoryContractTests.labels(List<SessionEvent> events) Event labels: the text, "Σ?"