Class ChatModelSummarizer.Builder
java.lang.Object
org.springframework.ai.session.compaction.ChatModelSummarizer.Builder
- Enclosing class:
- ChatModelSummarizer
-
Method Summary
Modifier and TypeMethodDescriptionbuild()chatOptions(ChatOptions chatOptions) The options of the summarizing call, a smaller model for example; none by default.eventFormatter(Function<SessionEvent, String> eventFormatter) How an event is rendered in the prompt;EventText.of(SessionEvent)by default.onSummarizationFailure(Consumer<SummaryRequest> onSummarizationFailure) Called with the request when the model call fails or returns a null or blank summary, after the warning is logged.overlapSize(int overlapSize) How many of the preserved events are quoted in the prompt for continuity; 2 by default,0for none.shadowPrompt(String shadowPrompt) Replaces the synthetic user message that opens each summary turn;ChatModelSummarizer.DEFAULT_SHADOW_PROMPTby default.systemPrompt(String systemPrompt) Replaces the default system prompt of the summarizing call.
-
Method Details
-
chatOptions
The options of the summarizing call, a smaller model for example; none by default. -
overlapSize
How many of the preserved events are quoted in the prompt for continuity; 2 by default,0for none. -
systemPrompt
Replaces the default system prompt of the summarizing call. -
shadowPrompt
Replaces the synthetic user message that opens each summary turn;ChatModelSummarizer.DEFAULT_SHADOW_PROMPTby default. For another language, or an agent that needs a different framing. -
eventFormatter
How an event is rendered in the prompt;EventText.of(SessionEvent)by default. -
onSummarizationFailure
public ChatModelSummarizer.Builder onSummarizationFailure(Consumer<SummaryRequest> onSummarizationFailure) Called with the request when the model call fails or returns a null or blank summary, after the warning is logged. -
build
-