001package com.box.sdkgen.schemas.aiagentlongtexttool;
002
003import com.box.sdkgen.schemas.aiagentbasictexttool.AiAgentBasicTextTool;
004import com.box.sdkgen.schemas.aillmendpointparams.AiLlmEndpointParams;
005import com.box.sdkgen.schemas.aillmendpointparamsaws.AiLlmEndpointParamsAws;
006import com.box.sdkgen.schemas.aillmendpointparamsgoogle.AiLlmEndpointParamsGoogle;
007import com.box.sdkgen.schemas.aillmendpointparamsibm.AiLlmEndpointParamsIbm;
008import com.box.sdkgen.schemas.aillmendpointparamsopenai.AiLlmEndpointParamsOpenAi;
009import com.fasterxml.jackson.annotation.JsonFilter;
010import java.util.Objects;
011
012/** AI agent processor used to to handle longer text. */
013@JsonFilter("nullablePropertyFilter")
014public class AiAgentLongTextTool extends AiAgentBasicTextTool {
015
016  protected AiAgentLongTextToolEmbeddingsField embeddings;
017
018  public AiAgentLongTextTool() {
019    super();
020  }
021
022  protected AiAgentLongTextTool(Builder builder) {
023    super(builder);
024    this.embeddings = builder.embeddings;
025    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
026  }
027
028  public AiAgentLongTextToolEmbeddingsField getEmbeddings() {
029    return embeddings;
030  }
031
032  @Override
033  public boolean equals(Object o) {
034    if (this == o) {
035      return true;
036    }
037    if (o == null || getClass() != o.getClass()) {
038      return false;
039    }
040    AiAgentLongTextTool casted = (AiAgentLongTextTool) o;
041    return Objects.equals(model, casted.model)
042        && Objects.equals(numTokensForCompletion, casted.numTokensForCompletion)
043        && Objects.equals(llmEndpointParams, casted.llmEndpointParams)
044        && Objects.equals(systemMessage, casted.systemMessage)
045        && Objects.equals(promptTemplate, casted.promptTemplate)
046        && Objects.equals(embeddings, casted.embeddings);
047  }
048
049  @Override
050  public int hashCode() {
051    return Objects.hash(
052        model,
053        numTokensForCompletion,
054        llmEndpointParams,
055        systemMessage,
056        promptTemplate,
057        embeddings);
058  }
059
060  @Override
061  public String toString() {
062    return "AiAgentLongTextTool{"
063        + "model='"
064        + model
065        + '\''
066        + ", "
067        + "numTokensForCompletion='"
068        + numTokensForCompletion
069        + '\''
070        + ", "
071        + "llmEndpointParams='"
072        + llmEndpointParams
073        + '\''
074        + ", "
075        + "systemMessage='"
076        + systemMessage
077        + '\''
078        + ", "
079        + "promptTemplate='"
080        + promptTemplate
081        + '\''
082        + ", "
083        + "embeddings='"
084        + embeddings
085        + '\''
086        + "}";
087  }
088
089  public static class Builder extends AiAgentBasicTextTool.Builder {
090
091    protected AiAgentLongTextToolEmbeddingsField embeddings;
092
093    public Builder embeddings(AiAgentLongTextToolEmbeddingsField embeddings) {
094      this.embeddings = embeddings;
095      return this;
096    }
097
098    @Override
099    public Builder model(String model) {
100      this.model = model;
101      return this;
102    }
103
104    @Override
105    public Builder numTokensForCompletion(Long numTokensForCompletion) {
106      this.numTokensForCompletion = numTokensForCompletion;
107      return this;
108    }
109
110    @Override
111    public Builder llmEndpointParams(AiLlmEndpointParamsOpenAi llmEndpointParams) {
112      this.llmEndpointParams = new AiLlmEndpointParams(llmEndpointParams);
113      return this;
114    }
115
116    @Override
117    public Builder llmEndpointParams(AiLlmEndpointParamsGoogle llmEndpointParams) {
118      this.llmEndpointParams = new AiLlmEndpointParams(llmEndpointParams);
119      return this;
120    }
121
122    @Override
123    public Builder llmEndpointParams(AiLlmEndpointParamsAws llmEndpointParams) {
124      this.llmEndpointParams = new AiLlmEndpointParams(llmEndpointParams);
125      return this;
126    }
127
128    @Override
129    public Builder llmEndpointParams(AiLlmEndpointParamsIbm llmEndpointParams) {
130      this.llmEndpointParams = new AiLlmEndpointParams(llmEndpointParams);
131      return this;
132    }
133
134    @Override
135    public Builder llmEndpointParams(AiLlmEndpointParams llmEndpointParams) {
136      this.llmEndpointParams = llmEndpointParams;
137      return this;
138    }
139
140    @Override
141    public Builder systemMessage(String systemMessage) {
142      this.systemMessage = systemMessage;
143      return this;
144    }
145
146    @Override
147    public Builder promptTemplate(String promptTemplate) {
148      this.promptTemplate = promptTemplate;
149      return this;
150    }
151
152    public AiAgentLongTextTool build() {
153      return new AiAgentLongTextTool(this);
154    }
155  }
156}