• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

51.28
/src/main/java/com/box/sdkgen/schemas/aitextgen/AiTextGen.java
1
package com.box.sdkgen.schemas.aitextgen;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.schemas.aiagentreference.AiAgentReference;
6
import com.box.sdkgen.schemas.aiagenttextgen.AiAgentTextGen;
7
import com.box.sdkgen.schemas.aidialoguehistory.AiDialogueHistory;
8
import com.box.sdkgen.schemas.aitextgenagent.AiTextGenAgent;
9
import com.fasterxml.jackson.annotation.JsonFilter;
10
import com.fasterxml.jackson.annotation.JsonProperty;
11
import java.util.List;
12
import java.util.Objects;
13

14
/** AI text gen request object. */
15
@JsonFilter("nullablePropertyFilter")
16
public class AiTextGen extends SerializableObject {
17

18
  /**
19
   * The prompt provided by the client to be answered by the LLM. The prompt's length is limited to
20
   * 10000 characters.
21
   */
22
  protected final String prompt;
23

24
  /**
25
   * The items to be processed by the LLM, often files. The array can include **exactly one**
26
   * element.
27
   *
28
   * <p>**Note**: Box AI handles documents with text representations up to 1MB in size. If the file
29
   * size exceeds 1MB, the first 1MB of text representation will be processed.
30
   */
31
  protected final List<AiTextGenItemsField> items;
32

33
  /**
34
   * The history of prompts and answers previously passed to the LLM. This parameter provides the
35
   * additional context to the LLM when generating the response.
36
   */
37
  @JsonProperty("dialogue_history")
38
  protected List<AiDialogueHistory> dialogueHistory;
39

40
  @JsonProperty("ai_agent")
41
  protected AiTextGenAgent aiAgent;
42

43
  public AiTextGen(
44
      @JsonProperty("prompt") String prompt,
45
      @JsonProperty("items") List<AiTextGenItemsField> items) {
46
    super();
×
47
    this.prompt = prompt;
×
48
    this.items = items;
×
49
  }
×
50

51
  protected AiTextGen(Builder builder) {
52
    super();
1✔
53
    this.prompt = builder.prompt;
1✔
54
    this.items = builder.items;
1✔
55
    this.dialogueHistory = builder.dialogueHistory;
1✔
56
    this.aiAgent = builder.aiAgent;
1✔
57
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
1✔
58
  }
1✔
59

60
  public String getPrompt() {
61
    return prompt;
1✔
62
  }
63

64
  public List<AiTextGenItemsField> getItems() {
65
    return items;
1✔
66
  }
67

68
  public List<AiDialogueHistory> getDialogueHistory() {
69
    return dialogueHistory;
1✔
70
  }
71

72
  public AiTextGenAgent getAiAgent() {
73
    return aiAgent;
1✔
74
  }
75

76
  @Override
77
  public boolean equals(Object o) {
78
    if (this == o) {
×
79
      return true;
×
80
    }
81
    if (o == null || getClass() != o.getClass()) {
×
82
      return false;
×
83
    }
84
    AiTextGen casted = (AiTextGen) o;
×
85
    return Objects.equals(prompt, casted.prompt)
×
86
        && Objects.equals(items, casted.items)
×
87
        && Objects.equals(dialogueHistory, casted.dialogueHistory)
×
88
        && Objects.equals(aiAgent, casted.aiAgent);
×
89
  }
90

91
  @Override
92
  public int hashCode() {
93
    return Objects.hash(prompt, items, dialogueHistory, aiAgent);
×
94
  }
95

96
  @Override
97
  public String toString() {
98
    return "AiTextGen{"
×
99
        + "prompt='"
100
        + prompt
101
        + '\''
102
        + ", "
103
        + "items='"
104
        + items
105
        + '\''
106
        + ", "
107
        + "dialogueHistory='"
108
        + dialogueHistory
109
        + '\''
110
        + ", "
111
        + "aiAgent='"
112
        + aiAgent
113
        + '\''
114
        + "}";
115
  }
116

117
  public static class Builder extends NullableFieldTracker {
118

119
    protected final String prompt;
120

121
    protected final List<AiTextGenItemsField> items;
122

123
    protected List<AiDialogueHistory> dialogueHistory;
124

125
    protected AiTextGenAgent aiAgent;
126

127
    public Builder(String prompt, List<AiTextGenItemsField> items) {
128
      super();
1✔
129
      this.prompt = prompt;
1✔
130
      this.items = items;
1✔
131
    }
1✔
132

133
    public Builder dialogueHistory(List<AiDialogueHistory> dialogueHistory) {
134
      this.dialogueHistory = dialogueHistory;
1✔
135
      return this;
1✔
136
    }
137

138
    public Builder aiAgent(AiAgentReference aiAgent) {
139
      this.aiAgent = new AiTextGenAgent(aiAgent);
×
140
      return this;
×
141
    }
142

143
    public Builder aiAgent(AiAgentTextGen aiAgent) {
144
      this.aiAgent = new AiTextGenAgent(aiAgent);
1✔
145
      return this;
1✔
146
    }
147

148
    public Builder aiAgent(AiTextGenAgent aiAgent) {
149
      this.aiAgent = aiAgent;
×
150
      return this;
×
151
    }
152

153
    public AiTextGen build() {
154
      return new AiTextGen(this);
1✔
155
    }
156
  }
157
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc