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
Click to show internal directories.
Click to hide internal directories.