@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.
Files changed (104) hide show
  1. package/dist/apis/AgentApi.d.ts +5 -4
  2. package/dist/apis/AgentApi.js +6 -3
  3. package/dist/apis/EngineApi.d.ts +6 -5
  4. package/dist/apis/EngineApi.js +13 -7
  5. package/dist/apis/FilesApi.d.ts +21 -21
  6. package/dist/apis/FilesApi.js +42 -42
  7. package/dist/apis/GeneralApi.d.ts +2 -2
  8. package/dist/apis/GeneralApi.js +3 -3
  9. package/dist/apis/GuardiansApi.d.ts +54 -54
  10. package/dist/apis/GuardiansApi.js +91 -91
  11. package/dist/apis/KnowledgeApi.d.ts +72 -72
  12. package/dist/apis/KnowledgeApi.js +152 -152
  13. package/dist/apis/ManifestsApi.d.ts +28 -28
  14. package/dist/apis/ManifestsApi.js +45 -45
  15. package/dist/apis/MetricsApi.d.ts +14 -14
  16. package/dist/apis/MetricsApi.js +18 -18
  17. package/dist/apis/OrganizationsApi.d.ts +3 -3
  18. package/dist/apis/OrganizationsApi.js +4 -4
  19. package/dist/apis/PromptsApi.d.ts +31 -31
  20. package/dist/apis/PromptsApi.js +60 -60
  21. package/dist/apis/RemotesApi.d.ts +3 -3
  22. package/dist/apis/RemotesApi.js +4 -4
  23. package/dist/apis/ToolsApi.d.ts +6 -6
  24. package/dist/apis/ToolsApi.js +8 -8
  25. package/dist/models/AgentPatchEngineUio.d.ts +38 -0
  26. package/dist/models/AgentPatchEngineUio.js +54 -0
  27. package/dist/models/AgentPatchUio.d.ts +4 -4
  28. package/dist/models/AgentPatchUio.js +3 -3
  29. package/dist/models/AgentRequestUio.d.ts +10 -1
  30. package/dist/models/AgentRequestUio.js +5 -3
  31. package/dist/models/AgentUio.d.ts +10 -3
  32. package/dist/models/AgentUio.js +4 -3
  33. package/dist/models/AppCreateRequestUio.d.ts +6 -0
  34. package/dist/models/AppCreateRequestUio.js +2 -0
  35. package/dist/models/AppSequencesInnerUio.d.ts +38 -0
  36. package/dist/models/AppSequencesInnerUio.js +50 -0
  37. package/dist/models/AppUio.d.ts +24 -3
  38. package/dist/models/AppUio.js +11 -10
  39. package/dist/models/ChatMessageAudioInnerUio.d.ts +38 -0
  40. package/dist/models/ChatMessageAudioInnerUio.js +54 -0
  41. package/dist/models/ChatMessageUio.d.ts +10 -2
  42. package/dist/models/ChatMessageUio.js +6 -2
  43. package/dist/models/ChatMessageWithFlowNodeUio.d.ts +129 -0
  44. package/dist/models/ChatMessageWithFlowNodeUio.js +95 -0
  45. package/dist/models/ChatUio.d.ts +9 -3
  46. package/dist/models/ChatUio.js +5 -3
  47. package/dist/models/ConversationFlowNodeEntrypointsUio.d.ts +32 -0
  48. package/dist/models/ConversationFlowNodeEntrypointsUio.js +48 -0
  49. package/dist/models/ConversationFlowNodeUio.d.ts +51 -0
  50. package/dist/models/ConversationFlowNodeUio.js +55 -0
  51. package/dist/models/ConversationUio.d.ts +7 -0
  52. package/dist/models/ConversationUio.js +5 -0
  53. package/dist/models/DefaultEngineRequestUio.d.ts +1 -7
  54. package/dist/models/DefaultEngineRequestUio.js +3 -7
  55. package/dist/models/EngineUio.d.ts +4 -7
  56. package/dist/models/EngineUio.js +6 -7
  57. package/dist/models/FileCreationRequestUio.d.ts +1 -1
  58. package/dist/models/FileCreationRequestUio.js +1 -3
  59. package/dist/models/FileCreationResponseUio.d.ts +6 -0
  60. package/dist/models/FileCreationResponseUio.js +2 -0
  61. package/dist/models/FileUio.d.ts +6 -0
  62. package/dist/models/FileUio.js +2 -0
  63. package/dist/models/FileWithDownloadUrlUio.d.ts +6 -0
  64. package/dist/models/FileWithDownloadUrlUio.js +2 -0
  65. package/dist/models/GuardianCreateRequestUio.d.ts +7 -0
  66. package/dist/models/GuardianCreateRequestUio.js +5 -0
  67. package/dist/models/GuardianEngineUio.d.ts +0 -7
  68. package/dist/models/GuardianEngineUio.js +0 -5
  69. package/dist/models/GuardianPutRequestUio.d.ts +7 -0
  70. package/dist/models/GuardianPutRequestUio.js +3 -0
  71. package/dist/models/GuardianTypeUio.d.ts +26 -0
  72. package/dist/models/GuardianTypeUio.js +52 -0
  73. package/dist/models/GuardianUio.d.ts +7 -0
  74. package/dist/models/GuardianUio.js +5 -0
  75. package/dist/models/ImportFileToAgentKnowledge200ResponseUio.d.ts +56 -0
  76. package/dist/models/ImportFileToAgentKnowledge200ResponseUio.js +56 -0
  77. package/dist/models/KnowledgeBaseFilesInnerUio.d.ts +44 -0
  78. package/dist/models/KnowledgeBaseFilesInnerUio.js +58 -0
  79. package/dist/models/KnowledgeBaseUio.d.ts +124 -0
  80. package/dist/models/KnowledgeBaseUio.js +88 -0
  81. package/dist/models/OrganizationUio.d.ts +0 -9
  82. package/dist/models/OrganizationUio.js +0 -6
  83. package/dist/models/ProviderCreateRequestUio.d.ts +4 -9
  84. package/dist/models/ProviderCreateRequestUio.js +4 -9
  85. package/dist/models/ProviderTypeUio.d.ts +27 -0
  86. package/dist/models/ProviderTypeUio.js +53 -0
  87. package/dist/models/ProviderUio.d.ts +4 -9
  88. package/dist/models/ProviderUio.js +4 -9
  89. package/dist/models/index.d.ts +11 -6
  90. package/dist/models/index.js +11 -6
  91. package/dist/openapi.json +369 -120
  92. package/package.json +1 -1
  93. package/dist/models/AgentKnowledgeBaseUio.d.ts +0 -57
  94. package/dist/models/AgentKnowledgeBaseUio.js +0 -67
  95. package/dist/models/AgentsAgentIdKnowledgeFileImportsPost200ResponseUio.d.ts +0 -56
  96. package/dist/models/AgentsAgentIdKnowledgeFileImportsPost200ResponseUio.js +0 -56
  97. package/dist/models/DuplicateAgent201ResponseUio.d.ts +0 -32
  98. package/dist/models/DuplicateAgent201ResponseUio.js +0 -50
  99. package/dist/models/EngineTypeUio.d.ts +0 -25
  100. package/dist/models/EngineTypeUio.js +0 -51
  101. package/dist/models/GuardianEngineTypeUio.d.ts +0 -26
  102. package/dist/models/GuardianEngineTypeUio.js +0 -52
  103. package/dist/models/GuardianExcludedAgentsRequestUio.d.ts +0 -32
  104. 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
