Class OpenAIRequestResponse.Usage
java.lang.Object
com.developer.nefarious.zjoule.plugin.chat.openai.OpenAIRequestResponse.Usage
- Enclosing class:
OpenAIRequestResponse
Represents the token usage details in the OpenAI API response.
Includes the number of tokens used for the prompt, completion, and total.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Retrieves the number of tokens used for the completion.int
Retrieves the number of tokens used for the prompt.int
Retrieves the total number of tokens used for the request.void
setCompletionTokens
(int completionTokens) Sets the number of tokens used for the completion.void
setPromptTokens
(int promptTokens) Sets the number of tokens used for the prompt.void
setTotalTokens
(int totalTokens) Sets the total number of tokens used for the request.
-
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 anint
.
-
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 anint
.
-
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 anint
.
-