@breign/client 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apis/AgentApi.d.ts +5 -4
- package/dist/apis/AgentApi.js +6 -3
- package/dist/apis/EngineApi.d.ts +6 -5
- package/dist/apis/EngineApi.js +13 -7
- package/dist/apis/FilesApi.d.ts +21 -21
- package/dist/apis/FilesApi.js +42 -42
- package/dist/apis/GeneralApi.d.ts +2 -2
- package/dist/apis/GeneralApi.js +3 -3
- package/dist/apis/GuardiansApi.d.ts +54 -54
- package/dist/apis/GuardiansApi.js +91 -91
- package/dist/apis/KnowledgeApi.d.ts +72 -72
- package/dist/apis/KnowledgeApi.js +152 -152
- package/dist/apis/ManifestsApi.d.ts +28 -28
- package/dist/apis/ManifestsApi.js +45 -45
- package/dist/apis/MetricsApi.d.ts +14 -14
- package/dist/apis/MetricsApi.js +18 -18
- package/dist/apis/OrganizationsApi.d.ts +3 -3
- package/dist/apis/OrganizationsApi.js +4 -4
- package/dist/apis/PromptsApi.d.ts +31 -31
- package/dist/apis/PromptsApi.js +60 -60
- package/dist/apis/RemotesApi.d.ts +3 -3
- package/dist/apis/RemotesApi.js +4 -4
- package/dist/apis/ToolsApi.d.ts +6 -6
- package/dist/apis/ToolsApi.js +8 -8
- package/dist/models/AgentPatchEngineUio.d.ts +38 -0
- package/dist/models/AgentPatchEngineUio.js +54 -0
- package/dist/models/AgentPatchUio.d.ts +4 -4
- package/dist/models/AgentPatchUio.js +3 -3
- package/dist/models/AgentRequestUio.d.ts +10 -1
- package/dist/models/AgentRequestUio.js +5 -3
- package/dist/models/AgentUio.d.ts +10 -3
- package/dist/models/AgentUio.js +4 -3
- package/dist/models/AppCreateRequestUio.d.ts +6 -0
- package/dist/models/AppCreateRequestUio.js +2 -0
- package/dist/models/AppSequencesInnerUio.d.ts +38 -0
- package/dist/models/AppSequencesInnerUio.js +50 -0
- package/dist/models/AppUio.d.ts +24 -3
- package/dist/models/AppUio.js +11 -10
- package/dist/models/ChatMessageAudioInnerUio.d.ts +38 -0
- package/dist/models/ChatMessageAudioInnerUio.js +54 -0
- package/dist/models/ChatMessageUio.d.ts +10 -2
- package/dist/models/ChatMessageUio.js +6 -2
- package/dist/models/ChatMessageWithFlowNodeUio.d.ts +129 -0
- package/dist/models/ChatMessageWithFlowNodeUio.js +95 -0
- package/dist/models/ChatUio.d.ts +9 -3
- package/dist/models/ChatUio.js +5 -3
- package/dist/models/ConversationFlowNodeEntrypointsUio.d.ts +32 -0
- package/dist/models/ConversationFlowNodeEntrypointsUio.js +48 -0
- package/dist/models/ConversationFlowNodeUio.d.ts +51 -0
- package/dist/models/ConversationFlowNodeUio.js +55 -0
- package/dist/models/ConversationUio.d.ts +7 -0
- package/dist/models/ConversationUio.js +5 -0
- package/dist/models/DefaultEngineRequestUio.d.ts +1 -7
- package/dist/models/DefaultEngineRequestUio.js +3 -7
- package/dist/models/EngineUio.d.ts +4 -7
- package/dist/models/EngineUio.js +6 -7
- package/dist/models/FileCreationRequestUio.d.ts +1 -1
- package/dist/models/FileCreationRequestUio.js +1 -3
- package/dist/models/FileCreationResponseUio.d.ts +6 -0
- package/dist/models/FileCreationResponseUio.js +2 -0
- package/dist/models/FileUio.d.ts +6 -0
- package/dist/models/FileUio.js +2 -0
- package/dist/models/FileWithDownloadUrlUio.d.ts +6 -0
- package/dist/models/FileWithDownloadUrlUio.js +2 -0
- package/dist/models/GuardianCreateRequestUio.d.ts +7 -0
- package/dist/models/GuardianCreateRequestUio.js +5 -0
- package/dist/models/GuardianEngineUio.d.ts +0 -7
- package/dist/models/GuardianEngineUio.js +0 -5
- package/dist/models/GuardianPutRequestUio.d.ts +7 -0
- package/dist/models/GuardianPutRequestUio.js +3 -0
- package/dist/models/GuardianTypeUio.d.ts +26 -0
- package/dist/models/GuardianTypeUio.js +52 -0
- package/dist/models/GuardianUio.d.ts +7 -0
- package/dist/models/GuardianUio.js +5 -0
- package/dist/models/ImportFileToAgentKnowledge200ResponseUio.d.ts +56 -0
- package/dist/models/ImportFileToAgentKnowledge200ResponseUio.js +56 -0
- package/dist/models/KnowledgeBaseFilesInnerUio.d.ts +44 -0
- package/dist/models/KnowledgeBaseFilesInnerUio.js +58 -0
- package/dist/models/KnowledgeBaseUio.d.ts +124 -0
- package/dist/models/KnowledgeBaseUio.js +88 -0
- package/dist/models/OrganizationUio.d.ts +0 -9
- package/dist/models/OrganizationUio.js +0 -6
- package/dist/models/ProviderCreateRequestUio.d.ts +4 -9
- package/dist/models/ProviderCreateRequestUio.js +4 -9
- package/dist/models/ProviderTypeUio.d.ts +27 -0
- package/dist/models/ProviderTypeUio.js +53 -0
- package/dist/models/ProviderUio.d.ts +4 -9
- package/dist/models/ProviderUio.js +4 -9
- package/dist/models/index.d.ts +11 -6
- package/dist/models/index.js +11 -6
- package/dist/openapi.json +369 -120
- package/package.json +1 -1
- package/dist/models/AgentKnowledgeBaseUio.d.ts +0 -57
- package/dist/models/AgentKnowledgeBaseUio.js +0 -67
- package/dist/models/AgentsAgentIdKnowledgeFileImportsPost200ResponseUio.d.ts +0 -56
- package/dist/models/AgentsAgentIdKnowledgeFileImportsPost200ResponseUio.js +0 -56
- package/dist/models/DuplicateAgent201ResponseUio.d.ts +0 -32
- package/dist/models/DuplicateAgent201ResponseUio.js +0 -50
- package/dist/models/EngineTypeUio.d.ts +0 -25
- package/dist/models/EngineTypeUio.js +0 -51
- package/dist/models/GuardianEngineTypeUio.d.ts +0 -26
- package/dist/models/GuardianEngineTypeUio.js +0 -52
- package/dist/models/GuardianExcludedAgentsRequestUio.d.ts +0 -32
- package/dist/models/GuardianExcludedAgentsRequestUio.js +0 -50
|
@@ -54,136 +54,119 @@ const index_1 = require("../models/index");
|
|
|
54
54
|
*/
|
|
55
55
|
class KnowledgeApi extends runtime.BaseAPI {
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
58
|
-
* Add a
|
|
57
|
+
* Adds a text document to the agent\'s knowledge base, splitting it into chunks if necessary
|
|
58
|
+
* Add a document to agent\'s knowledge base
|
|
59
59
|
*/
|
|
60
|
-
async
|
|
61
|
-
if (requestParameters['
|
|
62
|
-
throw new runtime.RequiredError('
|
|
60
|
+
async addDocumentToKnowledgeBaseRaw(requestParameters, initOverrides) {
|
|
61
|
+
if (requestParameters['agentId'] == null) {
|
|
62
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling addDocumentToKnowledgeBase().');
|
|
63
63
|
}
|
|
64
|
-
if (requestParameters['
|
|
65
|
-
throw new runtime.RequiredError('
|
|
64
|
+
if (requestParameters['documentAddRequestUio'] == null) {
|
|
65
|
+
throw new runtime.RequiredError('documentAddRequestUio', 'Required parameter "documentAddRequestUio" was null or undefined when calling addDocumentToKnowledgeBase().');
|
|
66
66
|
}
|
|
67
67
|
const queryParameters = {};
|
|
68
|
+
if (requestParameters['noSplit'] != null) {
|
|
69
|
+
queryParameters['noSplit'] = requestParameters['noSplit'];
|
|
70
|
+
}
|
|
68
71
|
const headerParameters = {};
|
|
69
72
|
headerParameters['Content-Type'] = 'application/json';
|
|
70
73
|
if (this.configuration && this.configuration.apiKey) {
|
|
71
74
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
72
75
|
}
|
|
73
76
|
const response = await this.request({
|
|
74
|
-
path: `/
|
|
77
|
+
path: `/agents/{agentId}/knowledge/documents`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
75
78
|
method: 'POST',
|
|
76
79
|
headers: headerParameters,
|
|
77
80
|
query: queryParameters,
|
|
78
|
-
body: (0, index_1.
|
|
81
|
+
body: (0, index_1.DocumentAddRequestUioToJSON)(requestParameters['documentAddRequestUio']),
|
|
79
82
|
}, initOverrides);
|
|
80
|
-
return new runtime.
|
|
83
|
+
return new runtime.VoidApiResponse(response);
|
|
81
84
|
}
|
|
82
85
|
/**
|
|
83
|
-
*
|
|
84
|
-
* Add a
|
|
86
|
+
* Adds a text document to the agent\'s knowledge base, splitting it into chunks if necessary
|
|
87
|
+
* Add a document to agent\'s knowledge base
|
|
85
88
|
*/
|
|
86
|
-
async
|
|
87
|
-
|
|
88
|
-
return await response.value();
|
|
89
|
+
async addDocumentToKnowledgeBase(agentId, documentAddRequestUio, noSplit, initOverrides) {
|
|
90
|
+
await this.addDocumentToKnowledgeBaseRaw({ agentId: agentId, documentAddRequestUio: documentAddRequestUio, noSplit: noSplit }, initOverrides);
|
|
89
91
|
}
|
|
90
92
|
/**
|
|
91
|
-
*
|
|
92
|
-
* Add a
|
|
93
|
+
* Add a file to the knowledge base
|
|
94
|
+
* Add a file to the knowledge base
|
|
93
95
|
*/
|
|
94
|
-
async
|
|
95
|
-
if (requestParameters['
|
|
96
|
-
throw new runtime.RequiredError('
|
|
96
|
+
async addFileToKnowledgeBaseRaw(requestParameters, initOverrides) {
|
|
97
|
+
if (requestParameters['organizationId'] == null) {
|
|
98
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling addFileToKnowledgeBase().');
|
|
97
99
|
}
|
|
98
|
-
if (requestParameters['
|
|
99
|
-
throw new runtime.RequiredError('
|
|
100
|
+
if (requestParameters['fileCreationRequestUio'] == null) {
|
|
101
|
+
throw new runtime.RequiredError('fileCreationRequestUio', 'Required parameter "fileCreationRequestUio" was null or undefined when calling addFileToKnowledgeBase().');
|
|
100
102
|
}
|
|
101
103
|
const queryParameters = {};
|
|
102
|
-
if (requestParameters['noSplit'] != null) {
|
|
103
|
-
queryParameters['noSplit'] = requestParameters['noSplit'];
|
|
104
|
-
}
|
|
105
104
|
const headerParameters = {};
|
|
106
105
|
headerParameters['Content-Type'] = 'application/json';
|
|
107
106
|
if (this.configuration && this.configuration.apiKey) {
|
|
108
107
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
109
108
|
}
|
|
110
109
|
const response = await this.request({
|
|
111
|
-
path: `/
|
|
110
|
+
path: `/organizations/{organizationId}/knowledge/files`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
|
|
112
111
|
method: 'POST',
|
|
113
112
|
headers: headerParameters,
|
|
114
113
|
query: queryParameters,
|
|
115
|
-
body: (0, index_1.
|
|
114
|
+
body: (0, index_1.FileCreationRequestUioToJSON)(requestParameters['fileCreationRequestUio']),
|
|
116
115
|
}, initOverrides);
|
|
117
|
-
return new runtime.
|
|
116
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FileCreationResponseUioFromJSON)(jsonValue));
|
|
118
117
|
}
|
|
119
118
|
/**
|
|
120
|
-
*
|
|
121
|
-
* Add a
|
|
119
|
+
* Add a file to the knowledge base
|
|
120
|
+
* Add a file to the knowledge base
|
|
122
121
|
*/
|
|
123
|
-
async
|
|
124
|
-
await this.
|
|
122
|
+
async addFileToKnowledgeBase(organizationId, fileCreationRequestUio, initOverrides) {
|
|
123
|
+
const response = await this.addFileToKnowledgeBaseRaw({ organizationId: organizationId, fileCreationRequestUio: fileCreationRequestUio }, initOverrides);
|
|
124
|
+
return await response.value();
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
127
|
+
* Create a new module for an organization
|
|
128
|
+
* Create a new module for an organization
|
|
129
129
|
*/
|
|
130
|
-
async
|
|
131
|
-
if (requestParameters['
|
|
132
|
-
throw new runtime.RequiredError('
|
|
130
|
+
async createModuleForOrganizationRaw(requestParameters, initOverrides) {
|
|
131
|
+
if (requestParameters['organizationId'] == null) {
|
|
132
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling createModuleForOrganization().');
|
|
133
133
|
}
|
|
134
|
-
if (requestParameters['
|
|
135
|
-
throw new runtime.RequiredError('
|
|
134
|
+
if (requestParameters['agentModuleUio'] == null) {
|
|
135
|
+
throw new runtime.RequiredError('agentModuleUio', 'Required parameter "agentModuleUio" was null or undefined when calling createModuleForOrganization().');
|
|
136
136
|
}
|
|
137
137
|
const queryParameters = {};
|
|
138
138
|
const headerParameters = {};
|
|
139
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
139
140
|
if (this.configuration && this.configuration.apiKey) {
|
|
140
141
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
141
142
|
}
|
|
142
|
-
const consumes = [
|
|
143
|
-
{ contentType: 'multipart/form-data' },
|
|
144
|
-
];
|
|
145
|
-
// @ts-ignore: canConsumeForm may be unused
|
|
146
|
-
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
147
|
-
let formParams;
|
|
148
|
-
let useForm = false;
|
|
149
|
-
// use FormData to transmit files using content-type "multipart/form-data"
|
|
150
|
-
useForm = canConsumeForm;
|
|
151
|
-
if (useForm) {
|
|
152
|
-
formParams = new FormData();
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
formParams = new URLSearchParams();
|
|
156
|
-
}
|
|
157
|
-
if (requestParameters['file'] != null) {
|
|
158
|
-
formParams.append('file', requestParameters['file']);
|
|
159
|
-
}
|
|
160
143
|
const response = await this.request({
|
|
161
|
-
path: `/
|
|
144
|
+
path: `/organizations/{organizationId}/modules`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
|
|
162
145
|
method: 'POST',
|
|
163
146
|
headers: headerParameters,
|
|
164
147
|
query: queryParameters,
|
|
165
|
-
body:
|
|
148
|
+
body: (0, index_1.AgentModuleUioToJSON)(requestParameters['agentModuleUio']),
|
|
166
149
|
}, initOverrides);
|
|
167
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
150
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AgentModuleUioFromJSON)(jsonValue));
|
|
168
151
|
}
|
|
169
152
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
153
|
+
* Create a new module for an organization
|
|
154
|
+
* Create a new module for an organization
|
|
172
155
|
*/
|
|
173
|
-
async
|
|
174
|
-
const response = await this.
|
|
156
|
+
async createModuleForOrganization(organizationId, agentModuleUio, initOverrides) {
|
|
157
|
+
const response = await this.createModuleForOrganizationRaw({ organizationId: organizationId, agentModuleUio: agentModuleUio }, initOverrides);
|
|
175
158
|
return await response.value();
|
|
176
159
|
}
|
|
177
160
|
/**
|
|
178
161
|
* Removes a file and its associated chunks from the agent\'s knowledge base
|
|
179
162
|
* Delete a knowledge file from an agent
|
|
180
163
|
*/
|
|
181
|
-
async
|
|
164
|
+
async deleteFileFromAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
182
165
|
if (requestParameters['agentId'] == null) {
|
|
183
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling
|
|
166
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling deleteFileFromAgentKnowledge().');
|
|
184
167
|
}
|
|
185
168
|
if (requestParameters['fileId'] == null) {
|
|
186
|
-
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling
|
|
169
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling deleteFileFromAgentKnowledge().');
|
|
187
170
|
}
|
|
188
171
|
const queryParameters = {};
|
|
189
172
|
const headerParameters = {};
|
|
@@ -202,19 +185,19 @@ class KnowledgeApi extends runtime.BaseAPI {
|
|
|
202
185
|
* Removes a file and its associated chunks from the agent\'s knowledge base
|
|
203
186
|
* Delete a knowledge file from an agent
|
|
204
187
|
*/
|
|
205
|
-
async
|
|
206
|
-
await this.
|
|
188
|
+
async deleteFileFromAgentKnowledge(agentId, fileId, initOverrides) {
|
|
189
|
+
await this.deleteFileFromAgentKnowledgeRaw({ agentId: agentId, fileId: fileId }, initOverrides);
|
|
207
190
|
}
|
|
208
191
|
/**
|
|
209
192
|
* Retrieves metadata for a file that has been imported into the agent\'s knowledge base
|
|
210
193
|
* Get a specific knowledge file from an agent
|
|
211
194
|
*/
|
|
212
|
-
async
|
|
195
|
+
async getFileFromAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
213
196
|
if (requestParameters['agentId'] == null) {
|
|
214
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling
|
|
197
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling getFileFromAgentKnowledge().');
|
|
215
198
|
}
|
|
216
199
|
if (requestParameters['fileId'] == null) {
|
|
217
|
-
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling
|
|
200
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFileFromAgentKnowledge().');
|
|
218
201
|
}
|
|
219
202
|
const queryParameters = {};
|
|
220
203
|
const headerParameters = {};
|
|
@@ -233,121 +216,130 @@ class KnowledgeApi extends runtime.BaseAPI {
|
|
|
233
216
|
* Retrieves metadata for a file that has been imported into the agent\'s knowledge base
|
|
234
217
|
* Get a specific knowledge file from an agent
|
|
235
218
|
*/
|
|
236
|
-
async
|
|
237
|
-
const response = await this.
|
|
219
|
+
async getFileFromAgentKnowledge(agentId, fileId, initOverrides) {
|
|
220
|
+
const response = await this.getFileFromAgentKnowledgeRaw({ agentId: agentId, fileId: fileId }, initOverrides);
|
|
238
221
|
return await response.value();
|
|
239
222
|
}
|
|
240
223
|
/**
|
|
241
|
-
*
|
|
242
|
-
*
|
|
224
|
+
* Processes documents like PDFs, CSVs, and text files, and adds them to the brain\'s knowledge base
|
|
225
|
+
* Upload and import a file into the brain\'s knowledge base
|
|
243
226
|
*/
|
|
244
|
-
async
|
|
227
|
+
async importFileToAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
245
228
|
if (requestParameters['agentId'] == null) {
|
|
246
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling
|
|
247
|
-
}
|
|
248
|
-
if (requestParameters['fileId'] == null) {
|
|
249
|
-
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling agentsAgentIdKnowledgeFilesFileIdStatusPost().');
|
|
229
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling importFileToAgentKnowledge().');
|
|
250
230
|
}
|
|
251
|
-
if (requestParameters['
|
|
252
|
-
throw new runtime.RequiredError('
|
|
231
|
+
if (requestParameters['file'] == null) {
|
|
232
|
+
throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling importFileToAgentKnowledge().');
|
|
253
233
|
}
|
|
254
234
|
const queryParameters = {};
|
|
255
235
|
const headerParameters = {};
|
|
256
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
257
236
|
if (this.configuration && this.configuration.apiKey) {
|
|
258
237
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
259
238
|
}
|
|
239
|
+
const consumes = [
|
|
240
|
+
{ contentType: 'multipart/form-data' },
|
|
241
|
+
];
|
|
242
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
243
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
244
|
+
let formParams;
|
|
245
|
+
let useForm = false;
|
|
246
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
247
|
+
useForm = canConsumeForm;
|
|
248
|
+
if (useForm) {
|
|
249
|
+
formParams = new FormData();
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
formParams = new URLSearchParams();
|
|
253
|
+
}
|
|
254
|
+
if (requestParameters['file'] != null) {
|
|
255
|
+
formParams.append('file', requestParameters['file']);
|
|
256
|
+
}
|
|
260
257
|
const response = await this.request({
|
|
261
|
-
path: `/agents/{agentId}/knowledge/
|
|
258
|
+
path: `/agents/{agentId}/knowledge/file-imports`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
262
259
|
method: 'POST',
|
|
263
260
|
headers: headerParameters,
|
|
264
261
|
query: queryParameters,
|
|
265
|
-
body:
|
|
262
|
+
body: formParams,
|
|
266
263
|
}, initOverrides);
|
|
267
|
-
|
|
268
|
-
return new runtime.JSONApiResponse(response);
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
return new runtime.TextApiResponse(response);
|
|
272
|
-
}
|
|
264
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ImportFileToAgentKnowledge200ResponseUioFromJSON)(jsonValue));
|
|
273
265
|
}
|
|
274
266
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
267
|
+
* Processes documents like PDFs, CSVs, and text files, and adds them to the brain\'s knowledge base
|
|
268
|
+
* Upload and import a file into the brain\'s knowledge base
|
|
277
269
|
*/
|
|
278
|
-
async
|
|
279
|
-
const response = await this.
|
|
270
|
+
async importFileToAgentKnowledge(agentId, file, initOverrides) {
|
|
271
|
+
const response = await this.importFileToAgentKnowledgeRaw({ agentId: agentId, file: file }, initOverrides);
|
|
280
272
|
return await response.value();
|
|
281
273
|
}
|
|
282
274
|
/**
|
|
283
|
-
*
|
|
284
|
-
*
|
|
275
|
+
* Imports project data from a local JSON file into the agent\'s knowledge base
|
|
276
|
+
* Import projects into agent knowledge
|
|
285
277
|
*/
|
|
286
|
-
async
|
|
278
|
+
async importProjectsToAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
287
279
|
if (requestParameters['agentId'] == null) {
|
|
288
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling
|
|
289
|
-
}
|
|
290
|
-
if (requestParameters['fileCreationRequestUio'] == null) {
|
|
291
|
-
throw new runtime.RequiredError('fileCreationRequestUio', 'Required parameter "fileCreationRequestUio" was null or undefined when calling agentsAgentIdKnowledgeFilesPost().');
|
|
280
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling importProjectsToAgentKnowledge().');
|
|
292
281
|
}
|
|
293
282
|
const queryParameters = {};
|
|
294
283
|
const headerParameters = {};
|
|
295
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
296
284
|
if (this.configuration && this.configuration.apiKey) {
|
|
297
285
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
298
286
|
}
|
|
299
287
|
const response = await this.request({
|
|
300
|
-
path: `/agents/{agentId}/knowledge/
|
|
288
|
+
path: `/agents/{agentId}/knowledge/project-imports`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
301
289
|
method: 'POST',
|
|
302
290
|
headers: headerParameters,
|
|
303
291
|
query: queryParameters,
|
|
304
|
-
body: (0, index_1.FileCreationRequestUioToJSON)(requestParameters['fileCreationRequestUio']),
|
|
305
292
|
}, initOverrides);
|
|
306
|
-
return new runtime.
|
|
293
|
+
return new runtime.VoidApiResponse(response);
|
|
307
294
|
}
|
|
308
295
|
/**
|
|
309
|
-
*
|
|
310
|
-
*
|
|
296
|
+
* Imports project data from a local JSON file into the agent\'s knowledge base
|
|
297
|
+
* Import projects into agent knowledge
|
|
311
298
|
*/
|
|
312
|
-
async
|
|
313
|
-
|
|
314
|
-
return await response.value();
|
|
299
|
+
async importProjectsToAgentKnowledge(agentId, initOverrides) {
|
|
300
|
+
await this.importProjectsToAgentKnowledgeRaw({ agentId: agentId }, initOverrides);
|
|
315
301
|
}
|
|
316
302
|
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
303
|
+
* Registers a file for upload to the brain\'s knowledge base and returns an upload URL
|
|
304
|
+
* Prepare file upload for knowledge base
|
|
319
305
|
*/
|
|
320
|
-
async
|
|
306
|
+
async prepareFileUploadRaw(requestParameters, initOverrides) {
|
|
321
307
|
if (requestParameters['agentId'] == null) {
|
|
322
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling
|
|
308
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling prepareFileUpload().');
|
|
309
|
+
}
|
|
310
|
+
if (requestParameters['fileCreationRequestUio'] == null) {
|
|
311
|
+
throw new runtime.RequiredError('fileCreationRequestUio', 'Required parameter "fileCreationRequestUio" was null or undefined when calling prepareFileUpload().');
|
|
323
312
|
}
|
|
324
313
|
const queryParameters = {};
|
|
325
314
|
const headerParameters = {};
|
|
315
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
326
316
|
if (this.configuration && this.configuration.apiKey) {
|
|
327
317
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
328
318
|
}
|
|
329
319
|
const response = await this.request({
|
|
330
|
-
path: `/agents/{agentId}/knowledge/
|
|
320
|
+
path: `/agents/{agentId}/knowledge/files`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
331
321
|
method: 'POST',
|
|
332
322
|
headers: headerParameters,
|
|
333
323
|
query: queryParameters,
|
|
324
|
+
body: (0, index_1.FileCreationRequestUioToJSON)(requestParameters['fileCreationRequestUio']),
|
|
334
325
|
}, initOverrides);
|
|
335
|
-
return new runtime.
|
|
326
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FileCreationResponseUioFromJSON)(jsonValue));
|
|
336
327
|
}
|
|
337
328
|
/**
|
|
338
|
-
*
|
|
339
|
-
*
|
|
329
|
+
* Registers a file for upload to the brain\'s knowledge base and returns an upload URL
|
|
330
|
+
* Prepare file upload for knowledge base
|
|
340
331
|
*/
|
|
341
|
-
async
|
|
342
|
-
await this.
|
|
332
|
+
async prepareFileUpload(agentId, fileCreationRequestUio, initOverrides) {
|
|
333
|
+
const response = await this.prepareFileUploadRaw({ agentId: agentId, fileCreationRequestUio: fileCreationRequestUio }, initOverrides);
|
|
334
|
+
return await response.value();
|
|
343
335
|
}
|
|
344
336
|
/**
|
|
345
337
|
* Deletes all knowledge embeddings and files associated with an agent
|
|
346
338
|
* Reset all knowledge for an agent
|
|
347
339
|
*/
|
|
348
|
-
async
|
|
340
|
+
async resetAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
349
341
|
if (requestParameters['agentId'] == null) {
|
|
350
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling
|
|
342
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling resetAgentKnowledge().');
|
|
351
343
|
}
|
|
352
344
|
const queryParameters = {};
|
|
353
345
|
const headerParameters = {};
|
|
@@ -366,70 +358,78 @@ class KnowledgeApi extends runtime.BaseAPI {
|
|
|
366
358
|
* Deletes all knowledge embeddings and files associated with an agent
|
|
367
359
|
* Reset all knowledge for an agent
|
|
368
360
|
*/
|
|
369
|
-
async
|
|
370
|
-
await this.
|
|
361
|
+
async resetAgentKnowledge(agentId, initOverrides) {
|
|
362
|
+
await this.resetAgentKnowledgeRaw({ agentId: agentId }, initOverrides);
|
|
371
363
|
}
|
|
372
364
|
/**
|
|
373
|
-
*
|
|
374
|
-
*
|
|
365
|
+
* Reset knowledge base
|
|
366
|
+
* Reset knowledge base
|
|
375
367
|
*/
|
|
376
|
-
async
|
|
368
|
+
async resetKnowledgeBaseRaw(requestParameters, initOverrides) {
|
|
377
369
|
if (requestParameters['organizationId'] == null) {
|
|
378
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling
|
|
379
|
-
}
|
|
380
|
-
if (requestParameters['agentModuleUio'] == null) {
|
|
381
|
-
throw new runtime.RequiredError('agentModuleUio', 'Required parameter "agentModuleUio" was null or undefined when calling createModuleForOrganization().');
|
|
370
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling resetKnowledgeBase().');
|
|
382
371
|
}
|
|
383
372
|
const queryParameters = {};
|
|
384
373
|
const headerParameters = {};
|
|
385
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
386
374
|
if (this.configuration && this.configuration.apiKey) {
|
|
387
375
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
388
376
|
}
|
|
389
377
|
const response = await this.request({
|
|
390
|
-
path: `/organizations/{organizationId}/
|
|
378
|
+
path: `/organizations/{organizationId}/knowledge/resets`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
|
|
391
379
|
method: 'POST',
|
|
392
380
|
headers: headerParameters,
|
|
393
381
|
query: queryParameters,
|
|
394
|
-
body: (0, index_1.AgentModuleUioToJSON)(requestParameters['agentModuleUio']),
|
|
395
382
|
}, initOverrides);
|
|
396
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
383
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BodyWithMessageUioFromJSON)(jsonValue));
|
|
397
384
|
}
|
|
398
385
|
/**
|
|
399
|
-
*
|
|
400
|
-
*
|
|
386
|
+
* Reset knowledge base
|
|
387
|
+
* Reset knowledge base
|
|
401
388
|
*/
|
|
402
|
-
async
|
|
403
|
-
const response = await this.
|
|
389
|
+
async resetKnowledgeBase(organizationId, initOverrides) {
|
|
390
|
+
const response = await this.resetKnowledgeBaseRaw({ organizationId: organizationId }, initOverrides);
|
|
404
391
|
return await response.value();
|
|
405
392
|
}
|
|
406
393
|
/**
|
|
407
|
-
*
|
|
408
|
-
*
|
|
394
|
+
* Updates the status of a knowledge file and triggers the indexing process if the file is uploaded
|
|
395
|
+
* Update file status and trigger indexing
|
|
409
396
|
*/
|
|
410
|
-
async
|
|
411
|
-
if (requestParameters['
|
|
412
|
-
throw new runtime.RequiredError('
|
|
397
|
+
async updateFileStatusRaw(requestParameters, initOverrides) {
|
|
398
|
+
if (requestParameters['agentId'] == null) {
|
|
399
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling updateFileStatus().');
|
|
400
|
+
}
|
|
401
|
+
if (requestParameters['fileId'] == null) {
|
|
402
|
+
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling updateFileStatus().');
|
|
403
|
+
}
|
|
404
|
+
if (requestParameters['fileStatusUpdateRequestUio'] == null) {
|
|
405
|
+
throw new runtime.RequiredError('fileStatusUpdateRequestUio', 'Required parameter "fileStatusUpdateRequestUio" was null or undefined when calling updateFileStatus().');
|
|
413
406
|
}
|
|
414
407
|
const queryParameters = {};
|
|
415
408
|
const headerParameters = {};
|
|
409
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
416
410
|
if (this.configuration && this.configuration.apiKey) {
|
|
417
411
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
418
412
|
}
|
|
419
413
|
const response = await this.request({
|
|
420
|
-
path: `/
|
|
414
|
+
path: `/agents/{agentId}/knowledge/files/{fileId}/status`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters['fileId']))),
|
|
421
415
|
method: 'POST',
|
|
422
416
|
headers: headerParameters,
|
|
423
417
|
query: queryParameters,
|
|
418
|
+
body: (0, index_1.FileStatusUpdateRequestUioToJSON)(requestParameters['fileStatusUpdateRequestUio']),
|
|
424
419
|
}, initOverrides);
|
|
425
|
-
|
|
420
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
421
|
+
return new runtime.JSONApiResponse(response);
|
|
422
|
+
}
|
|
423
|
+
else {
|
|
424
|
+
return new runtime.TextApiResponse(response);
|
|
425
|
+
}
|
|
426
426
|
}
|
|
427
427
|
/**
|
|
428
|
-
*
|
|
429
|
-
*
|
|
428
|
+
* Updates the status of a knowledge file and triggers the indexing process if the file is uploaded
|
|
429
|
+
* Update file status and trigger indexing
|
|
430
430
|
*/
|
|
431
|
-
async
|
|
432
|
-
const response = await this.
|
|
431
|
+
async updateFileStatus(agentId, fileId, fileStatusUpdateRequestUio, initOverrides) {
|
|
432
|
+
const response = await this.updateFileStatusRaw({ agentId: agentId, fileId: fileId, fileStatusUpdateRequestUio: fileStatusUpdateRequestUio }, initOverrides);
|
|
433
433
|
return await response.value();
|
|
434
434
|
}
|
|
435
435
|
}
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
13
|
import type { ManifestCreateRequestUio, ManifestUio } from '../models/index';
|
|
14
|
-
export interface
|
|
15
|
-
|
|
14
|
+
export interface CreateManifestRequest {
|
|
15
|
+
manifestCreateRequestUio: ManifestCreateRequestUio;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface DeleteManifestByIdRequest {
|
|
18
18
|
manifestId: string;
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
20
|
+
export interface GetManifestByIdRequest {
|
|
21
21
|
manifestId: string;
|
|
22
|
-
manifestCreateRequestUio: ManifestCreateRequestUio;
|
|
23
22
|
}
|
|
24
|
-
export interface
|
|
23
|
+
export interface UpdateManifestByIdRequest {
|
|
24
|
+
manifestId: string;
|
|
25
25
|
manifestCreateRequestUio: ManifestCreateRequestUio;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
@@ -29,53 +29,53 @@ export interface ManifestsPostRequest {
|
|
|
29
29
|
*/
|
|
30
30
|
export declare class ManifestsApi extends runtime.BaseAPI {
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* Creates a new manifest document
|
|
33
|
+
* Create a manifest
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
createManifestRaw(requestParameters: CreateManifestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ManifestUio>>;
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* Creates a new manifest document
|
|
38
|
+
* Create a manifest
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
createManifest(manifestCreateRequestUio: ManifestCreateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ManifestUio>;
|
|
41
41
|
/**
|
|
42
42
|
* Deletes a manifest by ID
|
|
43
43
|
* Delete manifest
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
deleteManifestByIdRaw(requestParameters: DeleteManifestByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
46
46
|
/**
|
|
47
47
|
* Deletes a manifest by ID
|
|
48
48
|
* Delete manifest
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
deleteManifestById(manifestId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
51
51
|
/**
|
|
52
52
|
* Retrieves a specific manifest by its ID
|
|
53
53
|
* Get manifest by ID
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
getManifestByIdRaw(requestParameters: GetManifestByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ManifestUio>>;
|
|
56
56
|
/**
|
|
57
57
|
* Retrieves a specific manifest by its ID
|
|
58
58
|
* Get manifest by ID
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
getManifestById(manifestId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ManifestUio>;
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
62
|
+
* Retrieves manifests, filtered by user ID for non-admin users
|
|
63
|
+
* Get manifests
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
getManifestsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ManifestUio>>>;
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* Retrieves manifests, filtered by user ID for non-admin users
|
|
68
|
+
* Get manifests
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
getManifests(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ManifestUio>>;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
72
|
+
* Updates a manifest by ID
|
|
73
|
+
* Update manifest
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
updateManifestByIdRaw(requestParameters: UpdateManifestByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ManifestUio>>;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
77
|
+
* Updates a manifest by ID
|
|
78
|
+
* Update manifest
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
updateManifestById(manifestId: string, manifestCreateRequestUio: ManifestCreateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ManifestUio>;
|
|
81
81
|
}
|