CompressionOptions
Options & Configuration · AiDotNet.PromptEngineering.Compression
Options for controlling prompt compression behavior.
For Beginners
Settings for how to compress your prompt.
Example:
How It Works
Configures how aggressive compression should be, what techniques to use, and constraints on the output.
Constructors
| Constructor | Summary |
|---|---|
CompressionOptions() |
Properties
| Property | Summary |
|---|---|
CompressionOptions Aggressive { get; } |
Gets aggressive compression options for maximum reduction. |
CompressionOptions Conservative { get; } |
Gets conservative compression options that preserve more content. |
CompressionOptions Default { get; } |
Gets default compression options with moderate settings. |
bool PreserveCodeBlocks { get; set; } |
Gets or sets whether to preserve code blocks during compression. |
bool PreserveVariables { get; set; } |
Gets or sets whether to preserve template variables during compression. |
double TargetReduction { get; set; } |
Gets or sets the target reduction ratio (0.0 to 1.0). |
int MinTokenCount { get; set; } |
Gets or sets the minimum number of tokens in the output. |
int? MaxTokens { get; set; } |
Gets or sets the maximum number of tokens in the output. |
string ModelName { get; set; } |
Gets or sets the model name for accurate token counting. |