token

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAPIKey = errors.New("ANTHROPIC_API_KEY environment variable not set")

Functions

func EstimateDocScoutTokens

func EstimateDocScoutTokens(i int) int

EstimateDocScoutTokens returns the estimated token cost when using DocScout tools to answer question at index i. Returns 0 for out-of-range indices.

func EstimateNaiveTokens

func EstimateNaiveTokens(i int) int

EstimateNaiveTokens returns the estimated token cost for a naive AI (no DocScout) to answer question at index i. Returns 0 for out-of-range indices.

func SavingsPct

func SavingsPct(docscout, naive int) float64

SavingsPct returns the percentage of tokens saved by using DocScout vs naive.

Types

type LiveResult

type LiveResult struct {
	Index int

	Question string

	DocScoutToks int

	NaiveToks int

	SavingsPct float64
}

type LiveRunner

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

func NewLiveRunner

func NewLiveRunner(_ context.Context) (*LiveRunner, error)

func (*LiveRunner) MeasureQuestion

func (r *LiveRunner) MeasureQuestion(ctx context.Context, idx int, question, docscoutContext, naiveContext string) (LiveResult, error)

type QuestionEstimate

type QuestionEstimate struct {
	Index        int
	DocScoutToks int
	NaiveToks    int
	SavingsPct   float64
}

QuestionEstimate holds theoretical token estimates for one canonical question.

func AllEstimates

func AllEstimates() []QuestionEstimate

AllEstimates returns theoretical estimates for all 12 canonical questions.

Jump to

Keyboard shortcuts

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