001package com.box.sdkgen.schemas.aiagentbasictexttool;
002
003import com.box.sdkgen.schemas.aiagentbasictexttoolbase.AiAgentBasicTextToolBase;
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 com.fasterxml.jackson.annotation.JsonProperty;
011import java.util.Objects;
012
013/** AI agent processor used to handle basic text. */
014@JsonFilter("nullablePropertyFilter")
015public class AiAgentBasicTextTool extends AiAgentBasicTextToolBase {
016
017  /** System messages try to help the LLM "understand" its role and what it is supposed to do. */
018  @JsonProperty("system_message")
019  protected String systemMessage;
020
021  /**
022   * The prompt template contains contextual information of the request and the user prompt. When
023   * passing `prompt_template` parameters, you **must include** inputs for `{user_question}` and
024   * `{content}`. `{current_date}` is optional, depending on the use.
025   */
026  @JsonProperty("prompt_template")
027  protected String promptTemplate;
028
029  public AiAgentBasicTextTool() {
030    super();
031  }
032
033  protected AiAgentBasicTextTool(Builder builder) {
034    super(builder);
035    this.systemMessage = builder.systemMessage;
036    this.promptTemplate = builder.promptTemplate;
037    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
038  }
039
040  public String getSystemMessage() {
041    return systemMessage;
042  }
043
044  public String getPromptTemplate() {
045    return promptTemplate;
046  }
047
048  @Override
049  public boolean equals(Object o) {
050    if (this == o) {
051      return true;
052    }
053    if (o == null || getClass() != o.getClass()) {
054      return false;
055    }
056    AiAgentBasicTextTool casted = (AiAgentBasicTextTool) o;
057    return Objects.equals(model, casted.model)
058        && Objects.equals(numTokensForCompletion, casted.numTokensForCompletion)
059        && Objects.equals(llmEndpointParams, casted.llmEndpointParams)
060        && Objects.equals(systemMessage, casted.systemMessage)
061        && Objects.equals(promptTemplate, casted.promptTemplate);
062  }
063
064  @Override
065  public int hashCode() {
066    return Objects.hash(
067        model, numTokensForCompletion, llmEndpointParams, systemMessage, promptTemplate);
068  }
069
070  @Override
071  public String toString() {
072    return "AiAgentBasicTextTool{"
073        + "model='"
074        + model
075        + '\''
076        + ", "
077        + "numTokensForCompletion='"
078        + numTokensForCompletion
079        + '\''
080        + ", "
081        + "llmEndpointParams='"
082        + llmEndpointParams
083        + '\''
084        + ", "
085        + "systemMessage='"
086        + systemMessage
087        + '\''
088        + ", "
089        + "promptTemplate='"
090        + promptTemplate
091        + '\''
092        + "}";
093  }
094
095  public static class Builder extends AiAgentBasicTextToolBase.Builder {
096
097    protected String systemMessage;
098
099    protected String promptTemplate;
100
101    public Builder systemMessage(String systemMessage) {
102      this.systemMessage = systemMessage;
103      return this;
104    }
105
106    public Builder promptTemplate(String promptTemplate) {
107      this.promptTemplate = promptTemplate;
108      return this;
109    }
110
111    @Override
112    public Builder model(String model) {
113      this.model = model;
114      return this;
115    }
116
117    @Override
118    public Builder numTokensForCompletion(Long numTokensForCompletion) {
119      this.numTokensForCompletion = numTokensForCompletion;
120      return this;
121    }
122
123    @Override
124    public Builder llmEndpointParams(AiLlmEndpointParamsOpenAi llmEndpointParams) {
125      this.llmEndpointParams = new AiLlmEndpointParams(llmEndpointParams);
126      return this;
127    }
128
129    @Override
130    public Builder llmEndpointParams(AiLlmEndpointParamsGoogle llmEndpointParams) {
131      this.llmEndpointParams = new AiLlmEndpointParams(llmEndpointParams);
132      return this;
133    }
134
135    @Override
136    public Builder llmEndpointParams(AiLlmEndpointParamsAws llmEndpointParams) {
137      this.llmEndpointParams = new AiLlmEndpointParams(llmEndpointParams);
138      return this;
139    }
140
141    @Override
142    public Builder llmEndpointParams(AiLlmEndpointParamsIbm llmEndpointParams) {
143      this.llmEndpointParams = new AiLlmEndpointParams(llmEndpointParams);
144      return this;
145    }
146
147    @Override
148    public Builder llmEndpointParams(AiLlmEndpointParams llmEndpointParams) {
149      this.llmEndpointParams = llmEndpointParams;
150      return this;
151    }
152
153    public AiAgentBasicTextTool build() {
154      return new AiAgentBasicTextTool(this);
155    }
156  }
157}