recorder

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CostEstimator

type CostEstimator interface {
	EstimatePromptCost(model string, tks int) (float64, error)
	EstimateCompletionCost(model string, tks int) (float64, error)
}

type Recorder

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

func NewRecorder

func NewRecorder(s Store, ce CostEstimator, openAiTotalCostPrefix string) *Recorder

func (*Recorder) RecordKeySpend

func (r *Recorder) RecordKeySpend(keyId string, model string, promptTks int, completionTks int) error

type Store

type Store interface {
	IncrementCounter(prefix string, keyId string, incr int64) error
}

Jump to

Keyboard shortcuts

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