accounting

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenAccountant

type TokenAccountant struct {
	sleipnir.BaseMiddleware
	// contains filtered or unexported fields
}

TokenAccountant is an LLMObserver that tracks per-agent token usage. Failed LLM calls are not counted.

func (*TokenAccountant) ByAgent

func (a *TokenAccountant) ByAgent(name string) sleipnir.Usage

func (*TokenAccountant) OnLLMCall

func (a *TokenAccountant) OnLLMCall(_ context.Context, req *sleipnir.LLMRequest, resp *sleipnir.LLMResponse, err error)

func (*TokenAccountant) Total

func (a *TokenAccountant) Total() sleipnir.Usage

Jump to

Keyboard shortcuts

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