- * Add a file to the knowledge base
58
- * Add a file to the knowledge base
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 addFileToKnowledgeBaseRaw(requestParameters, initOverrides) {
61
- if (requestParameters['organizationId'] == null) {
62
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling addFileToKnowledgeBase().');
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['fileCreationRequestUio'] == null) {
65
- throw new runtime.RequiredError('fileCreationRequestUio', 'Required parameter "fileCreationRequestUio" was null or undefined when calling addFileToKnowledgeBase().');
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: `/organizations/{organizationId}/knowledge/files`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
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.FileCreationRequestUioToJSON)(requestParameters['fileCreationRequestUio']),
81
+ body: (0, index_1.DocumentAddRequestUioToJSON)(requestParameters['documentAddRequestUio']),
79
82
  }, initOverrides);
80
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FileCreationResponseUioFromJSON)(jsonValue));
83
+ return new runtime.VoidApiResponse(response);
81
84
  }
82
85
  /**
83
- * Add a file to the knowledge base
84
- * Add a file to the knowledge base
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 addFileToKnowledgeBase(organizationId, fileCreationRequestUio, initOverrides) {
87
- const response = await this.addFileToKnowledgeBaseRaw({ organizationId: organizationId, fileCreationRequestUio: fileCreationRequestUio }, initOverrides);
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
- * Adds a text document to the agent\'s knowledge base, splitting it into chunks if necessary
92
- * Add a document to agent\'s knowledge base
93
+ * Add a file to the knowledge base
94
+ * Add a file to the knowledge base
93
95
  */
