Package org.springframework.ai.session
Class DefaultSessionService.Builder
java.lang.Object
org.springframework.ai.session.DefaultSessionService.Builder
- Enclosing class:
- DefaultSessionService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowSystemMessages(boolean allowSystemMessages) WhetherDefaultSessionService.appendEvent(SessionEvent)may store aSystemMessage;falseby default.build()Builds the service.defaultTimeToLive(Duration defaultTimeToLive) The time to live of a session created without one; 60 days by default.sessionRepository(SessionRepository sessionRepository) The store; required.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
sessionRepository
The store; required. -
allowSystemMessages
WhetherDefaultSessionService.appendEvent(SessionEvent)may store aSystemMessage;falseby default. A system prompt is configuration, best supplied on every request, so storing one is rejected with anIllegalArgumentExceptionthat says how to enable it. When enabled, the latest stored system message is the session's system prompt, which compaction pins; seeWindowCompactionStrategy. -
defaultTimeToLive
The time to live of a session created without one; 60 days by default. -
build
Builds the service.- Throws:
IllegalStateException- if no repository was set
-