Documentation
¶
Overview ¶
Package compression provides the compression service interface. This service wraps the 31-layer filter pipeline for microservice deployment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompressRequest ¶
type CompressRequest struct {
Input string // Text to compress
Mode filter.Mode // Compression mode (none/minimal/aggressive)
QueryIntent string // Query intent for query-aware compression
Budget int // Token budget (0 = unlimited)
Preset string // Pipeline preset (fast/balanced/full)
}
CompressRequest is the input for compression.
type CompressResponse ¶
type CompressResponse struct {
Output string // Compressed text
OriginalSize int // Original token count
CompressedSize int // Compressed token count
SavingsPercent float64 // Token savings percentage
LayersApplied []string // List of layers that were applied
}
CompressResponse is the output from compression.
type CompressionService ¶
type CompressionService interface {
// Compress applies the 31-layer compression pipeline to input text.
Compress(ctx context.Context, req *CompressRequest) (*CompressResponse, error)
// GetStats returns compression statistics.
GetStats(ctx context.Context) (*StatsResponse, error)
// GetLayers returns information about all compression layers.
GetLayers(ctx context.Context) ([]LayerInfo, error)
}
CompressionService defines the interface for the compression service.
type LayerInfo ¶
type LayerInfo struct {
Name string // Layer name
Number int // Layer number (1-31)
Research string // Research paper source
Compression string // Typical compression ratio
}
LayerInfo describes a compression layer.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements CompressionService using the filter pipeline.
func NewService ¶
func NewService(cfg filter.PipelineConfig) *Service
NewService creates a new compression service.
func (*Service) Compress ¶
func (s *Service) Compress(ctx context.Context, req *CompressRequest) (*CompressResponse, error)
Compress implements CompressionService.
Click to show internal directories.
Click to hide internal directories.