Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoAPIKey = errors.New("ANTHROPIC_API_KEY environment variable not set")
ErrNoAPIKey is returned by NewLiveRunner when ANTHROPIC_API_KEY is not set.
Functions ¶
func EstimateDocScoutTokens ¶
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 ¶
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 ¶
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
}
LiveResult holds token measurements for a single question comparison.
type LiveRunner ¶
type LiveRunner struct {
// contains filtered or unexported fields
}
LiveRunner measures real token usage by calling the Anthropic API.
func NewLiveRunner ¶
func NewLiveRunner(_ context.Context) (*LiveRunner, error)
NewLiveRunner creates a LiveRunner. It reads the API key from ANTHROPIC_API_KEY and returns ErrNoAPIKey if the variable is empty. No network call is made.
func (*LiveRunner) MeasureQuestion ¶
func (r *LiveRunner) MeasureQuestion(ctx context.Context, idx int, question, docscoutContext, naiveContext string) (LiveResult, error)
MeasureQuestion calls Claude twice — once with docscoutContext and once with naiveContext — and returns the input token counts for each. MaxTokens is intentionally limited to 100 to keep API costs low.
type QuestionEstimate ¶
QuestionEstimate holds theoretical token estimates for one canonical question.
func AllEstimates ¶
func AllEstimates() []QuestionEstimate
AllEstimates returns theoretical estimates for all 12 canonical questions.