Class TruncatingSummarizer
java.lang.Object
ai.redouble.nucleo.harness.schema.TruncatingSummarizer
- All Implemented Interfaces:
Summarizer
Default summarizer that truncates text to a character budget derived from the
LLMSummarizable.size() annotation, preserving word boundaries.
Checks LLMSummarizable.staticSummary() first - if set, uses that as the
summary label. Otherwise truncates the text content.
Always safe to use from any context (Tools, Thinkers, Doers) - no external calls, no blocking, no resource requirements.
- Since:
- 0.1 (2026-04-03)
- Author:
- Andrey Santrosyan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsummarize(String text, LLMSummarizable annotation) Summarize text that exceeds the annotation threshold.
-
Constructor Details
-
TruncatingSummarizer
public TruncatingSummarizer()
-
-
Method Details
-
summarize
Description copied from interface:SummarizerSummarize text that exceeds the annotation threshold.- Specified by:
summarizein interfaceSummarizer- Parameters:
text- the full text to summarizeannotation- the @LLMSummarizable annotation from the field- Returns:
- summary string, typically in format "[SUMMARY: X chars] brief..."
-