LLMContextCompressor<T>
Models & Types ยท AiDotNet.RetrievalAugmentedGeneration.ContextCompression
LLM-based context compression to reduce token usage while preserving key information.
Inheritance: ContextCompressorBase<T> โ LLMContextCompressor<T>
Constructors
| Constructor | Summary |
|---|---|
LLMContextCompressor(double compressionRatio, string llmEndpoint, string apiKey, ITextGenerator generator) |
Initializes a new instance of the LLMContextCompressor class. |
Methods
| Method | Summary |
|---|---|
string CompressText(string query, string text) |
Compresses text based on relevance to the query. |