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