ISessionTrimmingService
Namespace: Wisej.AI.Services
Assembly: Wisej.AI
Provides functionality to trim messages in a session to reduce the number of tokens.
- C#
- VB.NET
public interface ISessionTrimmingService
Public Interface ISessionTrimmingService
Properties
TrimmingPercentage
Single: Gets or sets the percentage of messages to remove (between 0.1 and 0.9).
TrimmingStrategy
TrimmingStrategy: Gets or sets the strategy for handling context overflow.
Methods
TrimAsync(session, messages)
Trims the messages in the session to reduce the number of tokens.
| Parameter | Type | Description |
|---|---|---|
| session | SmartSession | The SmartSession to be trimmed. |
| messages | MessageCollection | Message collection to be trimmed. If null, it uses the messages in the session . |
Returns: Task.
Implemented By
| Name | Description |
|---|---|
| DefaultSessionTrimmingService | Provides functionality to trim messages in a session to reduce the number of tokens. |