001package com.box.sdkgen.schemas.aillmendpointparamsaws;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.box.sdkgen.serialization.json.EnumWrapper;
007import com.fasterxml.jackson.annotation.JsonFilter;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
010import com.fasterxml.jackson.databind.annotation.JsonSerialize;
011import java.util.Objects;
012
013/** AI LLM endpoint params AWS object. */
014@JsonFilter("nullablePropertyFilter")
015public class AiLlmEndpointParamsAws extends SerializableObject {
016
017  /** The type of the AI LLM endpoint params object for AWS. This parameter is **required**. */
018  @JsonDeserialize(
019      using = AiLlmEndpointParamsAwsTypeField.AiLlmEndpointParamsAwsTypeFieldDeserializer.class)
020  @JsonSerialize(
021      using = AiLlmEndpointParamsAwsTypeField.AiLlmEndpointParamsAwsTypeFieldSerializer.class)
022  protected EnumWrapper<AiLlmEndpointParamsAwsTypeField> type;
023
024  /**
025   * What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output
026   * more random, while lower values like 0.2 will make it more focused and deterministic. We
027   * generally recommend altering this or `top_p` but not both.
028   */
029  @Nullable protected Double temperature;
030
031  /**
032   * An alternative to sampling with temperature, called nucleus sampling, where the model considers
033   * the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens
034   * comprising the top 10% probability mass are considered. We generally recommend altering this or
035   * temperature but not both.
036   */
037  @JsonProperty("top_p")
038  @Nullable
039  protected Double topP;
040
041  public AiLlmEndpointParamsAws() {
042    super();
043    this.type =
044        new EnumWrapper<AiLlmEndpointParamsAwsTypeField>(
045            AiLlmEndpointParamsAwsTypeField.AWS_PARAMS);
046  }
047
048  protected AiLlmEndpointParamsAws(Builder builder) {
049    super();
050    this.type = builder.type;
051    this.temperature = builder.temperature;
052    this.topP = builder.topP;
053    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
054  }
055
056  public EnumWrapper<AiLlmEndpointParamsAwsTypeField> getType() {
057    return type;
058  }
059
060  public Double getTemperature() {
061    return temperature;
062  }
063
064  public Double getTopP() {
065    return topP;
066  }
067
068  @Override
069  public boolean equals(Object o) {
070    if (this == o) {
071      return true;
072    }
073    if (o == null || getClass() != o.getClass()) {
074      return false;
075    }
076    AiLlmEndpointParamsAws casted = (AiLlmEndpointParamsAws) o;
077    return Objects.equals(type, casted.type)
078        && Objects.equals(temperature, casted.temperature)
079        && Objects.equals(topP, casted.topP);
080  }
081
082  @Override
083  public int hashCode() {
084    return Objects.hash(type, temperature, topP);
085  }
086
087  @Override
088  public String toString() {
089    return "AiLlmEndpointParamsAws{"
090        + "type='"
091        + type
092        + '\''
093        + ", "
094        + "temperature='"
095        + temperature
096        + '\''
097        + ", "
098        + "topP='"
099        + topP
100        + '\''
101        + "}";
102  }
103
104  public static class Builder extends NullableFieldTracker {
105
106    protected EnumWrapper<AiLlmEndpointParamsAwsTypeField> type;
107
108    protected Double temperature;
109
110    protected Double topP;
111
112    public Builder() {
113      super();
114    }
115
116    public Builder type(AiLlmEndpointParamsAwsTypeField type) {
117      this.type = new EnumWrapper<AiLlmEndpointParamsAwsTypeField>(type);
118      return this;
119    }
120
121    public Builder type(EnumWrapper<AiLlmEndpointParamsAwsTypeField> type) {
122      this.type = type;
123      return this;
124    }
125
126    public Builder temperature(Double temperature) {
127      this.temperature = temperature;
128      this.markNullableFieldAsSet("temperature");
129      return this;
130    }
131
132    public Builder topP(Double topP) {
133      this.topP = topP;
134      this.markNullableFieldAsSet("top_p");
135      return this;
136    }
137
138    public AiLlmEndpointParamsAws build() {
139      if (this.type == null) {
140        this.type =
141            new EnumWrapper<AiLlmEndpointParamsAwsTypeField>(
142                AiLlmEndpointParamsAwsTypeField.AWS_PARAMS);
143      }
144      return new AiLlmEndpointParamsAws(this);
145    }
146  }
147}