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

box / box-java-sdk / #3996

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

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

52.38
/src/main/java/com/box/sdk/BoxAIAgentLLMEndpointParams.java
1
package com.box.sdk;
2

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

6
/**
7
 * The parameters for the LLM endpoint specific to OpenAI / Google models.
8
 */
9
public class BoxAIAgentLLMEndpointParams extends BoxJSONObject {
10
    /**
11
     * The type of the LLM endpoint parameters.
12
     * Value can be "google_params" or "openai_params".
13
     */
14
    private String type;
15

16
    /**
17
     * Constructs LLM endpoint parameters with default settings.
18
     */
19
    public BoxAIAgentLLMEndpointParams(String type) {
NEW
20
        super();
×
NEW
21
        this.type = type;
×
NEW
22
    }
×
23

24
    /**
25
     * Constructs LLM endpoint parameters with default settings.
26
     * @param jsonObject JSON object representing the LLM endpoint parameters.
27
     */
28
    public BoxAIAgentLLMEndpointParams(JsonObject jsonObject) {
29
        super(jsonObject);
1✔
30
    }
1✔
31

32
    /**
33
     * Parses a JSON object representing LLM endpoint parameters.
34
     * @param jsonObject JSON object representing the LLM endpoint parameters.
35
     * @return The LLM endpoint parameters parsed from the JSON object.
36
     */
37
    public static BoxAIAgentLLMEndpointParams parse(JsonObject jsonObject) {
38
        String type = jsonObject.get("type").asString();
1✔
39
        switch (type) {
1✔
40
            case BoxAIAgentLLMEndpointParamsGoogle.TYPE:
NEW
41
                return new BoxAIAgentLLMEndpointParamsGoogle(jsonObject);
×
42
            case BoxAIAgentLLMEndpointParamsOpenAI.TYPE:
43
                return new BoxAIAgentLLMEndpointParamsOpenAI(jsonObject);
1✔
44
            default:
NEW
45
                throw new IllegalArgumentException("Invalid LLM endpoint params type: " + type);
×
46
        }
47
    }
48

49
    /**
50
     * Gets the type of the LLM endpoint parameters.
51
     * @return The type of the LLM endpoint parameters.
52
     */
53
    public String getType() {
54
        return type;
1✔
55
    }
56

57
    /**
58
     * Sets the type of the LLM endpoint parameters.
59
     * @param type The type of the LLM endpoint parameters.
60
     */
61
    public void setType(String type) {
NEW
62
        this.type = type;
×
NEW
63
    }
×
64

65
    @Override
66
    void parseJSONMember(JsonObject.Member member) {
67
        super.parseJSONMember(member);
1✔
68
        String memberName = member.getName();
1✔
69
        if (memberName.equals("type")) {
1✔
70
            this.type = member.getValue().asString();
1✔
71
        }
72
    }
1✔
73

74
    public JsonObject getJSONObject() {
NEW
75
        JsonObject jsonObject = new JsonObject();
×
NEW
76
        JsonUtils.addIfNotNull(jsonObject, "type", this.type);
×
NEW
77
        return jsonObject;
×
78
    }
79
}
80

81

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