cacheusage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProviderPromptCacheUsageSignals

type ProviderPromptCacheUsageSignals struct {
	PromptTokens             int64
	CachedTokens             int64
	CacheCreationInputTokens int64
	SemanticCacheHit         bool
	// AnthropicUsage 记录日志里**存在** cache_creation_input_tokens 这个键,
	// 与它的值无关。relay/metrics.go 只在 Usage.AnthropicUsage 为真时才把该键
	// 拼进 response_content(两个字段都是 json:"-",拼字符串是唯一通道),
	// 所以键存在等价于「prompt_tokens 不含缓存读 token」。暖前缀纯命中时值是 0,
	// 因此判据只能是键的有无,不能是值的大小。
	AnthropicUsage bool
}

func ParseProviderPromptCacheUsageSignals

func ParseProviderPromptCacheUsageSignals(responseContent string) (ProviderPromptCacheUsageSignals, bool)

Jump to

Keyboard shortcuts

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