Skip to content

Commit 949b856

Browse files
feat: Support AI Studio API (box/box-codegen#626) (#520)
1 parent 98b6a90 commit 949b856

29 files changed

+3568
-184
lines changed

.codegen.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "59337f7", "specHash": "59747aa", "version": "1.12.0" }
1+
{ "engineHash": "8a9cc1d", "specHash": "f20ba3f", "version": "1.12.0" }

docs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ General explanations of the available functionality and examples of how to use
66
the SDK are available by topic:
77

88
- [Ai](ai.md)
9+
- [Ai studio](aiStudio.md)
910
- [App item associations](appItemAssociations.md)
1011
- [Authorization](authorization.md)
1112
- [Avatars](avatars.md)

docs/aiStudio.md

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# AiStudioManager
2+
3+
- [List AI agents](#list-ai-agents)
4+
- [Create AI agent](#create-ai-agent)
5+
- [Update AI agent](#update-ai-agent)
6+
- [Get AI agent by agent ID](#get-ai-agent-by-agent-id)
7+
- [Delete AI agent](#delete-ai-agent)
8+
9+
## List AI agents
10+
11+
Lists AI agents based on the provided parameters.
12+
13+
This operation is performed by calling function `getAiAgents`.
14+
15+
See the endpoint docs at
16+
[API Reference](https://developer.box.com/reference/get-ai-agents/).
17+
18+
<!-- sample get_ai_agents -->
19+
20+
```ts
21+
await client.aiStudio.getAiAgents();
22+
```
23+
24+
### Arguments
25+
26+
- queryParams `GetAiAgentsQueryParams`
27+
- Query parameters of getAiAgents method
28+
- headersInput `GetAiAgentsHeadersInput`
29+
- Headers of getAiAgents method
30+
- cancellationToken `undefined | CancellationToken`
31+
- Token used for request cancellation.
32+
33+
### Returns
34+
35+
This function returns a value of type `AiMultipleAgentResponse`.
36+
37+
A successful response including the agents list.
38+
39+
## Create AI agent
40+
41+
Creates an AI agent. At least one of the following capabilities must be provided: `ask`, `text_gen`, `extract`.
42+
43+
This operation is performed by calling function `createAiAgent`.
44+
45+
See the endpoint docs at
46+
[API Reference](https://developer.box.com/reference/post-ai-agents/).
47+
48+
<!-- sample post_ai_agents -->
49+
50+
```ts
51+
await client.aiStudio.createAiAgent({
52+
name: agentName,
53+
accessState: 'enabled',
54+
ask: new AiStudioAgentAsk({ accessState: 'enabled', description: 'desc1' }),
55+
} satisfies CreateAiAgentInput);
56+
```
57+
58+
### Arguments
59+
60+
- requestBodyInput `CreateAiAgentInput`
61+
- Request body of createAiAgent method
62+
- optionalsInput `CreateAiAgentOptionalsInput`
63+
-
64+
65+
### Returns
66+
67+
This function returns a value of type `AiSingleAgentResponseFull`.
68+
69+
Definition of created AI agent.
70+
71+
## Update AI agent
72+
73+
Updates an AI agent.
74+
75+
This operation is performed by calling function `updateAiAgentById`.
76+
77+
See the endpoint docs at
78+
[API Reference](https://developer.box.com/reference/put-ai-agents-id/).
79+
80+
<!-- sample put_ai_agents_id -->
81+
82+
```ts
83+
await client.aiStudio.updateAiAgentById(createdAgent.id, {
84+
name: agentName,
85+
accessState: 'enabled',
86+
ask: new AiStudioAgentAsk({ accessState: 'disabled', description: 'desc2' }),
87+
} satisfies CreateAiAgentInput);
88+
```
89+
90+
### Arguments
91+
92+
- agentId `string`
93+
- The ID of the agent to update. Example: "1234"
94+
- requestBodyInput `CreateAiAgentInput`
95+
- Request body of updateAiAgentById method
96+
- optionalsInput `UpdateAiAgentByIdOptionalsInput`
97+
-
98+
99+
### Returns
100+
101+
This function returns a value of type `AiSingleAgentResponseFull`.
102+
103+
Definition of created AI agent.
104+
105+
## Get AI agent by agent ID
106+
107+
Gets an AI Agent using the `agent_id` parameter.
108+
109+
This operation is performed by calling function `getAiAgentById`.
110+
111+
See the endpoint docs at
112+
[API Reference](https://developer.box.com/reference/get-ai-agents-id/).
113+
114+
<!-- sample get_ai_agents_id -->
115+
116+
```ts
117+
await client.aiStudio.getAiAgentById(createdAgent.id, {
118+
queryParams: {
119+
fields: ['ask' as string],
120+
} satisfies GetAiAgentByIdQueryParams,
121+
} satisfies GetAiAgentByIdOptionalsInput);
122+
```
123+
124+
### Arguments
125+
126+
- agentId `string`
127+
- The agent id to get. Example: "1234"
128+
- optionalsInput `GetAiAgentByIdOptionalsInput`
129+
-
130+
131+
### Returns
132+
133+
This function returns a value of type `AiSingleAgentResponseFull`.
134+
135+
A successful response including the agent.
136+
137+
## Delete AI agent
138+
139+
Deletes an AI agent using the provided parameters.
140+
141+
This operation is performed by calling function `deleteAiAgentById`.
142+
143+
See the endpoint docs at
144+
[API Reference](https://developer.box.com/reference/delete-ai-agents-id/).
145+
146+
<!-- sample delete_ai_agents_id -->
147+
148+
```ts
149+
await client.aiStudio.deleteAiAgentById(createdAgent.id);
150+
```
151+
152+
### Arguments
153+
154+
- agentId `string`
155+
- The ID of the agent to delete. Example: "1234"
156+
- optionalsInput `DeleteAiAgentByIdOptionalsInput`
157+
-
158+
159+
### Returns
160+
161+
This function returns a value of type `undefined`.
162+
163+
A successful response with no content.

docs/docgen.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
- [Get Box Doc Gen job by ID](#get-box-doc-gen-job-by-id)
44
- [List all Box Doc Gen jobs](#list-all-box-doc-gen-jobs)
5-
- [Get Box Doc Gen jobs in a batch with a specific ID](#get-box-doc-gen-jobs-in-a-batch-with-a-specific-id)
6-
- [Generate document using a Box Doc Gen template](#generate-document-using-a-box-doc-gen-template)
5+
- [Get Box Doc Gen jobs by batch ID](#get-box-doc-gen-jobs-by-batch-id)
6+
- [Generate document using Box Doc Gen template](#generate-document-using-box-doc-gen-template)
77

88
## Get Box Doc Gen job by ID
99

@@ -63,7 +63,7 @@ This function returns a value of type `DocGenJobsFullV2025R0`.
6363

6464
A list of Box Doc Gen jobs.
6565

66-
## Get Box Doc Gen jobs in a batch with a specific ID
66+
## Get Box Doc Gen jobs by batch ID
6767

6868
Lists Box Doc Gen jobs in a batch
6969

@@ -91,7 +91,7 @@ This function returns a value of type `DocGenJobsV2025R0`.
9191

9292
Returns a list of Box Doc Gen jobs in a Box Doc Gen batch.
9393

94-
## Generate document using a Box Doc Gen template
94+
## Generate document using Box Doc Gen template
9595

9696
Generates a document using a Box Doc Gen template.
9797

docs/docgenTemplate.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# DocgenTemplateManager
22

3-
- [Create a Box Doc Gen template](#create-a-box-doc-gen-template)
3+
- [Create Box Doc Gen template](#create-box-doc-gen-template)
44
- [List Box Doc Gen templates](#list-box-doc-gen-templates)
55
- [Delete Box Doc Gen template](#delete-box-doc-gen-template)
66
- [Get Box Doc Gen template by ID](#get-box-doc-gen-template-by-id)
77
- [List all Box Doc Gen template tags in template](#list-all-box-doc-gen-template-tags-in-template)
88
- [Get list of all Box Doc Gen jobs for template](#get-list-of-all-box-doc-gen-jobs-for-template)
99

10-
## Create a Box Doc Gen template
10+
## Create Box Doc Gen template
1111

1212
Marks a file as a Box Doc Gen template.
1313

0 commit comments

Comments
 (0)