Skip to content

Commit

Permalink
feat: add AI Studio API (box/box-openapi#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Feb 19, 2025
1 parent 82cfcf0 commit 0da38a1
Show file tree
Hide file tree
Showing 38 changed files with 3,332 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "c1e6fc8", "specHash": "153fd54", "version": "0.5.0" }
{ "engineHash": "c1e6fc8", "specHash": "f20ba3f", "version": "0.5.0" }
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ General explanations of the available functionality and examples of how to use
the SDK are available by topic:

* [Ai](ai.md)
* [Aistudio](aistudio.md)
* [Appitemassociations](appitemassociations.md)
* [Authorization](authorization.md)
* [Avatars](avatars.md)
Expand Down
143 changes: 143 additions & 0 deletions docs/aistudio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# AiStudioManager


- [List AI agents](#list-ai-agents)
- [Create AI agent](#create-ai-agent)
- [Update AI agent](#update-ai-agent)
- [Get AI agent by agent ID](#get-ai-agent-by-agent-id)
- [Delete AI agent](#delete-ai-agent)

## List AI agents

Lists AI agents based on the provided parameters.

This operation is performed by calling function `getAiAgents`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-ai-agents/).

*Currently we don't have an example for calling `getAiAgents` in integration tests*

### Arguments

- queryParams `GetAiAgentsQueryParams`
- Query parameters of getAiAgents method
- headers `GetAiAgentsHeaders`
- Headers of getAiAgents method


### Returns

This function returns a value of type `AiMultipleAgentResponse`.

A successful response including the agents list.


## Create AI agent

Creates an AI agent. At least one of the following capabilities must be provided: `ask`, `text_gen`, `extract`.

This operation is performed by calling function `createAiAgent`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-ai-agents/).

*Currently we don't have an example for calling `createAiAgent` in integration tests*

### Arguments

- requestBody `CreateAiAgent`
- Request body of createAiAgent method
- headers `CreateAiAgentHeaders`
- Headers of createAiAgent method


### Returns

This function returns a value of type `AiSingleAgentResponseFull`.

Definition of created AI agent.


## Update AI agent

Updates an AI agent.

This operation is performed by calling function `updateAiAgentById`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/put-ai-agents-id/).

*Currently we don't have an example for calling `updateAiAgentById` in integration tests*

### Arguments

- agentId `String`
- The ID of the agent to update. Example: "1234"
- requestBody `CreateAiAgent`
- Request body of updateAiAgentById method
- headers `UpdateAiAgentByIdHeaders`
- Headers of updateAiAgentById method


### Returns

This function returns a value of type `AiSingleAgentResponseFull`.

Definition of created AI agent.


## Get AI agent by agent ID

Gets an AI Agent using the `agent_id` parameter.

This operation is performed by calling function `getAiAgentById`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-ai-agents-id/).

*Currently we don't have an example for calling `getAiAgentById` in integration tests*

### Arguments

- agentId `String`
- The agent id to get. Example: "1234"
- queryParams `GetAiAgentByIdQueryParams`
- Query parameters of getAiAgentById method
- headers `GetAiAgentByIdHeaders`
- Headers of getAiAgentById method


### Returns

This function returns a value of type `AiSingleAgentResponseFull`.

A successful response including the agent.


## Delete AI agent

Deletes an AI agent using the provided parameters.

This operation is performed by calling function `deleteAiAgentById`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/delete-ai-agents-id/).

*Currently we don't have an example for calling `deleteAiAgentById` in integration tests*

### Arguments

- agentId `String`
- The ID of the agent to delete. Example: "1234"
- headers `DeleteAiAgentByIdHeaders`
- Headers of deleteAiAgentById method


### Returns

This function returns a value of type `void`.

A successful response with no content.


17 changes: 17 additions & 0 deletions src/main/java/com/box/sdkgen/client/BoxClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;

import com.box.sdkgen.managers.ai.AiManager;
import com.box.sdkgen.managers.aistudio.AiStudioManager;
import com.box.sdkgen.managers.appitemassociations.AppItemAssociationsManager;
import com.box.sdkgen.managers.authorization.AuthorizationManager;
import com.box.sdkgen.managers.avatars.AvatarsManager;
Expand Down Expand Up @@ -231,6 +232,8 @@ public class BoxClient {

public final AiManager ai;

public final AiStudioManager aiStudio;

public final DocgenTemplateManager docgenTemplate;

public final DocgenManager docgen;
Expand Down Expand Up @@ -592,6 +595,11 @@ public BoxClient(Authentication auth) {
.auth(this.auth)
.networkSession(this.networkSession)
.build();
this.aiStudio =
new AiStudioManager.AiStudioManagerBuilder()
.auth(this.auth)
.networkSession(this.networkSession)
.build();
this.docgenTemplate =
new DocgenTemplateManager.DocgenTemplateManagerBuilder()
.auth(this.auth)
Expand Down Expand Up @@ -960,6 +968,11 @@ protected BoxClient(BoxClientBuilder builder) {
.auth(this.auth)
.networkSession(this.networkSession)
.build();
this.aiStudio =
new AiStudioManager.AiStudioManagerBuilder()
.auth(this.auth)
.networkSession(this.networkSession)
.build();
this.docgenTemplate =
new DocgenTemplateManager.DocgenTemplateManagerBuilder()
.auth(this.auth)
Expand Down Expand Up @@ -1319,6 +1332,10 @@ public AiManager getAi() {
return ai;
}

public AiStudioManager getAiStudio() {
return aiStudio;
}

public DocgenTemplateManager getDocgenTemplate() {
return docgenTemplate;
}
Expand Down
Loading

0 comments on commit 0da38a1

Please sign in to comment.