streamusage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package streamusage reconstructs scoped usage for completed streaming calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Policy        domain.BillingPolicy
	ProxyBillable bool
}

type Counter

type Counter interface {
	CountCall(context.Context, app.CountCallInput) (app.CountResult, error)
	CountOutput(context.Context, app.CountOutputInput) (app.CountResult, error)
}

type Input

type Input struct {
	Backend    string
	Model      string
	Call       lipapi.Call
	OutputText string
	Events     []lipapi.Event
}

type Reconstructor

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

func New

func New(counter Counter, cfg Config) *Reconstructor

func (*Reconstructor) Reconstruct

func (r *Reconstructor) Reconstruct(ctx context.Context, input Input) (Result, error)

type Result

type Result struct {
	Events     []lipapi.Event
	Reconciled domain.Result
	Warnings   []Warning
	Err        error
}

type Warning

type Warning struct {
	Code    WarningCode
	Message string
	Err     error
}

type WarningCode

type WarningCode string
const (
	WarningInputCountUnavailable  WarningCode = "input_count_unavailable"
	WarningOutputCountUnavailable WarningCode = "output_count_unavailable"
	WarningContextCanceled        WarningCode = "context_canceled"
)

Jump to

Keyboard shortcuts

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