Class OpenAIRequestResponse.Usage

java.lang.Object
com.developer.nefarious.zjoule.plugin.chat.openai.OpenAIRequestResponse.Usage
Enclosing class:
OpenAIRequestResponse

public static class OpenAIRequestResponse.Usage extends Object
Represents the token usage details in the OpenAI API response. Includes the number of tokens used for the prompt, completion, and total.
  • Constructor Details

    • Usage

      public Usage()
  • Method Details

    • getPromptTokens

      public int getPromptTokens()
      Retrieves the number of tokens used for the prompt.
      Returns:
      the prompt tokens as an int.
    • setPromptTokens

      public void setPromptTokens(int promptTokens)
      Sets the number of tokens used for the prompt.
      Parameters:
      promptTokens - the prompt tokens as an int.
    • getCompletionTokens

      public int getCompletionTokens()
      Retrieves the number of tokens used for the completion.
      Returns:
      the completion tokens as an int.
    • setCompletionTokens

      public void setCompletionTokens(int completionTokens)
      Sets the number of tokens used for the completion.
      Parameters:
      completionTokens - the completion tokens as an int.
    • getTotalTokens

      public int getTotalTokens()
      Retrieves the total number of tokens used for the request.
      Returns:
      the total tokens as an int.
    • setTotalTokens

      public void setTotalTokens(int totalTokens)
      Sets the total number of tokens used for the request.
      Parameters:
      totalTokens - the total tokens as an int.