Class TokenUsage

    • Method Detail

      • inputTokens

        public final Integer inputTokens()

        The number of tokens sent in the request to the model.

        Returns:
        The number of tokens sent in the request to the model.
      • outputTokens

        public final Integer outputTokens()

        The number of tokens that the model generated for the request.

        Returns:
        The number of tokens that the model generated for the request.
      • totalTokens

        public final Integer totalTokens()

        The total of input tokens and tokens generated by the model.

        Returns:
        The total of input tokens and tokens generated by the model.
      • cacheReadInputTokens

        public final Integer cacheReadInputTokens()

        The number of input tokens read from the cache for the request.

        Returns:
        The number of input tokens read from the cache for the request.
      • cacheWriteInputTokens

        public final Integer cacheWriteInputTokens()

        The number of input tokens written to the cache for the request.

        Returns:
        The number of input tokens written to the cache for the request.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)