com.github.tjake.jlama.net.openai.model.CreateChatCompletionFunctionResponseChoicesInner Maven / Gradle / Ivy
/*
* 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 com.github.tjake.jlama.net.openai.model.ChatCompletionResponseMessage;
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;
/**
* CreateChatCompletionFunctionResponseChoicesInner
*/
@JsonPropertyOrder({
CreateChatCompletionFunctionResponseChoicesInner.JSON_PROPERTY_FINISH_REASON,
CreateChatCompletionFunctionResponseChoicesInner.JSON_PROPERTY_INDEX,
CreateChatCompletionFunctionResponseChoicesInner.JSON_PROPERTY_MESSAGE
})
@JsonTypeName("CreateChatCompletionFunctionResponse_choices_inner")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class CreateChatCompletionFunctionResponseChoicesInner {
/**
* The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, or `function_call` if the model called a function.
*/
public enum FinishReasonEnum {
STOP("stop"),
LENGTH("length"),
FUNCTION_CALL("function_call"),
CONTENT_FILTER("content_filter");
private String value;
FinishReasonEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static FinishReasonEnum fromValue(String value) {
for (FinishReasonEnum b : FinishReasonEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_FINISH_REASON = "finish_reason";
private FinishReasonEnum finishReason;
public static final String JSON_PROPERTY_INDEX = "index";
private Integer index;
public static final String JSON_PROPERTY_MESSAGE = "message";
private ChatCompletionResponseMessage message;
public CreateChatCompletionFunctionResponseChoicesInner() {
}
public CreateChatCompletionFunctionResponseChoicesInner finishReason(FinishReasonEnum finishReason) {
this.finishReason = finishReason;
return this;
}
/**
* The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, or `function_call` if the model called a function.
* @return finishReason
*/
@jakarta.annotation.Nonnull
@NotNull
@JsonProperty(JSON_PROPERTY_FINISH_REASON)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public FinishReasonEnum getFinishReason() {
return finishReason;
}
@JsonProperty(JSON_PROPERTY_FINISH_REASON)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setFinishReason(FinishReasonEnum finishReason) {
this.finishReason = finishReason;
}
public CreateChatCompletionFunctionResponseChoicesInner index(Integer index) {
this.index = index;
return this;
}
/**
* The index of the choice in the list of choices.
* @return index
*/
@jakarta.annotation.Nonnull
@NotNull
@JsonProperty(JSON_PROPERTY_INDEX)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Integer getIndex() {
return index;
}
@JsonProperty(JSON_PROPERTY_INDEX)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setIndex(Integer index) {
this.index = index;
}
public CreateChatCompletionFunctionResponseChoicesInner message(ChatCompletionResponseMessage message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
*/
@jakarta.annotation.Nonnull
@NotNull
@Valid
@JsonProperty(JSON_PROPERTY_MESSAGE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public ChatCompletionResponseMessage getMessage() {
return message;
}
@JsonProperty(JSON_PROPERTY_MESSAGE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setMessage(ChatCompletionResponseMessage message) {
this.message = message;
}
/**
* Return true if this CreateChatCompletionFunctionResponse_choices_inner object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateChatCompletionFunctionResponseChoicesInner createChatCompletionFunctionResponseChoicesInner = (CreateChatCompletionFunctionResponseChoicesInner) o;
return Objects.equals(this.finishReason, createChatCompletionFunctionResponseChoicesInner.finishReason) &&
Objects.equals(this.index, createChatCompletionFunctionResponseChoicesInner.index) &&
Objects.equals(this.message, createChatCompletionFunctionResponseChoicesInner.message);
}
@Override
public int hashCode() {
return Objects.hash(finishReason, index, message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateChatCompletionFunctionResponseChoicesInner {\n");
sb.append(" finishReason: ").append(toIndentedString(finishReason)).append("\n");
sb.append(" index: ").append(toIndentedString(index)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
}