mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
feat: add compaction ratio setting to control partial context compaction
Allow users to configure what percentage of older messages to compact, keeping the most recent portion intact. Default ratio is 80%, meaning the oldest 80% of uncompacted messages are summarized while the newest 20% remain as-is for full-fidelity context.
This commit is contained in:
@@ -22,6 +22,7 @@ type Settings struct {
|
||||
TitleModelID string `json:"title_model_id"`
|
||||
CompactionEnabled bool `json:"compaction_enabled"`
|
||||
CompactionThreshold int `json:"compaction_threshold"`
|
||||
CompactionRatio int `json:"compaction_ratio"`
|
||||
CompactionModelID string `json:"compaction_model_id,omitempty"`
|
||||
}
|
||||
|
||||
@@ -41,5 +42,6 @@ type UpsertRequest struct {
|
||||
TitleModelID string `json:"title_model_id,omitempty"`
|
||||
CompactionEnabled *bool `json:"compaction_enabled,omitempty"`
|
||||
CompactionThreshold *int `json:"compaction_threshold,omitempty"`
|
||||
CompactionRatio *int `json:"compaction_ratio,omitempty"`
|
||||
CompactionModelID *string `json:"compaction_model_id,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user