com.github.tjake.jlama.net.openai.model.RunStepCompletionUsage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jlama-net Show documentation
Show all versions of jlama-net Show documentation
Jlama: A modern LLM inference engine for Java
/*
* OpenAI API
* The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
*
* The version of the OpenAPI document: 2.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.github.tjake.jlama.net.openai.model;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import org.hibernate.validator.constraints.*;
import com.github.tjake.jlama.net.openai.JSON;
/**
* Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.
*/
@JsonPropertyOrder({
RunStepCompletionUsage.JSON_PROPERTY_COMPLETION_TOKENS,
RunStepCompletionUsage.JSON_PROPERTY_PROMPT_TOKENS,
RunStepCompletionUsage.JSON_PROPERTY_TOTAL_TOKENS
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class RunStepCompletionUsage {
public static final String JSON_PROPERTY_COMPLETION_TOKENS = "completion_tokens";
private Integer completionTokens;
public static final String JSON_PROPERTY_PROMPT_TOKENS = "prompt_tokens";
private Integer promptTokens;
public static final String JSON_PROPERTY_TOTAL_TOKENS = "total_tokens";
private Integer totalTokens;
public RunStepCompletionUsage() {
}
public RunStepCompletionUsage completionTokens(Integer completionTokens) {
this.completionTokens = completionTokens;
return this;
}
/**
* Number of completion tokens used over the course of the run step.
* @return completionTokens
*/
@jakarta.annotation.Nonnull
@NotNull
@JsonProperty(JSON_PROPERTY_COMPLETION_TOKENS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Integer getCompletionTokens() {
return completionTokens;
}
@JsonProperty(JSON_PROPERTY_COMPLETION_TOKENS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setCompletionTokens(Integer completionTokens) {
this.completionTokens = completionTokens;
}
public RunStepCompletionUsage promptTokens(Integer promptTokens) {
this.promptTokens = promptTokens;
return this;
}
/**
* Number of prompt tokens used over the course of the run step.
* @return promptTokens
*/
@jakarta.annotation.Nonnull
@NotNull
@JsonProperty(JSON_PROPERTY_PROMPT_TOKENS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Integer getPromptTokens() {
return promptTokens;
}
@JsonProperty(JSON_PROPERTY_PROMPT_TOKENS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setPromptTokens(Integer promptTokens) {
this.promptTokens = promptTokens;
}
public RunStepCompletionUsage totalTokens(Integer totalTokens) {
this.totalTokens = totalTokens;
return this;
}
/**
* Total number of tokens used (prompt + completion).
* @return totalTokens
*/
@jakarta.annotation.Nonnull
@NotNull
@JsonProperty(JSON_PROPERTY_TOTAL_TOKENS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Integer getTotalTokens() {
return totalTokens;
}
@JsonProperty(JSON_PROPERTY_TOTAL_TOKENS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setTotalTokens(Integer totalTokens) {
this.totalTokens = totalTokens;
}
/**
* Return true if this RunStepCompletionUsage object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
RunStepCompletionUsage runStepCompletionUsage = (RunStepCompletionUsage) o;
return Objects.equals(this.completionTokens, runStepCompletionUsage.completionTokens) &&
Objects.equals(this.promptTokens, runStepCompletionUsage.promptTokens) &&
Objects.equals(this.totalTokens, runStepCompletionUsage.totalTokens);
}
@Override
public int hashCode() {
return Objects.hash(completionTokens, promptTokens, totalTokens);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class RunStepCompletionUsage {\n");
sb.append(" completionTokens: ").append(toIndentedString(completionTokens)).append("\n");
sb.append(" promptTokens: ").append(toIndentedString(promptTokens)).append("\n");
sb.append(" totalTokens: ").append(toIndentedString(totalTokens)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}