001package com.box.sdkgen.schemas.aiagentbasicgentool; 002 003import com.box.sdkgen.schemas.aiagentlongtexttooltextgen.AiAgentLongTextToolTextGen; 004import com.box.sdkgen.schemas.aiagentlongtexttooltextgen.AiAgentLongTextToolTextGenEmbeddingsField; 005import com.box.sdkgen.schemas.aillmendpointparams.AiLlmEndpointParams; 006import com.box.sdkgen.schemas.aillmendpointparamsaws.AiLlmEndpointParamsAws; 007import com.box.sdkgen.schemas.aillmendpointparamsgoogle.AiLlmEndpointParamsGoogle; 008import com.box.sdkgen.schemas.aillmendpointparamsibm.AiLlmEndpointParamsIbm; 009import com.box.sdkgen.schemas.aillmendpointparamsopenai.AiLlmEndpointParamsOpenAi; 010import com.fasterxml.jackson.annotation.JsonFilter; 011import com.fasterxml.jackson.annotation.JsonProperty; 012import java.util.Objects; 013 014/** AI agent basic tool used to generate text. */ 015@JsonFilter("nullablePropertyFilter") 016public class AiAgentBasicGenTool extends AiAgentLongTextToolTextGen { 017 018 /** 019 * How the content should be included in a request to the LLM. Input for `{content}` is optional, 020 * depending on the use. 021 */ 022 @JsonProperty("content_template") 023 protected String contentTemplate; 024 025 public AiAgentBasicGenTool() { 026 super(); 027 } 028 029 protected AiAgentBasicGenTool(Builder builder) { 030 super(builder); 031 this.contentTemplate = builder.contentTemplate; 032 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 033 } 034 035 public String getContentTemplate() { 036 return contentTemplate; 037 } 038 039 @Override 040 public boolean equals(Object o) { 041 if (this == o) { 042 return true; 043 } 044 if (o == null || getClass() != o.getClass()) { 045 return false; 046 } 047 AiAgentBasicGenTool casted = (AiAgentBasicGenTool) o; 048 return Objects.equals(model, casted.model) 049 && Objects.equals(numTokensForCompletion, casted.numTokensForCompletion) 050 && Objects.equals(llmEndpointParams, casted.llmEndpointParams) 051 && Objects.equals(systemMessage, casted.systemMessage) 052 && Objects.equals(promptTemplate, casted.promptTemplate) 053 && Objects.equals(embeddings, casted.embeddings) 054 && Objects.equals(contentTemplate, casted.contentTemplate); 055 } 056 057 @Override 058 public int hashCode() { 059 return Objects.hash( 060 model, 061 numTokensForCompletion, 062 llmEndpointParams, 063 systemMessage, 064 promptTemplate, 065 embeddings, 066 contentTemplate); 067 } 068 069 @Override 070 public String toString() { 071 return "AiAgentBasicGenTool{" 072 + "model='" 073 + model 074 + '\'' 075 + ", " 076 + "numTokensForCompletion='" 077 + numTokensForCompletion 078 + '\'' 079 + ", " 080 + "llmEndpointParams='" 081 + llmEndpointParams 082 + '\'' 083 + ", " 084 + "systemMessage='" 085 + systemMessage 086 + '\'' 087 + ", " 088 + "promptTemplate='" 089 + promptTemplate 090 + '\'' 091 + ", " 092 + "embeddings='" 093 + embeddings 094 + '\'' 095 + ", " 096 + "contentTemplate='" 097 + contentTemplate 098 + '\'' 099 + "}"; 100 } 101 102 public static class Builder extends AiAgentLongTextToolTextGen.Builder { 103 104 protected String contentTemplate; 105 106 public Builder contentTemplate(String contentTemplate) { 107 this.contentTemplate = contentTemplate; 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 @Override 154 public Builder systemMessage(String systemMessage) { 155 this.systemMessage = systemMessage; 156 return this; 157 } 158 159 @Override 160 public Builder promptTemplate(String promptTemplate) { 161 this.promptTemplate = promptTemplate; 162 return this; 163 } 164 165 @Override 166 public Builder embeddings(AiAgentLongTextToolTextGenEmbeddingsField embeddings) { 167 this.embeddings = embeddings; 168 return this; 169 } 170 171 public AiAgentBasicGenTool build() { 172 return new AiAgentBasicGenTool(this); 173 } 174 } 175}