responsecompress

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseCompressor

type ResponseCompressor struct {
	// contains filtered or unexported fields
}

func NewResponseCompressor

func NewResponseCompressor() *ResponseCompressor

func (*ResponseCompressor) Compress

func (rc *ResponseCompressor) Compress(response string) string

func (*ResponseCompressor) SetMaxTokens

func (rc *ResponseCompressor) SetMaxTokens(n int)

func (*ResponseCompressor) SetStripFiller

func (rc *ResponseCompressor) SetStripFiller(v bool)

func (*ResponseCompressor) SetStripWhitespace

func (rc *ResponseCompressor) SetStripWhitespace(v bool)

type ResponseMetrics

type ResponseMetrics struct {
	OriginalTokens   int     `json:"original_tokens"`
	CompressedTokens int     `json:"compressed_tokens"`
	Savings          int     `json:"savings"`
	SavingsPct       float64 `json:"savings_pct"`
}

func CalculateResponseMetrics

func CalculateResponseMetrics(original, compressed string) *ResponseMetrics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL