Enum Summarizer.OverflowResolutionStrategy
- Namespace
- LMKit.TextGeneration
- Assembly
- LM-Kit.NET.dll
Specifies the strategies available for handling scenarios where the combined length of the input text and the anticipated completion tokens exceed the configured MaximumContextLength.
[Obfuscation(Exclude = true)]
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum Summarizer.OverflowResolutionStrategy
Fields
Truncate = 0When the input text plus anticipated completion tokens exceed MaximumContextLength, the summarizer will remove content from the end of the input until it fits.
RecursiveSummarize = 1When the input length surpasses MaximumContextLength, the summarizer will iteratively break the input into smaller segments, summarize each segment, merge the summaries, and repeat the process if necessary. This recursive approach ensures that the final output fits within the defined context limits.
Reject = 2If the input length exceeds MaximumContextLength, the summarization process will be halted, resulting in an error or a refusal to proceed.
Examples
Example: Set an overflow strategy on the Summarizer
using LMKit.Model;
using LMKit.TextGeneration;
LM model = LM.LoadFromModelID("gemma3:4b");
var summarizer = new Summarizer(model);
// Use recursive summarization for large documents
summarizer.OverflowStrategy = Summarizer.OverflowResolutionStrategy.RecursiveSummarize;
// Or truncate if speed is more important than completeness
summarizer.OverflowStrategy = Summarizer.OverflowResolutionStrategy.Truncate;