com.github.tjake.jlama.net.openai.model.DoneEvent 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
The newest version!
/*
* 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;
/**
* Occurs when a stream ends.
*/
@JsonPropertyOrder({
DoneEvent.JSON_PROPERTY_EVENT,
DoneEvent.JSON_PROPERTY_DATA
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class DoneEvent {
/**
* Gets or Sets event
*/
public enum EventEnum {
DONE("done");
private String value;
EventEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EventEnum fromValue(String value) {
for (EventEnum b : EventEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_EVENT = "event";
private EventEnum event;
/**
* Gets or Sets data
*/
public enum DataEnum {
_DONE_("[DONE]");
private String value;
DataEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static DataEnum fromValue(String value) {
for (DataEnum b : DataEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_DATA = "data";
private DataEnum data;
public DoneEvent() {
}
public DoneEvent event(EventEnum event) {
this.event = event;
return this;
}
/**
* Get event
* @return event
*/
@jakarta.annotation.Nonnull
@NotNull
@JsonProperty(JSON_PROPERTY_EVENT)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public EventEnum getEvent() {
return event;
}
@JsonProperty(JSON_PROPERTY_EVENT)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setEvent(EventEnum event) {
this.event = event;
}
public DoneEvent data(DataEnum data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
*/
@jakarta.annotation.Nonnull
@NotNull
@JsonProperty(JSON_PROPERTY_DATA)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public DataEnum getData() {
return data;
}
@JsonProperty(JSON_PROPERTY_DATA)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setData(DataEnum data) {
this.data = data;
}
/**
* Return true if this DoneEvent object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DoneEvent doneEvent = (DoneEvent) o;
return Objects.equals(this.event, doneEvent.event) &&
Objects.equals(this.data, doneEvent.data);
}
@Override
public int hashCode() {
return Objects.hash(event, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DoneEvent {\n");
sb.append(" event: ").append(toIndentedString(event)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).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 ");
}
}