com.github.tjake.jlama.net.openai.model.FineTuneChatCompletionRequestAssistantMessage 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 com.github.tjake.jlama.net.openai.model.ChatCompletionMessageToolCall;
import com.github.tjake.jlama.net.openai.model.ChatCompletionRequestAssistantMessageFunctionCall;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
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;
/**
* FineTuneChatCompletionRequestAssistantMessage
*/
@JsonPropertyOrder({
FineTuneChatCompletionRequestAssistantMessage.JSON_PROPERTY_CONTENT,
FineTuneChatCompletionRequestAssistantMessage.JSON_PROPERTY_ROLE,
FineTuneChatCompletionRequestAssistantMessage.JSON_PROPERTY_NAME,
FineTuneChatCompletionRequestAssistantMessage.JSON_PROPERTY_TOOL_CALLS,
FineTuneChatCompletionRequestAssistantMessage.JSON_PROPERTY_FUNCTION_CALL,
FineTuneChatCompletionRequestAssistantMessage.JSON_PROPERTY_WEIGHT
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class FineTuneChatCompletionRequestAssistantMessage {
public static final String JSON_PROPERTY_CONTENT = "content";
private String content;
public static final String JSON_PROPERTY_ROLE = "role";
private String role = "assistant";
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public static final String JSON_PROPERTY_TOOL_CALLS = "tool_calls";
private List<@Valid ChatCompletionMessageToolCall> toolCalls;
public static final String JSON_PROPERTY_FUNCTION_CALL = "function_call";
@Deprecated
private ChatCompletionRequestAssistantMessageFunctionCall functionCall;
/**
* Controls whether the assistant message is trained against (0 or 1)
*/
public enum WeightEnum {
NUMBER_0(0),
NUMBER_1(1);
private Integer value;
WeightEnum(Integer value) {
this.value = value;
}
@JsonValue
public Integer getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static WeightEnum fromValue(Integer value) {
for (WeightEnum b : WeightEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_WEIGHT = "weight";
private WeightEnum weight;
public FineTuneChatCompletionRequestAssistantMessage() {
}
public FineTuneChatCompletionRequestAssistantMessage content(String content) {
this.content = content;
return this;
}
/**
* The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
* @return content
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CONTENT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getContent() {
return content;
}
@JsonProperty(JSON_PROPERTY_CONTENT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setContent(String content) {
this.content = content;
}
public FineTuneChatCompletionRequestAssistantMessage role(String role) {
this.role = role;
return this;
}
/**
* The role of the messages author, in this case `assistant`.
* @return role
*/
@jakarta.annotation.Nonnull
@NotNull
@JsonProperty(JSON_PROPERTY_ROLE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getRole() {
return role;
}
@JsonProperty(JSON_PROPERTY_ROLE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setRole(String role) {
this.role = role;
}
public FineTuneChatCompletionRequestAssistantMessage name(String name) {
this.name = name;
return this;
}
/**
* An optional name for the participant. Provides the model information to differentiate between participants of the same role.
* @return name
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
this.name = name;
}
public FineTuneChatCompletionRequestAssistantMessage toolCalls(List<@Valid ChatCompletionMessageToolCall> toolCalls) {
this.toolCalls = toolCalls;
return this;
}
public FineTuneChatCompletionRequestAssistantMessage addToolCallsItem(ChatCompletionMessageToolCall toolCallsItem) {
if (this.toolCalls == null) {
this.toolCalls = new ArrayList<>();
}
this.toolCalls.add(toolCallsItem);
return this;
}
/**
* The tool calls generated by the model, such as function calls.
* @return toolCalls
*/
@jakarta.annotation.Nullable
@Valid
@JsonProperty(JSON_PROPERTY_TOOL_CALLS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<@Valid ChatCompletionMessageToolCall> getToolCalls() {
return toolCalls;
}
@JsonProperty(JSON_PROPERTY_TOOL_CALLS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setToolCalls(List<@Valid ChatCompletionMessageToolCall> toolCalls) {
this.toolCalls = toolCalls;
}
@Deprecated
public FineTuneChatCompletionRequestAssistantMessage functionCall(ChatCompletionRequestAssistantMessageFunctionCall functionCall) {
this.functionCall = functionCall;
return this;
}
/**
* Get functionCall
* @return functionCall
* @deprecated
*/
@Deprecated
@jakarta.annotation.Nullable
@Valid
@JsonProperty(JSON_PROPERTY_FUNCTION_CALL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public ChatCompletionRequestAssistantMessageFunctionCall getFunctionCall() {
return functionCall;
}
@Deprecated
@JsonProperty(JSON_PROPERTY_FUNCTION_CALL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setFunctionCall(ChatCompletionRequestAssistantMessageFunctionCall functionCall) {
this.functionCall = functionCall;
}
public FineTuneChatCompletionRequestAssistantMessage weight(WeightEnum weight) {
this.weight = weight;
return this;
}
/**
* Controls whether the assistant message is trained against (0 or 1)
* @return weight
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_WEIGHT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public WeightEnum getWeight() {
return weight;
}
@JsonProperty(JSON_PROPERTY_WEIGHT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setWeight(WeightEnum weight) {
this.weight = weight;
}
/**
* Return true if this FineTuneChatCompletionRequestAssistantMessage object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FineTuneChatCompletionRequestAssistantMessage fineTuneChatCompletionRequestAssistantMessage = (FineTuneChatCompletionRequestAssistantMessage) o;
return Objects.equals(this.content, fineTuneChatCompletionRequestAssistantMessage.content) &&
Objects.equals(this.role, fineTuneChatCompletionRequestAssistantMessage.role) &&
Objects.equals(this.name, fineTuneChatCompletionRequestAssistantMessage.name) &&
Objects.equals(this.toolCalls, fineTuneChatCompletionRequestAssistantMessage.toolCalls) &&
Objects.equals(this.functionCall, fineTuneChatCompletionRequestAssistantMessage.functionCall) &&
Objects.equals(this.weight, fineTuneChatCompletionRequestAssistantMessage.weight);
}
@Override
public int hashCode() {
return Objects.hash(content, role, name, toolCalls, functionCall, weight);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FineTuneChatCompletionRequestAssistantMessage {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" role: ").append(toIndentedString(role)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" toolCalls: ").append(toIndentedString(toolCalls)).append("\n");
sb.append(" functionCall: ").append(toIndentedString(functionCall)).append("\n");
sb.append(" weight: ").append(toIndentedString(weight)).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 ");
}
}