• 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

56.52
/src/main/java/com/box/sdk/BoxAIAgentEmbeddingsStrategy.java
1
package com.box.sdk;
2

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

6
/**
7
 * Represents the strategy used for the AI Agent for calculating embeddings.
8
 */
9
public class BoxAIAgentEmbeddingsStrategy extends BoxJSONObject {
10
    /**
11
     * The ID of the strategy used for the AI Agent for calculating embeddings.
12
     */
13
    private String id;
14
    /**
15
     * The number of tokens per chunk used for the AI Agent for calculating embeddings.
16
     */
17
    private int numTokensPerChunk;
18

19
    /**
20
     * Constructs an AI agent with default settings.
21
     * @param id The ID of the strategy used for the AI Agent for calculating embeddings.
22
     * @param numTokensPerChunk The number of tokens per chunk used for the AI Agent for calculating embeddings.
23
     */
NEW
24
    public BoxAIAgentEmbeddingsStrategy(String id, int numTokensPerChunk) {
×
NEW
25
        this.id = id;
×
NEW
26
        this.numTokensPerChunk = numTokensPerChunk;
×
NEW
27
    }
×
28

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

37
    /**
38
     * Gets the ID of the strategy used for the AI Agent for calculating embeddings.
39
     * @return The ID of the strategy used for the AI Agent for calculating embeddings.
40
     */
41
    public String getId() {
NEW
42
        return id;
×
43
    }
44

45
    /**
46
     * Sets the ID of the strategy used for the AI Agent for calculating embeddings.
47
     * @param id The ID of the strategy used for the AI Agent for calculating embeddings.
48
     */
49
    public void setId(String id) {
NEW
50
        this.id = id;
×
NEW
51
    }
×
52

53
    /**
54
     * Gets the number of tokens per chunk used for the AI Agent for calculating embeddings.
55
     * @return The number of tokens per chunk used for the AI Agent for calculating embeddings.
56
     */
57
    public int getNumTokensPerChunk() {
NEW
58
        return numTokensPerChunk;
×
59
    }
60

61
    /**
62
     * Sets the number of tokens per chunk used for the AI Agent for calculating embeddings.
63
     * @param numTokensPerChunk The number of tokens per chunk used for the AI Agent for calculating embeddings.
64
     */
65
    public void setNumTokensPerChunk(int numTokensPerChunk) {
NEW
66
        this.numTokensPerChunk = numTokensPerChunk;
×
NEW
67
    }
×
68

69
    @Override
70
    void parseJSONMember(JsonObject.Member member) {
71
        super.parseJSONMember(member);
1✔
72
        String memberName = member.getName();
1✔
73
        if (memberName.equals("id")) {
1✔
74
            this.id = member.getValue().asString();
1✔
75
        } else if (memberName.equals("num_tokens_per_chunk")) {
1✔
76
            this.numTokensPerChunk = member.getValue().asInt();
1✔
77
        }
78
    }
1✔
79

80
    public JsonObject getJSONObject() {
81
        JsonObject jsonObject = new JsonObject();
1✔
82
        JsonUtils.addIfNotNull(jsonObject, "id", this.id);
1✔
83
        JsonUtils.addIfNotNull(jsonObject, "num_tokens_per_chunk", this.numTokensPerChunk);
1✔
84
        return jsonObject;
1✔
85
    }
86
}
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