Uses of Class
dev.langchain4j.model.output.TokenUsage
Packages that use TokenUsage
Package
Description
-
Uses of TokenUsage in dev.langchain4j.model.anthropic
Subclasses of TokenUsage in dev.langchain4j.model.anthropic -
Uses of TokenUsage in dev.langchain4j.model.anthropic.internal.mapper
Methods in dev.langchain4j.model.anthropic.internal.mapper that return TokenUsageModifier and TypeMethodDescriptionstatic TokenUsage
AnthropicMapper.toTokenUsage
(AnthropicUsage anthropicUsage) -
Uses of TokenUsage in dev.langchain4j.model.bedrock
Methods in dev.langchain4j.model.bedrock that return TokenUsageModifier and TypeMethodDescriptionBedrockAI21LabsChatModelResponse.getTokenUsage()
BedrockAnthropicCompletionChatModelResponse.getTokenUsage()
BedrockAnthropicMessageChatModelResponse.getTokenUsage()
BedrockCohereChatModelResponse.getTokenUsage()
BedrockLlamaChatModelResponse.getTokenUsage()
BedrockStabilityAIChatModelResponse.getTokenUsage()
BedrockTitanChatModelResponse.getTokenUsage()
-
Uses of TokenUsage in dev.langchain4j.model.bedrock.internal
Methods in dev.langchain4j.model.bedrock.internal that return TokenUsage -
Uses of TokenUsage in dev.langchain4j.model.chat.listener
Methods in dev.langchain4j.model.chat.listener that return TokenUsageModifier and TypeMethodDescriptionChatModelResponse.tokenUsage()
Deprecated, for removal: This API element is subject to removal in a future version.Methods in dev.langchain4j.model.chat.listener with parameters of type TokenUsageModifier and TypeMethodDescriptionChatModelResponse.ChatModelResponseBuilder.tokenUsage
(TokenUsage tokenUsage) Constructors in dev.langchain4j.model.chat.listener with parameters of type TokenUsageModifierConstructorDescriptionChatModelResponse
(String id, String model, TokenUsage tokenUsage, FinishReason finishReason, AiMessage aiMessage) Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of TokenUsage in dev.langchain4j.model.chat.response
Methods in dev.langchain4j.model.chat.response that return TokenUsageMethods in dev.langchain4j.model.chat.response with parameters of type TokenUsageModifier and TypeMethodDescriptionChatResponse.Builder.tokenUsage
(TokenUsage tokenUsage) ChatResponseMetadata.Builder.tokenUsage
(TokenUsage tokenUsage) -
Uses of TokenUsage in dev.langchain4j.model.mistralai.internal.mapper
Methods in dev.langchain4j.model.mistralai.internal.mapper that return TokenUsageModifier and TypeMethodDescriptionstatic TokenUsage
MistralAiMapper.tokenUsageFrom
(MistralAiUsage mistralAiUsage) -
Uses of TokenUsage in dev.langchain4j.model.openai
Subclasses of TokenUsage in dev.langchain4j.model.openai -
Uses of TokenUsage in dev.langchain4j.model.output
Methods in dev.langchain4j.model.output that return TokenUsageModifier and TypeMethodDescriptionTokenUsage.add
(TokenUsage that) Adds the token usage of two responses together.static TokenUsage
TokenUsage.sum
(TokenUsage first, TokenUsage second) Adds two token usages.Response.tokenUsage()
Get the token usage statistics.Methods in dev.langchain4j.model.output with parameters of type TokenUsageModifier and TypeMethodDescriptionTokenUsage.add
(TokenUsage that) Adds the token usage of two responses together.static <T> @NonNull Response
<T> Response.from
(@NonNull T content, TokenUsage tokenUsage) Create a new Response.static <T> @NonNull Response
<T> Response.from
(@NonNull T content, TokenUsage tokenUsage, FinishReason finishReason) Create a new Response.static <T> @NonNull Response
<T> Response.from
(@NonNull T content, TokenUsage tokenUsage, FinishReason finishReason, @Nullable Map<String, Object> metadata) Create a new Response.static TokenUsage
TokenUsage.sum
(TokenUsage first, TokenUsage second) Adds two token usages.Constructors in dev.langchain4j.model.output with parameters of type TokenUsageModifierConstructorDescriptionResponse
(@NonNull T content, TokenUsage tokenUsage, FinishReason finishReason) Create a new Response.Response
(@NonNull T content, TokenUsage tokenUsage, FinishReason finishReason, @Nullable Map<String, Object> metadata) Create a new Response. -
Uses of TokenUsage in dev.langchain4j.service
Methods in dev.langchain4j.service that return TokenUsageMethods in dev.langchain4j.service with parameters of type TokenUsageConstructors in dev.langchain4j.service with parameters of type TokenUsageModifierConstructorDescriptionResult
(T content, TokenUsage tokenUsage, List<Content> sources, FinishReason finishReason, List<ToolExecution> toolExecutions) -
Uses of TokenUsage in dev.langchain4j.service.tool
Methods in dev.langchain4j.service.tool that return TokenUsageModifier and TypeMethodDescriptionToolExecutionResult.tokenUsageAccumulator()
Returns the value of thetokenUsageAccumulator
record component.Constructors in dev.langchain4j.service.tool with parameters of type TokenUsageModifierConstructorDescriptionToolExecutionResult
(ChatResponse chatResponse, List<ToolExecution> toolExecutions, TokenUsage tokenUsageAccumulator) Creates an instance of aToolExecutionResult
record class. -
Uses of TokenUsage in dev.langchain4j.store.embedding
Methods in dev.langchain4j.store.embedding that return TokenUsageConstructors in dev.langchain4j.store.embedding with parameters of type TokenUsage