Package dev.langchain4j.model.openai
Class OpenAiTokenUsage
java.lang.Object
dev.langchain4j.model.output.TokenUsage
dev.langchain4j.model.openai.OpenAiTokenUsage
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
-
Method Summary
Modifier and TypeMethodDescriptionadd
(TokenUsage that) Adds the token usage of two responses together.static OpenAiTokenUsage.Builder
builder()
boolean
int
hashCode()
toString()
Methods inherited from class dev.langchain4j.model.output.TokenUsage
inputTokenCount, outputTokenCount, sum, sum, totalTokenCount
-
Method Details
-
inputTokensDetails
-
outputTokensDetails
-
add
Description copied from class:TokenUsage
Adds the token usage of two responses together.Fields which are null in both responses will be null in the result.
- Overrides:
add
in classTokenUsage
- Parameters:
that
- The token usage to add to this one.- Returns:
- a new
TokenUsage
instance with the token usage of both responses added together.
-
equals
- Overrides:
equals
in classTokenUsage
-
hashCode
public int hashCode()- Overrides:
hashCode
in classTokenUsage
-
toString
- Overrides:
toString
in classTokenUsage
-
builder
-