-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
468c98a
commit c7a092f
Showing
7 changed files
with
101 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.box.sdk; | ||
|
||
|
||
import com.box.sdk.internal.utils.JsonUtils; | ||
import com.eclipsesource.json.JsonObject; | ||
|
||
public class BoxAIExtractFieldOption extends BoxJSONObject { | ||
/** | ||
* A unique identifier for the option. | ||
*/ | ||
final String key; | ||
|
||
/** | ||
* Constructs a BoxAIExtractFieldOption object with a given key. | ||
* | ||
* @param key the key of the field option. | ||
*/ | ||
public BoxAIExtractFieldOption(String key) { | ||
this.key = key; | ||
} | ||
|
||
public JsonObject getJSONObject() { | ||
JsonObject jsonObject = new JsonObject(); | ||
JsonUtils.addIfNotNull(jsonObject, "key", this.key); | ||
return jsonObject; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/box/sdk/BoxAIExtractStructuredResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.box.sdk; | ||
|
||
import com.eclipsesource.json.Json; | ||
import com.eclipsesource.json.JsonObject; | ||
|
||
/** | ||
* AI response to a user request. | ||
*/ | ||
public class BoxAIExtractStructuredResponse extends BoxJSONObject { | ||
private final JsonObject sourceJson; | ||
|
||
/** | ||
* Constructs a BoxAIResponse object. | ||
*/ | ||
public BoxAIExtractStructuredResponse(String json) { | ||
super(json); | ||
this.sourceJson = Json.parse(json).asObject(); | ||
} | ||
|
||
/** | ||
* Constructs an BoxAIResponse object using an already parsed JSON object. | ||
* | ||
* @param jsonObject the parsed JSON object. | ||
*/ | ||
BoxAIExtractStructuredResponse(JsonObject jsonObject) { | ||
super(jsonObject); | ||
this.sourceJson = jsonObject; | ||
} | ||
|
||
/** | ||
* Gets the source JSON of the AI response. | ||
* | ||
* @return the source JSON of the AI response. | ||
*/ | ||
public JsonObject getSourceJson() { | ||
return sourceJson; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters