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

box / box-java-sdk / #3992

06 Sep 2024 01:11PM UTC coverage: 71.703% (-0.7%) from 72.441%
#3992

push

github

web-flow
feat: Support AI Agent (#1265)

248 of 452 new or added lines in 14 files covered. (54.87%)

3 existing lines in 3 files now uncovered.

7921 of 11047 relevant lines covered (71.7%)

0.72 hits per line

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

60.0
/src/main/java/com/box/sdk/BoxAIAgentEmbeddings.java
1
package com.box.sdk;
2

3
import com.box.sdk.internal.utils.JsonUtils;
4
import com.eclipsesource.json.JsonObject;
5
import com.eclipsesource.json.JsonValue;
6

7
/**
8
 * Represents the embeddings used by an AI agent.
9
 */
10
public class BoxAIAgentEmbeddings extends BoxJSONObject {
11
    /**
12
     * The model used for the AI Agent for calculating embeddings.
13
     */
14
    private String model;
15
    /**
16
     * The strategy used for the AI Agent for calculating embeddings.
17
     */
18
    private BoxAIAgentEmbeddingsStrategy strategy;
19

20
    /**
21
     * Constructs an AI agent with default settings.
22
     * @param model The model used for the AI Agent for calculating embeddings.
23
     * @param strategy The strategy used for the AI Agent for calculating embeddings.
24
     */
NEW
25
    public BoxAIAgentEmbeddings(String model, BoxAIAgentEmbeddingsStrategy strategy) {
×
NEW
26
        this.model = model;
×
NEW
27
        this.strategy = strategy;
×
NEW
28
    }
×
29

30
    /**
31
     * Constructs an AI agent with default settings.
32
     * @param jsonObject JSON object representing the AI agent.
33
     */
34
    public BoxAIAgentEmbeddings(JsonObject jsonObject) {
35
        super(jsonObject);
1✔
36
    }
1✔
37

38
    /**
39
     * Gets the model used for the AI Agent for calculating embeddings.
40
     * @return The model used for the AI Agent for calculating embeddings.
41
     */
42
    public String getModel() {
NEW
43
        return model;
×
44
    }
45

46
    /**
47
     * Sets the model used for the AI Agent for calculating embeddings.
48
     * @param model The model used for the AI Agent for calculating embeddings.
49
     */
50
    public void setModel(String model) {
NEW
51
        this.model = model;
×
NEW
52
    }
×
53

54
    /**
55
     * Gets the strategy used for the AI Agent for calculating embeddings.
56
     * @return The strategy used for the AI Agent for calculating embeddings.
57
     */
58
    public BoxAIAgentEmbeddingsStrategy getStrategy() {
NEW
59
        return strategy;
×
60
    }
61

62
    /**
63
     * Sets the strategy used for the AI Agent for calculating embeddings.
64
     * @param strategy The strategy used for the AI Agent for calculating embeddings.
65
     */
66
    public void setStrategy(BoxAIAgentEmbeddingsStrategy strategy) {
NEW
67
        this.strategy = strategy;
×
NEW
68
    }
×
69

70
    @Override
71
    void parseJSONMember(JsonObject.Member member) {
72
        super.parseJSONMember(member);
1✔
73
        String memberName = member.getName();
1✔
74
        JsonValue value = member.getValue();
1✔
75
        switch (memberName) {
1✔
76
            case "model":
77
                this.model = member.getValue().asString();
1✔
78
                break;
1✔
79
            case "strategy":
80
                this.strategy = new BoxAIAgentEmbeddingsStrategy(value.asObject());
1✔
81
                break;
1✔
82
            default:
83
                break;
84
        }
85
    }
1✔
86

87
    public JsonObject getJSONObject() {
88
        JsonObject jsonObject = new JsonObject();
1✔
89
        JsonUtils.addIfNotNull(jsonObject, "model", this.model);
1✔
90
        JsonUtils.addIfNotNull(jsonObject, "strategy", this.strategy.getJSONObject());
1✔
91
        return jsonObject;
1✔
92
    }
93
}
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