94
- async agentsAgentIdKnowledgeDocumentsPostRaw(requestParameters, initOverrides) {
95
- if (requestParameters['agentId'] == null) {
96
- throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling agentsAgentIdKnowledgeDocumentsPost().');
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['documentAddRequestUio'] == null) {
99
- throw new runtime.RequiredError('documentAddRequestUio', 'Required parameter "documentAddRequestUio" was null or undefined when calling agentsAgentIdKnowledgeDocumentsPost().');
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: `/agents/{agentId}/knowledge/documents`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
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.DocumentAddRequestUioToJSON)(requestParameters['documentAddRequestUio']),
114
+ body: (0, index_1.FileCreationRequestUioToJSON)(requestParameters['fileCreationRequestUio']),
116
115
  }, initOverrides);
117
- return new runtime.VoidApiResponse(response);
116
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FileCreationResponseUioFromJSON)(jsonValue));
118
117
  }
119
118
  /**
120
- * Adds a text document to the agent\'s knowledge base, splitting it into chunks if necessary
121
- * Add a document to agent\'s knowledge base
119
+ * Add a file to the knowledge base
120
+ * Add a file to the knowledge base
122
121
  */
123
- async agentsAgentIdKnowledgeDocumentsPost(agentId, documentAddRequestUio, noSplit, initOverrides) {
124
- await this.agentsAgentIdKnowledgeDocumentsPostRaw({ agentId: agentId, documentAddRequestUio: documentAddRequestUio, noSplit: noSplit }, initOverrides);
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
- * Processes documents like PDFs, CSVs, and text files, and adds them to the brain\'s knowledge base
128
- * Upload and import a file into the brain\'s knowledge base
127
+ * Create a new module for an organization
128
+ * Create a new module for an organization
129
129
  */
130
- async agentsAgentIdKnowledgeFileImportsPostRaw(requestParameters, initOverrides) {
131
- if (requestParameters['agentId'] == null) {
132
- throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling agentsAgentIdKnowledgeFileImportsPost().');
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['file'] == null) {
135
- throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling agentsAgentIdKnowledgeFileImportsPost().');
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: `/agents/{agentId}/knowledge/file-imports`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
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: formParams,
148
+ body: (0, index_1.AgentModuleUioToJSON)(requestParameters['agentModuleUio']),
166
149
  }, initOverrides);
167
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AgentsAgentIdKnowledgeFileImportsPost200ResponseUioFromJSON)(jsonValue));
150
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AgentModuleUioFromJSON)(jsonValue));
168
151
  }
169
152
  /**
170
- * Processes documents like PDFs, CSVs, and text files, and adds them to the brain\'s knowledge base
171
- * Upload and import a file into the brain\'s knowledge base
153
+ * Create a new module for an organization
154
+ * Create a new module for an organization
172
155
  */
