requestestimate

package
v7.57.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT, MIT Imports: 17 Imported by: 0

Documentation

Overview

Package requestestimate counts frozen provider input without retaining text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribution added in v7.47.0

type Attribution struct {
	Path, Category, Key, Source, Namespace string
	Parts                                  []Part
}

Attribution is metadata over a decoded frozen payload, never model input.

type Estimate

type Estimate struct {
	Prefix, Messages, Tools int64
	Media                   int64
	Source, Method          string
	Breakdown               contextpolicy.ContextBreakdown
}

func Count

func Count(provider, model, format string, payload []byte) (Estimate, error)

func CountAttributed added in v7.47.0

func CountAttributed(provider, model, format string, payload []byte, attrs []Attribution) (Estimate, error)

type Part added in v7.47.0

type Part struct {
	Category   string
	Start, End int
	Key        string
}

Jump to

Keyboard shortcuts

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