Interface TokenUsage


@Experimental public interface TokenUsage
Information about the token usage of a request.
Since:
5.2.240708
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull TokenUsage
    create(int request, int response, int total)
    Creates a new instance.
    int
    The tokens consumed by the request.
    int
    The tokens consumed by the AI response.
    int
    The total number of tokens consumed.
  • Method Details

    • create

      @NotNull static @NotNull TokenUsage create(int request, int response, int total)
      Creates a new instance.
      Parameters:
      request - The tokens consumed by the request.
      response - The tokens consumed by the response.
      total - The tokens consumed in total.
      Returns:
      The new instance.
      Since:
      5.2.240708
    • getRequest

      int getRequest()
      The tokens consumed by the request.
      Returns:
      The request tokens.
      Since:
      5.2.240708
    • getResponse

      int getResponse()
      The tokens consumed by the AI response.
      Returns:
      The response tokens.
      Since:
      5.2.240708
    • getTotal

      int getTotal()
      The total number of tokens consumed.
      Returns:
      The total tokens.
      Since:
      5.2.240708