173
- async agentsAgentIdKnowledgeFileImportsPost(agentId, file, initOverrides) {
174
- const response = await this.agentsAgentIdKnowledgeFileImportsPostRaw({ agentId: agentId, file: file }, initOverrides);
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 agentsAgentIdKnowledgeFilesFileIdDeleteRaw(requestParameters, initOverrides) {
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 agentsAgentIdKnowledgeFilesFileIdDelete().');
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 agentsAgentIdKnowledgeFilesFileIdDelete().');
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 agentsAgentIdKnowledgeFilesFileIdDelete(agentId, fileId, initOverrides) {
206
- await this.agentsAgentIdKnowledgeFilesFileIdDeleteRaw({ agentId: agentId, fileId: fileId }, initOverrides);
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 agentsAgentIdKnowledgeFilesFileIdGetRaw(requestParameters, initOverrides) {
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 agentsAgentIdKnowledgeFilesFileIdGet().');
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 agentsAgentIdKnowledgeFilesFileIdGet().');
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 agentsAgentIdKnowledgeFilesFileIdGet(agentId, fileId, initOverrides) {
237
- const response = await this.agentsAgentIdKnowledgeFilesFileIdGetRaw({ agentId: agentId, fileId: fileId }, initOverrides);
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
- * Updates the status of a knowledge file and triggers the indexing process if the file is uploaded
242
- * Update file status and trigger indexing
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 agentsAgentIdKnowledgeFilesFileIdStatusPostRaw(requestParameters, initOverrides) {
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 agentsAgentIdKnowledgeFilesFileIdStatusPost().');
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['fileStatusUpdateRequestUio'] == null) {
252
- throw new runtime.RequiredError('fileStatusUpdateRequestUio', 'Required parameter "fileStatusUpdateRequestUio" was null or undefined when calling agentsAgentIdKnowledgeFilesFileIdStatusPost().');
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/files/{fileId}/status`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters['fileId']))),
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: (0, index_1.FileStatusUpdateRequestUioToJSON)(requestParameters['fileStatusUpdateRequestUio']),
262
+ body: formParams,
266
263
  }, initOverrides);
267
- if (this.isJsonMime(response.headers.get('content-type'))) {
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
- * Updates the status of a knowledge file and triggers the indexing process if the file is uploaded
276
- * Update file status and trigger indexing
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 agentsAgentIdKnowledgeFilesFileIdStatusPost(agentId, fileId, fileStatusUpdateRequestUio, initOverrides) {
279
- const response = await this.agentsAgentIdKnowledgeFilesFileIdStatusPostRaw({ agentId: agentId, fileId: fileId, fileStatusUpdateRequestUio: fileStatusUpdateRequestUio }, initOverrides);
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
- * Registers a file for upload to the brain\'s knowledge base and returns an upload URL
284
- * Prepare file upload for knowledge base
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 agentsAgentIdKnowledgeFilesPostRaw(requestParameters, initOverrides) {
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 agentsAgentIdKnowledgeFilesPost().');
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/files`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
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.JSONApiResponse(response, (jsonValue) => (0, index_1.FileCreationResponseUioFromJSON)(jsonValue));
293
+ return new runtime.VoidApiResponse(response);
307
294
  }
308
295
  /**
309
- * Registers a file for upload to the brain\'s knowledge base and returns an upload URL
310
- * Prepare file upload for knowledge base
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 agentsAgentIdKnowledgeFilesPost(agentId, fileCreationRequestUio, initOverrides) {
313
- const response = await this.agentsAgentIdKnowledgeFilesPostRaw({ agentId: agentId, fileCreationRequestUio: fileCreationRequestUio }, initOverrides);
314
- return await response.value();
299
+ async importProjectsToAgentKnowledge(agentId, initOverrides) {
300
+ await this.importProjectsToAgentKnowledgeRaw({ agentId: agentId }, initOverrides);
315
301
  }
316
302
  /**
317
- * Imports project data from a local JSON file into the agent\'s knowledge base
318
- * Import projects into agent knowledge
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 agentsAgentIdKnowledgeProjectImportsPostRaw(requestParameters, initOverrides) {
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 agentsAgentIdKnowledgeProjectImportsPost().');
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/project-imports`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
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.VoidApiResponse(response);
326
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FileCreationResponseUioFromJSON)(jsonValue));
336
327
  }
337
328
  /**
338
- * Imports project data from a local JSON file into the agent\'s knowledge base
339
- * Import projects into agent knowledge
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 agentsAgentIdKnowledgeProjectImportsPost(agentId, initOverrides) {
342
- await this.agentsAgentIdKnowledgeProjectImportsPostRaw({ agentId: agentId }, initOverrides);
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 agentsAgentIdKnowledgeResetsPostRaw(requestParameters, initOverrides) {
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 agentsAgentIdKnowledgeResetsPost().');
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 agentsAgentIdKnowledgeResetsPost(agentId, initOverrides) {
370
- await this.agentsAgentIdKnowledgeResetsPostRaw({ agentId: agentId }, initOverrides);
361
+ async resetAgentKnowledge(agentId, initOverrides) {
362
+ await this.resetAgentKnowledgeRaw({ agentId: agentId }, initOverrides);
371
363
  }
372
364
  /**
373
- * Create a new module for an organization
374
- * Create a new module for an organization
365
+ * Reset knowledge base
366
+ * Reset knowledge base
375
367
  */
376
- async createModuleForOrganizationRaw(requestParameters, initOverrides) {
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 createModuleForOrganization().');
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}/modules`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['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.AgentModuleUioFromJSON)(jsonValue));
383
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BodyWithMessageUioFromJSON)(jsonValue));
397
384
  }
398
385
  /**
399
- * Create a new module for an organization
400
- * Create a new module for an organization
386
+ * Reset knowledge base
387
+ * Reset knowledge base
401
388
  */
402
- async createModuleForOrganization(organizationId, agentModuleUio, initOverrides) {
403
- const response = await this.createModuleForOrganizationRaw({ organizationId: organizationId, agentModuleUio: agentModuleUio }, initOverrides);
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
- * Reset knowledge base
408
- * Reset knowledge base
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 resetKnowledgeBaseRaw(requestParameters, initOverrides) {
411
- if (requestParameters['organizationId'] == null) {
412
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling resetKnowledgeBase().');
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: `/organizations/{organizationId}/knowledge/resets`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
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
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BodyWithMessageUioFromJSON)(jsonValue));
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
- * Reset knowledge base
429
- * Reset knowledge base
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 resetKnowledgeBase(organizationId, initOverrides) {
432
- const response = await this.resetKnowledgeBaseRaw({ organizationId: organizationId }, initOverrides);
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 ManifestsManifestIdDeleteRequest {
15
- manifestId: string;
14
+ export interface CreateManifestRequest {
15
+ manifestCreateRequestUio: ManifestCreateRequestUio;
16
16
  }
17
- export interface ManifestsManifestIdGetRequest {
17
+ export interface DeleteManifestByIdRequest {
18
18
  manifestId: string;
19
19
  }
20
- export interface ManifestsManifestIdPutRequest {
20
+ export interface GetManifestByIdRequest {
21
21
  manifestId: string;
22
- manifestCreateRequestUio: ManifestCreateRequestUio;
23
22
  }
24
- export interface ManifestsPostRequest {
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
- * Retrieves manifests, filtered by user ID for non-admin users
33
- * Get manifests
32
+ * Creates a new manifest document
33
+ * Create a manifest
34
34
  */
35
- manifestsGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ManifestUio>>>;
35
+ createManifestRaw(requestParameters: CreateManifestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ManifestUio>>;
36
36
  /**
37
- * Retrieves manifests, filtered by user ID for non-admin users
38
- * Get manifests
37
+ * Creates a new manifest document
38
+ * Create a manifest
39
39
  */
40
- manifestsGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ManifestUio>>;
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
- manifestsManifestIdDeleteRaw(requestParameters: ManifestsManifestIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
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
- manifestsManifestIdDelete(manifestId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
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
- manifestsManifestIdGetRaw(requestParameters: ManifestsManifestIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ManifestUio>>;
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
- manifestsManifestIdGet(manifestId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ManifestUio>;
60
+ getManifestById(manifestId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ManifestUio>;
61
61
  /**
62
- * Updates a manifest by ID
63
- * Update manifest
62
+ * Retrieves manifests, filtered by user ID for non-admin users
63
+ * Get manifests
64
64
  */
65
- manifestsManifestIdPutRaw(requestParameters: ManifestsManifestIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ManifestUio>>;
65
+ getManifestsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ManifestUio>>>;
66
66
  /**
67
- * Updates a manifest by ID
68
- * Update manifest
67
+ * Retrieves manifests, filtered by user ID for non-admin users
68
+ * Get manifests
69
69
  */
70
- manifestsManifestIdPut(manifestId: string, manifestCreateRequestUio: ManifestCreateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ManifestUio>;
70
+ getManifests(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ManifestUio>>;
71
71
  /**
72
- * Creates a new manifest document
73
- * Create a manifest
72
+ * Updates a manifest by ID
73
+ * Update manifest
74
74
  */
75
- manifestsPostRaw(requestParameters: ManifestsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ManifestUio>>;
75
+ updateManifestByIdRaw(requestParameters: UpdateManifestByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ManifestUio>>;
76
76
  /**
77
- * Creates a new manifest document
78
- * Create a manifest
77
+ * Updates a manifest by ID
78
+ * Update manifest
79
79
  */
80
- manifestsPost(manifestCreateRequestUio: ManifestCreateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ManifestUio>;
80
+ updateManifestById(manifestId: string, manifestCreateRequestUio: ManifestCreateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ManifestUio>;
81
81
  }