Uses of Record Class
com.tnsai.llm.observability.TokenUsage
Packages that use TokenUsage
-
Uses of TokenUsage in com.tnsai.llm.observability
Methods in com.tnsai.llm.observability that return TokenUsageModifier and TypeMethodDescriptionstatic TokenUsageTokenUsage.of(long promptTokens, long completionTokens) Convenience: minimal usage with only prompt + completion.LLMCallLog.usage()Returns the value of theusagerecord component.static TokenUsageTokenUsage.zero()Convenience: zero usage — placeholder for failed calls.Methods in com.tnsai.llm.observability with parameters of type TokenUsageModifier and TypeMethodDescriptionInMemoryLLMPricingRegistry.estimate(String provider, String model, TokenUsage usage) JsonLLMPricingRegistry.estimate(String provider, String model, TokenUsage usage) LLMPricingRegistry.estimate(String provider, String model, TokenUsage usage) Compute a USD cost estimate for the givenusageunder the namedprovider+model.LLMCallLog.Builder.usage(TokenUsage v) Constructors in com.tnsai.llm.observability with parameters of type TokenUsageModifierConstructorDescriptionLLMCallLog(String callId, Instant startedAt, Instant completedAt, Duration elapsed, String provider, String model, String endpoint, com.tnsai.observability.events.EventContext context, LLMPrompt prompt, ToolSurface tools, LLMResponse response, TokenUsage usage, CostEstimate cost, com.tnsai.llm.ChatChunk.FinishReason finishReason, Optional<StreamMetrics> streamMetrics, Optional<ErrorInfo> error, int retryAttempt, Map<String, Object> providerExtensions) Creates an instance of aLLMCallLogrecord class.