Class SessionTurnAdvisor.Builder

java.lang.Object
org.springframework.ai.session.advisor.SessionTurnAdvisor.Builder
Enclosing class:
SessionTurnAdvisor

public static final class SessionTurnAdvisor.Builder extends Object
  • Method Details

    • order

      public SessionTurnAdvisor.Builder order(int order)
      The order; SessionTurnAdvisor.DEFAULT_ORDER by default. Keep it before the tool-calling advisor, so the loop runs inside the turn.
    • scheduler

      public SessionTurnAdvisor.Builder scheduler(reactor.core.scheduler.Scheduler scheduler)
      The scheduler the session writes of a streamed call run on.
    • compactionTrigger

      public SessionTurnAdvisor.Builder compactionTrigger(CompactionTrigger trigger)
      When to compact once a turn has ended; set together with compactionStrategy.
    • compactionStrategy

      public SessionTurnAdvisor.Builder compactionStrategy(CompactionStrategy strategy)
      How to compact; set together with compactionTrigger.
    • asyncCompaction

      public SessionTurnAdvisor.Builder asyncCompaction(boolean asyncCompaction)
      Whether compaction runs after the call returns, on the scheduler, so a summarizing strategy adds no model call to the reply's latency; false by default. A call() runs it with the caller's thread-local context, the security context for example, captured with Micrometer's context propagation; a stream() ends on the scheduler already. One compaction per session runs at a time from this advisor; a new turn that writes to the session meanwhile stays in the view, the compaction lands rebased onto its events with the same summary. Only another compaction's boundary, or turns that keep overtaking it, make it stand down until the next turn.
    • build

      public SessionTurnAdvisor build()