TAIResource.java
/**
* Autogenerated by Thrift Compiler (0.16.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.doris.thrift;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class TAIResource implements org.apache.thrift.TBase<TAIResource, TAIResource._Fields>, java.io.Serializable, Cloneable, Comparable<TAIResource> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAIResource");
private static final org.apache.thrift.protocol.TField ENDPOINT_FIELD_DESC = new org.apache.thrift.protocol.TField("endpoint", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField PROVIDER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("provider_type", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField MODEL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("model_name", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField API_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("api_key", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField TEMPERATURE_FIELD_DESC = new org.apache.thrift.protocol.TField("temperature", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
private static final org.apache.thrift.protocol.TField MAX_TOKENS_FIELD_DESC = new org.apache.thrift.protocol.TField("max_tokens", org.apache.thrift.protocol.TType.I64, (short)6);
private static final org.apache.thrift.protocol.TField MAX_RETRIES_FIELD_DESC = new org.apache.thrift.protocol.TField("max_retries", org.apache.thrift.protocol.TType.I32, (short)7);
private static final org.apache.thrift.protocol.TField RETRY_DELAY_SECOND_FIELD_DESC = new org.apache.thrift.protocol.TField("retry_delay_second", org.apache.thrift.protocol.TType.I32, (short)8);
private static final org.apache.thrift.protocol.TField ANTHROPIC_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("anthropic_version", org.apache.thrift.protocol.TType.STRING, (short)9);
private static final org.apache.thrift.protocol.TField DIMENSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("dimensions", org.apache.thrift.protocol.TType.I32, (short)10);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TAIResourceStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TAIResourceTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.lang.String endpoint; // required
public @org.apache.thrift.annotation.Nullable java.lang.String provider_type; // required
public @org.apache.thrift.annotation.Nullable java.lang.String model_name; // required
public @org.apache.thrift.annotation.Nullable java.lang.String api_key; // optional
public double temperature; // optional
public long max_tokens; // optional
public int max_retries; // optional
public int retry_delay_second; // optional
public @org.apache.thrift.annotation.Nullable java.lang.String anthropic_version; // optional
public int dimensions; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ENDPOINT((short)1, "endpoint"),
PROVIDER_TYPE((short)2, "provider_type"),
MODEL_NAME((short)3, "model_name"),
API_KEY((short)4, "api_key"),
TEMPERATURE((short)5, "temperature"),
MAX_TOKENS((short)6, "max_tokens"),
MAX_RETRIES((short)7, "max_retries"),
RETRY_DELAY_SECOND((short)8, "retry_delay_second"),
ANTHROPIC_VERSION((short)9, "anthropic_version"),
DIMENSIONS((short)10, "dimensions");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ENDPOINT
return ENDPOINT;
case 2: // PROVIDER_TYPE
return PROVIDER_TYPE;
case 3: // MODEL_NAME
return MODEL_NAME;
case 4: // API_KEY
return API_KEY;
case 5: // TEMPERATURE
return TEMPERATURE;
case 6: // MAX_TOKENS
return MAX_TOKENS;
case 7: // MAX_RETRIES
return MAX_RETRIES;
case 8: // RETRY_DELAY_SECOND
return RETRY_DELAY_SECOND;
case 9: // ANTHROPIC_VERSION
return ANTHROPIC_VERSION;
case 10: // DIMENSIONS
return DIMENSIONS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __TEMPERATURE_ISSET_ID = 0;
private static final int __MAX_TOKENS_ISSET_ID = 1;
private static final int __MAX_RETRIES_ISSET_ID = 2;
private static final int __RETRY_DELAY_SECOND_ISSET_ID = 3;
private static final int __DIMENSIONS_ISSET_ID = 4;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.API_KEY,_Fields.TEMPERATURE,_Fields.MAX_TOKENS,_Fields.MAX_RETRIES,_Fields.RETRY_DELAY_SECOND,_Fields.ANTHROPIC_VERSION,_Fields.DIMENSIONS};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ENDPOINT, new org.apache.thrift.meta_data.FieldMetaData("endpoint", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PROVIDER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("provider_type", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.MODEL_NAME, new org.apache.thrift.meta_data.FieldMetaData("model_name", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.API_KEY, new org.apache.thrift.meta_data.FieldMetaData("api_key", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TEMPERATURE, new org.apache.thrift.meta_data.FieldMetaData("temperature", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
tmpMap.put(_Fields.MAX_TOKENS, new org.apache.thrift.meta_data.FieldMetaData("max_tokens", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.MAX_RETRIES, new org.apache.thrift.meta_data.FieldMetaData("max_retries", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.RETRY_DELAY_SECOND, new org.apache.thrift.meta_data.FieldMetaData("retry_delay_second", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.ANTHROPIC_VERSION, new org.apache.thrift.meta_data.FieldMetaData("anthropic_version", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.DIMENSIONS, new org.apache.thrift.meta_data.FieldMetaData("dimensions", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TAIResource.class, metaDataMap);
}
public TAIResource() {
}
public TAIResource(
java.lang.String endpoint,
java.lang.String provider_type,
java.lang.String model_name)
{
this();
this.endpoint = endpoint;
this.provider_type = provider_type;
this.model_name = model_name;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TAIResource(TAIResource other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetEndpoint()) {
this.endpoint = other.endpoint;
}
if (other.isSetProviderType()) {
this.provider_type = other.provider_type;
}
if (other.isSetModelName()) {
this.model_name = other.model_name;
}
if (other.isSetApiKey()) {
this.api_key = other.api_key;
}
this.temperature = other.temperature;
this.max_tokens = other.max_tokens;
this.max_retries = other.max_retries;
this.retry_delay_second = other.retry_delay_second;
if (other.isSetAnthropicVersion()) {
this.anthropic_version = other.anthropic_version;
}
this.dimensions = other.dimensions;
}
public TAIResource deepCopy() {
return new TAIResource(this);
}
@Override
public void clear() {
this.endpoint = null;
this.provider_type = null;
this.model_name = null;
this.api_key = null;
setTemperatureIsSet(false);
this.temperature = 0.0;
setMaxTokensIsSet(false);
this.max_tokens = 0;
setMaxRetriesIsSet(false);
this.max_retries = 0;
setRetryDelaySecondIsSet(false);
this.retry_delay_second = 0;
this.anthropic_version = null;
setDimensionsIsSet(false);
this.dimensions = 0;
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getEndpoint() {
return this.endpoint;
}
public TAIResource setEndpoint(@org.apache.thrift.annotation.Nullable java.lang.String endpoint) {
this.endpoint = endpoint;
return this;
}
public void unsetEndpoint() {
this.endpoint = null;
}
/** Returns true if field endpoint is set (has been assigned a value) and false otherwise */
public boolean isSetEndpoint() {
return this.endpoint != null;
}
public void setEndpointIsSet(boolean value) {
if (!value) {
this.endpoint = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getProviderType() {
return this.provider_type;
}
public TAIResource setProviderType(@org.apache.thrift.annotation.Nullable java.lang.String provider_type) {
this.provider_type = provider_type;
return this;
}
public void unsetProviderType() {
this.provider_type = null;
}
/** Returns true if field provider_type is set (has been assigned a value) and false otherwise */
public boolean isSetProviderType() {
return this.provider_type != null;
}
public void setProviderTypeIsSet(boolean value) {
if (!value) {
this.provider_type = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getModelName() {
return this.model_name;
}
public TAIResource setModelName(@org.apache.thrift.annotation.Nullable java.lang.String model_name) {
this.model_name = model_name;
return this;
}
public void unsetModelName() {
this.model_name = null;
}
/** Returns true if field model_name is set (has been assigned a value) and false otherwise */
public boolean isSetModelName() {
return this.model_name != null;
}
public void setModelNameIsSet(boolean value) {
if (!value) {
this.model_name = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getApiKey() {
return this.api_key;
}
public TAIResource setApiKey(@org.apache.thrift.annotation.Nullable java.lang.String api_key) {
this.api_key = api_key;
return this;
}
public void unsetApiKey() {
this.api_key = null;
}
/** Returns true if field api_key is set (has been assigned a value) and false otherwise */
public boolean isSetApiKey() {
return this.api_key != null;
}
public void setApiKeyIsSet(boolean value) {
if (!value) {
this.api_key = null;
}
}
public double getTemperature() {
return this.temperature;
}
public TAIResource setTemperature(double temperature) {
this.temperature = temperature;
setTemperatureIsSet(true);
return this;
}
public void unsetTemperature() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TEMPERATURE_ISSET_ID);
}
/** Returns true if field temperature is set (has been assigned a value) and false otherwise */
public boolean isSetTemperature() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TEMPERATURE_ISSET_ID);
}
public void setTemperatureIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TEMPERATURE_ISSET_ID, value);
}
public long getMaxTokens() {
return this.max_tokens;
}
public TAIResource setMaxTokens(long max_tokens) {
this.max_tokens = max_tokens;
setMaxTokensIsSet(true);
return this;
}
public void unsetMaxTokens() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_TOKENS_ISSET_ID);
}
/** Returns true if field max_tokens is set (has been assigned a value) and false otherwise */
public boolean isSetMaxTokens() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_TOKENS_ISSET_ID);
}
public void setMaxTokensIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_TOKENS_ISSET_ID, value);
}
public int getMaxRetries() {
return this.max_retries;
}
public TAIResource setMaxRetries(int max_retries) {
this.max_retries = max_retries;
setMaxRetriesIsSet(true);
return this;
}
public void unsetMaxRetries() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_RETRIES_ISSET_ID);
}
/** Returns true if field max_retries is set (has been assigned a value) and false otherwise */
public boolean isSetMaxRetries() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_RETRIES_ISSET_ID);
}
public void setMaxRetriesIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_RETRIES_ISSET_ID, value);
}
public int getRetryDelaySecond() {
return this.retry_delay_second;
}
public TAIResource setRetryDelaySecond(int retry_delay_second) {
this.retry_delay_second = retry_delay_second;
setRetryDelaySecondIsSet(true);
return this;
}
public void unsetRetryDelaySecond() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RETRY_DELAY_SECOND_ISSET_ID);
}
/** Returns true if field retry_delay_second is set (has been assigned a value) and false otherwise */
public boolean isSetRetryDelaySecond() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RETRY_DELAY_SECOND_ISSET_ID);
}
public void setRetryDelaySecondIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RETRY_DELAY_SECOND_ISSET_ID, value);
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getAnthropicVersion() {
return this.anthropic_version;
}
public TAIResource setAnthropicVersion(@org.apache.thrift.annotation.Nullable java.lang.String anthropic_version) {
this.anthropic_version = anthropic_version;
return this;
}
public void unsetAnthropicVersion() {
this.anthropic_version = null;
}
/** Returns true if field anthropic_version is set (has been assigned a value) and false otherwise */
public boolean isSetAnthropicVersion() {
return this.anthropic_version != null;
}
public void setAnthropicVersionIsSet(boolean value) {
if (!value) {
this.anthropic_version = null;
}
}
public int getDimensions() {
return this.dimensions;
}
public TAIResource setDimensions(int dimensions) {
this.dimensions = dimensions;
setDimensionsIsSet(true);
return this;
}
public void unsetDimensions() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DIMENSIONS_ISSET_ID);
}
/** Returns true if field dimensions is set (has been assigned a value) and false otherwise */
public boolean isSetDimensions() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DIMENSIONS_ISSET_ID);
}
public void setDimensionsIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DIMENSIONS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ENDPOINT:
if (value == null) {
unsetEndpoint();
} else {
setEndpoint((java.lang.String)value);
}
break;
case PROVIDER_TYPE:
if (value == null) {
unsetProviderType();
} else {
setProviderType((java.lang.String)value);
}
break;
case MODEL_NAME:
if (value == null) {
unsetModelName();
} else {
setModelName((java.lang.String)value);
}
break;
case API_KEY:
if (value == null) {
unsetApiKey();
} else {
setApiKey((java.lang.String)value);
}
break;
case TEMPERATURE:
if (value == null) {
unsetTemperature();
} else {
setTemperature((java.lang.Double)value);
}
break;
case MAX_TOKENS:
if (value == null) {
unsetMaxTokens();
} else {
setMaxTokens((java.lang.Long)value);
}
break;
case MAX_RETRIES:
if (value == null) {
unsetMaxRetries();
} else {
setMaxRetries((java.lang.Integer)value);
}
break;
case RETRY_DELAY_SECOND:
if (value == null) {
unsetRetryDelaySecond();
} else {
setRetryDelaySecond((java.lang.Integer)value);
}
break;
case ANTHROPIC_VERSION:
if (value == null) {
unsetAnthropicVersion();
} else {
setAnthropicVersion((java.lang.String)value);
}
break;
case DIMENSIONS:
if (value == null) {
unsetDimensions();
} else {
setDimensions((java.lang.Integer)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ENDPOINT:
return getEndpoint();
case PROVIDER_TYPE:
return getProviderType();
case MODEL_NAME:
return getModelName();
case API_KEY:
return getApiKey();
case TEMPERATURE:
return getTemperature();
case MAX_TOKENS:
return getMaxTokens();
case MAX_RETRIES:
return getMaxRetries();
case RETRY_DELAY_SECOND:
return getRetryDelaySecond();
case ANTHROPIC_VERSION:
return getAnthropicVersion();
case DIMENSIONS:
return getDimensions();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ENDPOINT:
return isSetEndpoint();
case PROVIDER_TYPE:
return isSetProviderType();
case MODEL_NAME:
return isSetModelName();
case API_KEY:
return isSetApiKey();
case TEMPERATURE:
return isSetTemperature();
case MAX_TOKENS:
return isSetMaxTokens();
case MAX_RETRIES:
return isSetMaxRetries();
case RETRY_DELAY_SECOND:
return isSetRetryDelaySecond();
case ANTHROPIC_VERSION:
return isSetAnthropicVersion();
case DIMENSIONS:
return isSetDimensions();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TAIResource)
return this.equals((TAIResource)that);
return false;
}
public boolean equals(TAIResource that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_endpoint = true && this.isSetEndpoint();
boolean that_present_endpoint = true && that.isSetEndpoint();
if (this_present_endpoint || that_present_endpoint) {
if (!(this_present_endpoint && that_present_endpoint))
return false;
if (!this.endpoint.equals(that.endpoint))
return false;
}
boolean this_present_provider_type = true && this.isSetProviderType();
boolean that_present_provider_type = true && that.isSetProviderType();
if (this_present_provider_type || that_present_provider_type) {
if (!(this_present_provider_type && that_present_provider_type))
return false;
if (!this.provider_type.equals(that.provider_type))
return false;
}
boolean this_present_model_name = true && this.isSetModelName();
boolean that_present_model_name = true && that.isSetModelName();
if (this_present_model_name || that_present_model_name) {
if (!(this_present_model_name && that_present_model_name))
return false;
if (!this.model_name.equals(that.model_name))
return false;
}
boolean this_present_api_key = true && this.isSetApiKey();
boolean that_present_api_key = true && that.isSetApiKey();
if (this_present_api_key || that_present_api_key) {
if (!(this_present_api_key && that_present_api_key))
return false;
if (!this.api_key.equals(that.api_key))
return false;
}
boolean this_present_temperature = true && this.isSetTemperature();
boolean that_present_temperature = true && that.isSetTemperature();
if (this_present_temperature || that_present_temperature) {
if (!(this_present_temperature && that_present_temperature))
return false;
if (this.temperature != that.temperature)
return false;
}
boolean this_present_max_tokens = true && this.isSetMaxTokens();
boolean that_present_max_tokens = true && that.isSetMaxTokens();
if (this_present_max_tokens || that_present_max_tokens) {
if (!(this_present_max_tokens && that_present_max_tokens))
return false;
if (this.max_tokens != that.max_tokens)
return false;
}
boolean this_present_max_retries = true && this.isSetMaxRetries();
boolean that_present_max_retries = true && that.isSetMaxRetries();
if (this_present_max_retries || that_present_max_retries) {
if (!(this_present_max_retries && that_present_max_retries))
return false;
if (this.max_retries != that.max_retries)
return false;
}
boolean this_present_retry_delay_second = true && this.isSetRetryDelaySecond();
boolean that_present_retry_delay_second = true && that.isSetRetryDelaySecond();
if (this_present_retry_delay_second || that_present_retry_delay_second) {
if (!(this_present_retry_delay_second && that_present_retry_delay_second))
return false;
if (this.retry_delay_second != that.retry_delay_second)
return false;
}
boolean this_present_anthropic_version = true && this.isSetAnthropicVersion();
boolean that_present_anthropic_version = true && that.isSetAnthropicVersion();
if (this_present_anthropic_version || that_present_anthropic_version) {
if (!(this_present_anthropic_version && that_present_anthropic_version))
return false;
if (!this.anthropic_version.equals(that.anthropic_version))
return false;
}
boolean this_present_dimensions = true && this.isSetDimensions();
boolean that_present_dimensions = true && that.isSetDimensions();
if (this_present_dimensions || that_present_dimensions) {
if (!(this_present_dimensions && that_present_dimensions))
return false;
if (this.dimensions != that.dimensions)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetEndpoint()) ? 131071 : 524287);
if (isSetEndpoint())
hashCode = hashCode * 8191 + endpoint.hashCode();
hashCode = hashCode * 8191 + ((isSetProviderType()) ? 131071 : 524287);
if (isSetProviderType())
hashCode = hashCode * 8191 + provider_type.hashCode();
hashCode = hashCode * 8191 + ((isSetModelName()) ? 131071 : 524287);
if (isSetModelName())
hashCode = hashCode * 8191 + model_name.hashCode();
hashCode = hashCode * 8191 + ((isSetApiKey()) ? 131071 : 524287);
if (isSetApiKey())
hashCode = hashCode * 8191 + api_key.hashCode();
hashCode = hashCode * 8191 + ((isSetTemperature()) ? 131071 : 524287);
if (isSetTemperature())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(temperature);
hashCode = hashCode * 8191 + ((isSetMaxTokens()) ? 131071 : 524287);
if (isSetMaxTokens())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(max_tokens);
hashCode = hashCode * 8191 + ((isSetMaxRetries()) ? 131071 : 524287);
if (isSetMaxRetries())
hashCode = hashCode * 8191 + max_retries;
hashCode = hashCode * 8191 + ((isSetRetryDelaySecond()) ? 131071 : 524287);
if (isSetRetryDelaySecond())
hashCode = hashCode * 8191 + retry_delay_second;
hashCode = hashCode * 8191 + ((isSetAnthropicVersion()) ? 131071 : 524287);
if (isSetAnthropicVersion())
hashCode = hashCode * 8191 + anthropic_version.hashCode();
hashCode = hashCode * 8191 + ((isSetDimensions()) ? 131071 : 524287);
if (isSetDimensions())
hashCode = hashCode * 8191 + dimensions;
return hashCode;
}
@Override
public int compareTo(TAIResource other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetEndpoint(), other.isSetEndpoint());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEndpoint()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endpoint, other.endpoint);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetProviderType(), other.isSetProviderType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProviderType()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.provider_type, other.provider_type);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetModelName(), other.isSetModelName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetModelName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.model_name, other.model_name);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetApiKey(), other.isSetApiKey());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetApiKey()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.api_key, other.api_key);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetTemperature(), other.isSetTemperature());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTemperature()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.temperature, other.temperature);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetMaxTokens(), other.isSetMaxTokens());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMaxTokens()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_tokens, other.max_tokens);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetMaxRetries(), other.isSetMaxRetries());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMaxRetries()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_retries, other.max_retries);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetRetryDelaySecond(), other.isSetRetryDelaySecond());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRetryDelaySecond()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.retry_delay_second, other.retry_delay_second);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetAnthropicVersion(), other.isSetAnthropicVersion());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAnthropicVersion()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.anthropic_version, other.anthropic_version);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetDimensions(), other.isSetDimensions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDimensions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dimensions, other.dimensions);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("TAIResource(");
boolean first = true;
sb.append("endpoint:");
if (this.endpoint == null) {
sb.append("null");
} else {
sb.append(this.endpoint);
}
first = false;
if (!first) sb.append(", ");
sb.append("provider_type:");
if (this.provider_type == null) {
sb.append("null");
} else {
sb.append(this.provider_type);
}
first = false;
if (!first) sb.append(", ");
sb.append("model_name:");
if (this.model_name == null) {
sb.append("null");
} else {
sb.append(this.model_name);
}
first = false;
if (isSetApiKey()) {
if (!first) sb.append(", ");
sb.append("api_key:");
if (this.api_key == null) {
sb.append("null");
} else {
sb.append(this.api_key);
}
first = false;
}
if (isSetTemperature()) {
if (!first) sb.append(", ");
sb.append("temperature:");
sb.append(this.temperature);
first = false;
}
if (isSetMaxTokens()) {
if (!first) sb.append(", ");
sb.append("max_tokens:");
sb.append(this.max_tokens);
first = false;
}
if (isSetMaxRetries()) {
if (!first) sb.append(", ");
sb.append("max_retries:");
sb.append(this.max_retries);
first = false;
}
if (isSetRetryDelaySecond()) {
if (!first) sb.append(", ");
sb.append("retry_delay_second:");
sb.append(this.retry_delay_second);
first = false;
}
if (isSetAnthropicVersion()) {
if (!first) sb.append(", ");
sb.append("anthropic_version:");
if (this.anthropic_version == null) {
sb.append("null");
} else {
sb.append(this.anthropic_version);
}
first = false;
}
if (isSetDimensions()) {
if (!first) sb.append(", ");
sb.append("dimensions:");
sb.append(this.dimensions);
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (endpoint == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'endpoint' was not present! Struct: " + toString());
}
if (provider_type == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'provider_type' was not present! Struct: " + toString());
}
if (model_name == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'model_name' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class TAIResourceStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TAIResourceStandardScheme getScheme() {
return new TAIResourceStandardScheme();
}
}
private static class TAIResourceStandardScheme extends org.apache.thrift.scheme.StandardScheme<TAIResource> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TAIResource struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ENDPOINT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.endpoint = iprot.readString();
struct.setEndpointIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // PROVIDER_TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.provider_type = iprot.readString();
struct.setProviderTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // MODEL_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.model_name = iprot.readString();
struct.setModelNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // API_KEY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.api_key = iprot.readString();
struct.setApiKeyIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // TEMPERATURE
if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
struct.temperature = iprot.readDouble();
struct.setTemperatureIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // MAX_TOKENS
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.max_tokens = iprot.readI64();
struct.setMaxTokensIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // MAX_RETRIES
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.max_retries = iprot.readI32();
struct.setMaxRetriesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 8: // RETRY_DELAY_SECOND
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.retry_delay_second = iprot.readI32();
struct.setRetryDelaySecondIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // ANTHROPIC_VERSION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.anthropic_version = iprot.readString();
struct.setAnthropicVersionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // DIMENSIONS
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.dimensions = iprot.readI32();
struct.setDimensionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TAIResource struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.endpoint != null) {
oprot.writeFieldBegin(ENDPOINT_FIELD_DESC);
oprot.writeString(struct.endpoint);
oprot.writeFieldEnd();
}
if (struct.provider_type != null) {
oprot.writeFieldBegin(PROVIDER_TYPE_FIELD_DESC);
oprot.writeString(struct.provider_type);
oprot.writeFieldEnd();
}
if (struct.model_name != null) {
oprot.writeFieldBegin(MODEL_NAME_FIELD_DESC);
oprot.writeString(struct.model_name);
oprot.writeFieldEnd();
}
if (struct.api_key != null) {
if (struct.isSetApiKey()) {
oprot.writeFieldBegin(API_KEY_FIELD_DESC);
oprot.writeString(struct.api_key);
oprot.writeFieldEnd();
}
}
if (struct.isSetTemperature()) {
oprot.writeFieldBegin(TEMPERATURE_FIELD_DESC);
oprot.writeDouble(struct.temperature);
oprot.writeFieldEnd();
}
if (struct.isSetMaxTokens()) {
oprot.writeFieldBegin(MAX_TOKENS_FIELD_DESC);
oprot.writeI64(struct.max_tokens);
oprot.writeFieldEnd();
}
if (struct.isSetMaxRetries()) {
oprot.writeFieldBegin(MAX_RETRIES_FIELD_DESC);
oprot.writeI32(struct.max_retries);
oprot.writeFieldEnd();
}
if (struct.isSetRetryDelaySecond()) {
oprot.writeFieldBegin(RETRY_DELAY_SECOND_FIELD_DESC);
oprot.writeI32(struct.retry_delay_second);
oprot.writeFieldEnd();
}
if (struct.anthropic_version != null) {
if (struct.isSetAnthropicVersion()) {
oprot.writeFieldBegin(ANTHROPIC_VERSION_FIELD_DESC);
oprot.writeString(struct.anthropic_version);
oprot.writeFieldEnd();
}
}
if (struct.isSetDimensions()) {
oprot.writeFieldBegin(DIMENSIONS_FIELD_DESC);
oprot.writeI32(struct.dimensions);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TAIResourceTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TAIResourceTupleScheme getScheme() {
return new TAIResourceTupleScheme();
}
}
private static class TAIResourceTupleScheme extends org.apache.thrift.scheme.TupleScheme<TAIResource> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TAIResource struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.endpoint);
oprot.writeString(struct.provider_type);
oprot.writeString(struct.model_name);
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetApiKey()) {
optionals.set(0);
}
if (struct.isSetTemperature()) {
optionals.set(1);
}
if (struct.isSetMaxTokens()) {
optionals.set(2);
}
if (struct.isSetMaxRetries()) {
optionals.set(3);
}
if (struct.isSetRetryDelaySecond()) {
optionals.set(4);
}
if (struct.isSetAnthropicVersion()) {
optionals.set(5);
}
if (struct.isSetDimensions()) {
optionals.set(6);
}
oprot.writeBitSet(optionals, 7);
if (struct.isSetApiKey()) {
oprot.writeString(struct.api_key);
}
if (struct.isSetTemperature()) {
oprot.writeDouble(struct.temperature);
}
if (struct.isSetMaxTokens()) {
oprot.writeI64(struct.max_tokens);
}
if (struct.isSetMaxRetries()) {
oprot.writeI32(struct.max_retries);
}
if (struct.isSetRetryDelaySecond()) {
oprot.writeI32(struct.retry_delay_second);
}
if (struct.isSetAnthropicVersion()) {
oprot.writeString(struct.anthropic_version);
}
if (struct.isSetDimensions()) {
oprot.writeI32(struct.dimensions);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TAIResource struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.endpoint = iprot.readString();
struct.setEndpointIsSet(true);
struct.provider_type = iprot.readString();
struct.setProviderTypeIsSet(true);
struct.model_name = iprot.readString();
struct.setModelNameIsSet(true);
java.util.BitSet incoming = iprot.readBitSet(7);
if (incoming.get(0)) {
struct.api_key = iprot.readString();
struct.setApiKeyIsSet(true);
}
if (incoming.get(1)) {
struct.temperature = iprot.readDouble();
struct.setTemperatureIsSet(true);
}
if (incoming.get(2)) {
struct.max_tokens = iprot.readI64();
struct.setMaxTokensIsSet(true);
}
if (incoming.get(3)) {
struct.max_retries = iprot.readI32();
struct.setMaxRetriesIsSet(true);
}
if (incoming.get(4)) {
struct.retry_delay_second = iprot.readI32();
struct.setRetryDelaySecondIsSet(true);
}
if (incoming.get(5)) {
struct.anthropic_version = iprot.readString();
struct.setAnthropicVersionIsSet(true);
}
if (incoming.get(6)) {
struct.dimensions = iprot.readI32();
struct.setDimensionsIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}