modelcalllimits

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModelCallLimiter

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

func NewModelCallLimiter

func NewModelCallLimiter() *ModelCallLimiter

func (*ModelCallLimiter) CheckLimit

func (l *ModelCallLimiter) CheckLimit(model string) (bool, int, int)

func (*ModelCallLimiter) GetUsage

func (l *ModelCallLimiter) GetUsage() map[string]int

func (*ModelCallLimiter) RecordCall

func (l *ModelCallLimiter) RecordCall(model string) bool

func (*ModelCallLimiter) Reset

func (l *ModelCallLimiter) Reset(model string)

func (*ModelCallLimiter) ResetAll

func (l *ModelCallLimiter) ResetAll()

func (*ModelCallLimiter) SetLimit

func (l *ModelCallLimiter) SetLimit(model string, limit int)

type RateLimitTracker

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

func NewRateLimitTracker

func NewRateLimitTracker() *RateLimitTracker

func (*RateLimitTracker) GetAll

func (t *RateLimitTracker) GetAll() map[string]int

func (*RateLimitTracker) GetCount

func (t *RateLimitTracker) GetCount(model string, window time.Duration) int

func (*RateLimitTracker) Record

func (t *RateLimitTracker) Record(model string, statusCode int)

Jump to

Keyboard shortcuts

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