@breign/client 1.0.123 → 1.0.125
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 +17 -12
- package/dist/apis/AgentApi.js +29 -14
- package/dist/apis/KnowledgeApi.d.ts +1 -113
- package/dist/apis/KnowledgeApi.js +0 -282
- package/dist/apis/MetricsApi.d.ts +15 -13
- package/dist/apis/MetricsApi.js +27 -21
- package/dist/apis/OrganizationsApi.d.ts +1 -26
- package/dist/apis/OrganizationsApi.js +0 -64
- package/dist/apis/SkillsApi.d.ts +14 -1
- package/dist/apis/SkillsApi.js +29 -0
- package/dist/models/AddModuleRequestUio.d.ts +60 -0
- package/dist/models/AddModuleRequestUio.js +68 -0
- package/dist/models/AgentPatchUio.d.ts +0 -30
- package/dist/models/AgentPatchUio.js +0 -10
- package/dist/models/AgentRefUio.d.ts +38 -0
- package/dist/models/AgentRefUio.js +54 -0
- package/dist/models/AgentRequestUio.d.ts +0 -59
- package/dist/models/AgentRequestUio.js +0 -22
- package/dist/models/AgentUio.d.ts +6 -44
- package/dist/models/AgentUio.js +2 -14
- package/dist/models/ProviderTypeUio.d.ts +1 -0
- package/dist/models/ProviderTypeUio.js +2 -1
- package/dist/models/index.d.ts +2 -6
- package/dist/models/index.js +2 -6
- package/dist/openapi.json +282 -771
- package/package.json +1 -1
- package/dist/models/AgentRequestProfilePictureUio.d.ts +0 -50
- package/dist/models/AgentRequestProfilePictureUio.js +0 -62
- package/dist/models/DocumentAddRequestUio.d.ts +0 -38
- package/dist/models/DocumentAddRequestUio.js +0 -52
- package/dist/models/ImportFileToAgentKnowledge200ResponseUio.d.ts +0 -56
- package/dist/models/ImportFileToAgentKnowledge200ResponseUio.js +0 -56
- package/dist/models/UserAgentAccessAgentUio.d.ts +0 -38
- package/dist/models/UserAgentAccessAgentUio.js +0 -54
- package/dist/models/UserAgentAccessRequestUio.d.ts +0 -38
- package/dist/models/UserAgentAccessRequestUio.js +0 -54
- package/dist/models/UserAgentAccessUio.d.ts +0 -45
- package/dist/models/UserAgentAccessUio.js +0 -59
|
@@ -53,42 +53,6 @@ const index_1 = require("../models/index");
|
|
|
53
53
|
*
|
|
54
54
|
*/
|
|
55
55
|
class KnowledgeApi extends runtime.BaseAPI {
|
|
56
|
-
/**
|
|
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
|
-
*/
|
|
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
|
-
}
|
|
64
|
-
if (requestParameters['documentAddRequestUio'] == null) {
|
|
65
|
-
throw new runtime.RequiredError('documentAddRequestUio', 'Required parameter "documentAddRequestUio" was null or undefined when calling addDocumentToKnowledgeBase().');
|
|
66
|
-
}
|
|
67
|
-
const queryParameters = {};
|
|
68
|
-
if (requestParameters['noSplit'] != null) {
|
|
69
|
-
queryParameters['noSplit'] = requestParameters['noSplit'];
|
|
70
|
-
}
|
|
71
|
-
const headerParameters = {};
|
|
72
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
73
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
74
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
75
|
-
}
|
|
76
|
-
const response = await this.request({
|
|
77
|
-
path: `/agents/{agentId}/knowledge/documents`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
78
|
-
method: 'POST',
|
|
79
|
-
headers: headerParameters,
|
|
80
|
-
query: queryParameters,
|
|
81
|
-
body: (0, index_1.DocumentAddRequestUioToJSON)(requestParameters['documentAddRequestUio']),
|
|
82
|
-
}, initOverrides);
|
|
83
|
-
return new runtime.VoidApiResponse(response);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
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
|
|
88
|
-
*/
|
|
89
|
-
async addDocumentToKnowledgeBase(agentId, documentAddRequestUio, noSplit, initOverrides) {
|
|
90
|
-
await this.addDocumentToKnowledgeBaseRaw({ agentId: agentId, documentAddRequestUio: documentAddRequestUio, noSplit: noSplit }, initOverrides);
|
|
91
|
-
}
|
|
92
56
|
/**
|
|
93
57
|
* Add a file to the knowledge base
|
|
94
58
|
* Add a file to the knowledge base
|
|
@@ -188,37 +152,6 @@ class KnowledgeApi extends runtime.BaseAPI {
|
|
|
188
152
|
async deleteChunkFromKnowledgeFile(knowledgebaseId, chunkIdKnowledge, initOverrides) {
|
|
189
153
|
await this.deleteChunkFromKnowledgeFileRaw({ knowledgebaseId: knowledgebaseId, chunkIdKnowledge: chunkIdKnowledge }, initOverrides);
|
|
190
154
|
}
|
|
191
|
-
/**
|
|
192
|
-
* Removes a file and its associated chunks from the agent\'s knowledge base
|
|
193
|
-
* Delete a knowledge file from an agent
|
|
194
|
-
*/
|
|
195
|
-
async deleteFileFromAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
196
|
-
if (requestParameters['agentId'] == null) {
|
|
197
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling deleteFileFromAgentKnowledge().');
|
|
198
|
-
}
|
|
199
|
-
if (requestParameters['fileId'] == null) {
|
|
200
|
-
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling deleteFileFromAgentKnowledge().');
|
|
201
|
-
}
|
|
202
|
-
const queryParameters = {};
|
|
203
|
-
const headerParameters = {};
|
|
204
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
205
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
206
|
-
}
|
|
207
|
-
const response = await this.request({
|
|
208
|
-
path: `/agents/{agentId}/knowledge/files/{fileId}`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters['fileId']))),
|
|
209
|
-
method: 'DELETE',
|
|
210
|
-
headers: headerParameters,
|
|
211
|
-
query: queryParameters,
|
|
212
|
-
}, initOverrides);
|
|
213
|
-
return new runtime.VoidApiResponse(response);
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Removes a file and its associated chunks from the agent\'s knowledge base
|
|
217
|
-
* Delete a knowledge file from an agent
|
|
218
|
-
*/
|
|
219
|
-
async deleteFileFromAgentKnowledge(agentId, fileId, initOverrides) {
|
|
220
|
-
await this.deleteFileFromAgentKnowledgeRaw({ agentId: agentId, fileId: fileId }, initOverrides);
|
|
221
|
-
}
|
|
222
155
|
/**
|
|
223
156
|
* Delete a specific knowledge image from a library image in knowledge base
|
|
224
157
|
* Delete a specific knowledge image from a library image in knowledge base
|
|
@@ -349,38 +282,6 @@ class KnowledgeApi extends runtime.BaseAPI {
|
|
|
349
282
|
const response = await this.getAvailableKnowledgeBasesRaw({ organizationId: organizationId, agentId: agentId, searchName: searchName }, initOverrides);
|
|
350
283
|
return await response.value();
|
|
351
284
|
}
|
|
352
|
-
/**
|
|
353
|
-
* Retrieves metadata for a file that has been imported into the agent\'s knowledge base
|
|
354
|
-
* Get a specific knowledge file from an agent
|
|
355
|
-
*/
|
|
356
|
-
async getFileFromAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
357
|
-
if (requestParameters['agentId'] == null) {
|
|
358
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling getFileFromAgentKnowledge().');
|
|
359
|
-
}
|
|
360
|
-
if (requestParameters['fileId'] == null) {
|
|
361
|
-
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFileFromAgentKnowledge().');
|
|
362
|
-
}
|
|
363
|
-
const queryParameters = {};
|
|
364
|
-
const headerParameters = {};
|
|
365
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
366
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
367
|
-
}
|
|
368
|
-
const response = await this.request({
|
|
369
|
-
path: `/agents/{agentId}/knowledge/files/{fileId}`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters['fileId']))),
|
|
370
|
-
method: 'GET',
|
|
371
|
-
headers: headerParameters,
|
|
372
|
-
query: queryParameters,
|
|
373
|
-
}, initOverrides);
|
|
374
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FileWithDownloadUrlUioFromJSON)(jsonValue));
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Retrieves metadata for a file that has been imported into the agent\'s knowledge base
|
|
378
|
-
* Get a specific knowledge file from an agent
|
|
379
|
-
*/
|
|
380
|
-
async getFileFromAgentKnowledge(agentId, fileId, initOverrides) {
|
|
381
|
-
const response = await this.getFileFromAgentKnowledgeRaw({ agentId: agentId, fileId: fileId }, initOverrides);
|
|
382
|
-
return await response.value();
|
|
383
|
-
}
|
|
384
285
|
/**
|
|
385
286
|
* Get all images from a library image in knowledge base
|
|
386
287
|
* Get all knowledge images from a knowledge base
|
|
@@ -682,85 +583,6 @@ class KnowledgeApi extends runtime.BaseAPI {
|
|
|
682
583
|
const response = await this.getScrappingJobStatusRaw({ jobId: jobId }, initOverrides);
|
|
683
584
|
return await response.value();
|
|
684
585
|
}
|
|
685
|
-
/**
|
|
686
|
-
* Processes documents like PDFs, CSVs, and text files, and adds them to the brain\'s knowledge base
|
|
687
|
-
* Upload and import a file into the brain\'s knowledge base
|
|
688
|
-
*/
|
|
689
|
-
async importFileToAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
690
|
-
if (requestParameters['agentId'] == null) {
|
|
691
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling importFileToAgentKnowledge().');
|
|
692
|
-
}
|
|
693
|
-
if (requestParameters['file'] == null) {
|
|
694
|
-
throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling importFileToAgentKnowledge().');
|
|
695
|
-
}
|
|
696
|
-
const queryParameters = {};
|
|
697
|
-
const headerParameters = {};
|
|
698
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
699
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
700
|
-
}
|
|
701
|
-
const consumes = [
|
|
702
|
-
{ contentType: 'multipart/form-data' },
|
|
703
|
-
];
|
|
704
|
-
// @ts-ignore: canConsumeForm may be unused
|
|
705
|
-
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
706
|
-
let formParams;
|
|
707
|
-
let useForm = false;
|
|
708
|
-
// use FormData to transmit files using content-type "multipart/form-data"
|
|
709
|
-
useForm = canConsumeForm;
|
|
710
|
-
if (useForm) {
|
|
711
|
-
formParams = new FormData();
|
|
712
|
-
}
|
|
713
|
-
else {
|
|
714
|
-
formParams = new URLSearchParams();
|
|
715
|
-
}
|
|
716
|
-
if (requestParameters['file'] != null) {
|
|
717
|
-
formParams.append('file', requestParameters['file']);
|
|
718
|
-
}
|
|
719
|
-
const response = await this.request({
|
|
720
|
-
path: `/agents/{agentId}/knowledge/file-imports`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
721
|
-
method: 'POST',
|
|
722
|
-
headers: headerParameters,
|
|
723
|
-
query: queryParameters,
|
|
724
|
-
body: formParams,
|
|
725
|
-
}, initOverrides);
|
|
726
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ImportFileToAgentKnowledge200ResponseUioFromJSON)(jsonValue));
|
|
727
|
-
}
|
|
728
|
-
/**
|
|
729
|
-
* Processes documents like PDFs, CSVs, and text files, and adds them to the brain\'s knowledge base
|
|
730
|
-
* Upload and import a file into the brain\'s knowledge base
|
|
731
|
-
*/
|
|
732
|
-
async importFileToAgentKnowledge(agentId, file, initOverrides) {
|
|
733
|
-
const response = await this.importFileToAgentKnowledgeRaw({ agentId: agentId, file: file }, initOverrides);
|
|
734
|
-
return await response.value();
|
|
735
|
-
}
|
|
736
|
-
/**
|
|
737
|
-
* Imports project data from a local JSON file into the agent\'s knowledge base
|
|
738
|
-
* Import projects into agent knowledge
|
|
739
|
-
*/
|
|
740
|
-
async importProjectsToAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
741
|
-
if (requestParameters['agentId'] == null) {
|
|
742
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling importProjectsToAgentKnowledge().');
|
|
743
|
-
}
|
|
744
|
-
const queryParameters = {};
|
|
745
|
-
const headerParameters = {};
|
|
746
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
747
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
748
|
-
}
|
|
749
|
-
const response = await this.request({
|
|
750
|
-
path: `/agents/{agentId}/knowledge/project-imports`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
751
|
-
method: 'POST',
|
|
752
|
-
headers: headerParameters,
|
|
753
|
-
query: queryParameters,
|
|
754
|
-
}, initOverrides);
|
|
755
|
-
return new runtime.VoidApiResponse(response);
|
|
756
|
-
}
|
|
757
|
-
/**
|
|
758
|
-
* Imports project data from a local JSON file into the agent\'s knowledge base
|
|
759
|
-
* Import projects into agent knowledge
|
|
760
|
-
*/
|
|
761
|
-
async importProjectsToAgentKnowledge(agentId, initOverrides) {
|
|
762
|
-
await this.importProjectsToAgentKnowledgeRaw({ agentId: agentId }, initOverrides);
|
|
763
|
-
}
|
|
764
586
|
/**
|
|
765
587
|
* Update the name and authorized agents of a knowledge base
|
|
766
588
|
* Update a knowledge base
|
|
@@ -829,68 +651,6 @@ class KnowledgeApi extends runtime.BaseAPI {
|
|
|
829
651
|
const response = await this.patchKnowledgeFileRaw({ fileId: fileId, patchKnowledgeFileRequestUio: patchKnowledgeFileRequestUio }, initOverrides);
|
|
830
652
|
return await response.value();
|
|
831
653
|
}
|
|
832
|
-
/**
|
|
833
|
-
* Registers a file for upload to the brain\'s knowledge base and returns an upload URL
|
|
834
|
-
* Prepare file upload for knowledge base
|
|
835
|
-
*/
|
|
836
|
-
async prepareFileUploadRaw(requestParameters, initOverrides) {
|
|
837
|
-
if (requestParameters['agentId'] == null) {
|
|
838
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling prepareFileUpload().');
|
|
839
|
-
}
|
|
840
|
-
if (requestParameters['fileCreationRequestUio'] == null) {
|
|
841
|
-
throw new runtime.RequiredError('fileCreationRequestUio', 'Required parameter "fileCreationRequestUio" was null or undefined when calling prepareFileUpload().');
|
|
842
|
-
}
|
|
843
|
-
const queryParameters = {};
|
|
844
|
-
const headerParameters = {};
|
|
845
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
846
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
847
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
848
|
-
}
|
|
849
|
-
const response = await this.request({
|
|
850
|
-
path: `/agents/{agentId}/knowledge/files`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
851
|
-
method: 'POST',
|
|
852
|
-
headers: headerParameters,
|
|
853
|
-
query: queryParameters,
|
|
854
|
-
body: (0, index_1.FileCreationRequestUioToJSON)(requestParameters['fileCreationRequestUio']),
|
|
855
|
-
}, initOverrides);
|
|
856
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FileCreationResponseUioFromJSON)(jsonValue));
|
|
857
|
-
}
|
|
858
|
-
/**
|
|
859
|
-
* Registers a file for upload to the brain\'s knowledge base and returns an upload URL
|
|
860
|
-
* Prepare file upload for knowledge base
|
|
861
|
-
*/
|
|
862
|
-
async prepareFileUpload(agentId, fileCreationRequestUio, initOverrides) {
|
|
863
|
-
const response = await this.prepareFileUploadRaw({ agentId: agentId, fileCreationRequestUio: fileCreationRequestUio }, initOverrides);
|
|
864
|
-
return await response.value();
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Deletes all knowledge embeddings and files associated with an agent
|
|
868
|
-
* Reset all knowledge for an agent
|
|
869
|
-
*/
|
|
870
|
-
async resetAgentKnowledgeRaw(requestParameters, initOverrides) {
|
|
871
|
-
if (requestParameters['agentId'] == null) {
|
|
872
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling resetAgentKnowledge().');
|
|
873
|
-
}
|
|
874
|
-
const queryParameters = {};
|
|
875
|
-
const headerParameters = {};
|
|
876
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
877
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
878
|
-
}
|
|
879
|
-
const response = await this.request({
|
|
880
|
-
path: `/agents/{agentId}/knowledge/resets`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
881
|
-
method: 'POST',
|
|
882
|
-
headers: headerParameters,
|
|
883
|
-
query: queryParameters,
|
|
884
|
-
}, initOverrides);
|
|
885
|
-
return new runtime.VoidApiResponse(response);
|
|
886
|
-
}
|
|
887
|
-
/**
|
|
888
|
-
* Deletes all knowledge embeddings and files associated with an agent
|
|
889
|
-
* Reset all knowledge for an agent
|
|
890
|
-
*/
|
|
891
|
-
async resetAgentKnowledge(agentId, initOverrides) {
|
|
892
|
-
await this.resetAgentKnowledgeRaw({ agentId: agentId }, initOverrides);
|
|
893
|
-
}
|
|
894
654
|
/**
|
|
895
655
|
* Reset knowledge base
|
|
896
656
|
* Reset knowledge base
|
|
@@ -988,48 +748,6 @@ class KnowledgeApi extends runtime.BaseAPI {
|
|
|
988
748
|
const response = await this.startKnowledgeBaseScrappingRaw({ knowledgebaseId: knowledgebaseId, startKnowledgeBaseScrappingRequestUio: startKnowledgeBaseScrappingRequestUio }, initOverrides);
|
|
989
749
|
return await response.value();
|
|
990
750
|
}
|
|
991
|
-
/**
|
|
992
|
-
* Updates the status of a knowledge file and triggers the indexing process if the file is uploaded
|
|
993
|
-
* Update file status and trigger indexing
|
|
994
|
-
*/
|
|
995
|
-
async updateFileStatusRaw(requestParameters, initOverrides) {
|
|
996
|
-
if (requestParameters['agentId'] == null) {
|
|
997
|
-
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling updateFileStatus().');
|
|
998
|
-
}
|
|
999
|
-
if (requestParameters['fileId'] == null) {
|
|
1000
|
-
throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling updateFileStatus().');
|
|
1001
|
-
}
|
|
1002
|
-
if (requestParameters['fileStatusUpdateRequestUio'] == null) {
|
|
1003
|
-
throw new runtime.RequiredError('fileStatusUpdateRequestUio', 'Required parameter "fileStatusUpdateRequestUio" was null or undefined when calling updateFileStatus().');
|
|
1004
|
-
}
|
|
1005
|
-
const queryParameters = {};
|
|
1006
|
-
const headerParameters = {};
|
|
1007
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
1008
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
1009
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
1010
|
-
}
|
|
1011
|
-
const response = await this.request({
|
|
1012
|
-
path: `/agents/{agentId}/knowledge/files/{fileId}/status`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters['fileId']))),
|
|
1013
|
-
method: 'POST',
|
|
1014
|
-
headers: headerParameters,
|
|
1015
|
-
query: queryParameters,
|
|
1016
|
-
body: (0, index_1.FileStatusUpdateRequestUioToJSON)(requestParameters['fileStatusUpdateRequestUio']),
|
|
1017
|
-
}, initOverrides);
|
|
1018
|
-
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
1019
|
-
return new runtime.JSONApiResponse(response);
|
|
1020
|
-
}
|
|
1021
|
-
else {
|
|
1022
|
-
return new runtime.TextApiResponse(response);
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* Updates the status of a knowledge file and triggers the indexing process if the file is uploaded
|
|
1027
|
-
* Update file status and trigger indexing
|
|
1028
|
-
*/
|
|
1029
|
-
async updateFileStatus(agentId, fileId, fileStatusUpdateRequestUio, initOverrides) {
|
|
1030
|
-
const response = await this.updateFileStatusRaw({ agentId: agentId, fileId: fileId, fileStatusUpdateRequestUio: fileStatusUpdateRequestUio }, initOverrides);
|
|
1031
|
-
return await response.value();
|
|
1032
|
-
}
|
|
1033
751
|
/**
|
|
1034
752
|
* Update the status of a specific knowledge image in a library image in knowledge base
|
|
1035
753
|
* Update the status of a specific knowledge image in a library image in knowledge base
|
|
@@ -11,17 +11,19 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
13
|
import type { EphemeralInstancesMetricsResponseUio, MetricForAgentUio, MetricForDayInnerUio, MetricUio, MetricsBrainsAgentResponseUio, MetricsTopAgentsResponseInnerUio, MetricsTopAgentsUsageResponseInnerUio, MetricsUsersResponseUio, OrgUsageMetricsResponseUio } from '../models/index';
|
|
14
|
-
export interface
|
|
14
|
+
export interface GetBrainsMetricsRequest {
|
|
15
15
|
startDate?: string;
|
|
16
16
|
endDate?: string;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface GetMetricsRequest {
|
|
19
19
|
startDate?: string;
|
|
20
20
|
endDate?: string;
|
|
21
21
|
}
|
|
22
22
|
export interface GetMetricsBrainsAgentRequest {
|
|
23
23
|
organizationId: string;
|
|
24
24
|
agentId: string;
|
|
25
|
+
startDate?: string;
|
|
26
|
+
endDate?: string;
|
|
25
27
|
}
|
|
26
28
|
export interface GetMetricsDayMetricsRequest {
|
|
27
29
|
organizationId: string;
|
|
@@ -59,6 +61,16 @@ export interface GetMetricsUsersVisitorsRequest {
|
|
|
59
61
|
*
|
|
60
62
|
*/
|
|
61
63
|
export declare class MetricsApi extends runtime.BaseAPI {
|
|
64
|
+
/**
|
|
65
|
+
* Retrieves usage metrics broken down by agent within an optional date range (admin only)
|
|
66
|
+
* Get brains metrics
|
|
67
|
+
*/
|
|
68
|
+
getBrainsMetricsRaw(requestParameters: GetBrainsMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<MetricForAgentUio>>>;
|
|
69
|
+
/**
|
|
70
|
+
* Retrieves usage metrics broken down by agent within an optional date range (admin only)
|
|
71
|
+
* Get brains metrics
|
|
72
|
+
*/
|
|
73
|
+
getBrainsMetrics(startDate?: string, endDate?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<MetricForAgentUio>>;
|
|
62
74
|
/**
|
|
63
75
|
* Retrieves usage metrics for all agents within a date range (admin only)
|
|
64
76
|
* Get usage metrics
|
|
@@ -69,16 +81,6 @@ export declare class MetricsApi extends runtime.BaseAPI {
|
|
|
69
81
|
* Get usage metrics
|
|
70
82
|
*/
|
|
71
83
|
getMetrics(startDate?: string, endDate?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<MetricUio>>;
|
|
72
|
-
/**
|
|
73
|
-
* Retrieves usage metrics broken down by agent within a date range (admin only)
|
|
74
|
-
* Get agent-specific metrics
|
|
75
|
-
*/
|
|
76
|
-
getMetricsAgentsRaw(requestParameters: GetMetricsAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<MetricForAgentUio>>>;
|
|
77
|
-
/**
|
|
78
|
-
* Retrieves usage metrics broken down by agent within a date range (admin only)
|
|
79
|
-
* Get agent-specific metrics
|
|
80
|
-
*/
|
|
81
|
-
getMetricsAgents(startDate?: string, endDate?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<MetricForAgentUio>>;
|
|
82
84
|
/**
|
|
83
85
|
* Retrieves metrics for a brain agent
|
|
84
86
|
* Get metrics for a brain agent
|
|
@@ -88,7 +90,7 @@ export declare class MetricsApi extends runtime.BaseAPI {
|
|
|
88
90
|
* Retrieves metrics for a brain agent
|
|
89
91
|
* Get metrics for a brain agent
|
|
90
92
|
*/
|
|
91
|
-
getMetricsBrainsAgent(organizationId: string, agentId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MetricsBrainsAgentResponseUio>;
|
|
93
|
+
getMetricsBrainsAgent(organizationId: string, agentId: string, startDate?: string, endDate?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MetricsBrainsAgentResponseUio>;
|
|
92
94
|
/**
|
|
93
95
|
* Retrieves usage metrics broken down by day within a date range (admin only)
|
|
94
96
|
* Get day-specific metrics
|
package/dist/apis/MetricsApi.js
CHANGED
|
@@ -54,10 +54,10 @@ const index_1 = require("../models/index");
|
|
|
54
54
|
*/
|
|
55
55
|
class MetricsApi extends runtime.BaseAPI {
|
|
56
56
|
/**
|
|
57
|
-
* Retrieves usage metrics
|
|
58
|
-
* Get
|
|
57
|
+
* Retrieves usage metrics broken down by agent within an optional date range (admin only)
|
|
58
|
+
* Get brains metrics
|
|
59
59
|
*/
|
|
60
|
-
async
|
|
60
|
+
async getBrainsMetricsRaw(requestParameters, initOverrides) {
|
|
61
61
|
const queryParameters = {};
|
|
62
62
|
if (requestParameters['startDate'] != null) {
|
|
63
63
|
queryParameters['startDate'] = requestParameters['startDate'];
|
|
@@ -70,26 +70,26 @@ class MetricsApi extends runtime.BaseAPI {
|
|
|
70
70
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
71
71
|
}
|
|
72
72
|
const response = await this.request({
|
|
73
|
-
path: `/metrics`,
|
|
73
|
+
path: `/metrics/brains`,
|
|
74
74
|
method: 'GET',
|
|
75
75
|
headers: headerParameters,
|
|
76
76
|
query: queryParameters,
|
|
77
77
|
}, initOverrides);
|
|
78
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.
|
|
78
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.MetricForAgentUioFromJSON));
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
|
-
* Retrieves usage metrics
|
|
82
|
-
* Get
|
|
81
|
+
* Retrieves usage metrics broken down by agent within an optional date range (admin only)
|
|
82
|
+
* Get brains metrics
|
|
83
83
|
*/
|
|
84
|
-
async
|
|
85
|
-
const response = await this.
|
|
84
|
+
async getBrainsMetrics(startDate, endDate, initOverrides) {
|
|
85
|
+
const response = await this.getBrainsMetricsRaw({ startDate: startDate, endDate: endDate }, initOverrides);
|
|
86
86
|
return await response.value();
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* Retrieves usage metrics
|
|
90
|
-
* Get
|
|
89
|
+
* Retrieves usage metrics for all agents within a date range (admin only)
|
|
90
|
+
* Get usage metrics
|
|
91
91
|
*/
|
|
92
|
-
async
|
|
92
|
+
async getMetricsRaw(requestParameters, initOverrides) {
|
|
93
93
|
const queryParameters = {};
|
|
94
94
|
if (requestParameters['startDate'] != null) {
|
|
95
95
|
queryParameters['startDate'] = requestParameters['startDate'];
|
|
@@ -102,19 +102,19 @@ class MetricsApi extends runtime.BaseAPI {
|
|
|
102
102
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
103
103
|
}
|
|
104
104
|
const response = await this.request({
|
|
105
|
-
path: `/metrics
|
|
105
|
+
path: `/metrics`,
|
|
106
106
|
method: 'GET',
|
|
107
107
|
headers: headerParameters,
|
|
108
108
|
query: queryParameters,
|
|
109
109
|
}, initOverrides);
|
|
110
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.
|
|
110
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.MetricUioFromJSON));
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
|
-
* Retrieves usage metrics
|
|
114
|
-
* Get
|
|
113
|
+
* Retrieves usage metrics for all agents within a date range (admin only)
|
|
114
|
+
* Get usage metrics
|
|
115
115
|
*/
|
|
116
|
-
async
|
|
117
|
-
const response = await this.
|
|
116
|
+
async getMetrics(startDate, endDate, initOverrides) {
|
|
117
|
+
const response = await this.getMetricsRaw({ startDate: startDate, endDate: endDate }, initOverrides);
|
|
118
118
|
return await response.value();
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
@@ -129,12 +129,18 @@ class MetricsApi extends runtime.BaseAPI {
|
|
|
129
129
|
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling getMetricsBrainsAgent().');
|
|
130
130
|
}
|
|
131
131
|
const queryParameters = {};
|
|
132
|
+
if (requestParameters['startDate'] != null) {
|
|
133
|
+
queryParameters['startDate'] = requestParameters['startDate'];
|
|
134
|
+
}
|
|
135
|
+
if (requestParameters['endDate'] != null) {
|
|
136
|
+
queryParameters['endDate'] = requestParameters['endDate'];
|
|
137
|
+
}
|
|
132
138
|
const headerParameters = {};
|
|
133
139
|
if (this.configuration && this.configuration.apiKey) {
|
|
134
140
|
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
135
141
|
}
|
|
136
142
|
const response = await this.request({
|
|
137
|
-
path: `/organizations/{organizationId}/
|
|
143
|
+
path: `/organizations/{organizationId}/agents/{agentId}`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))).replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
|
|
138
144
|
method: 'GET',
|
|
139
145
|
headers: headerParameters,
|
|
140
146
|
query: queryParameters,
|
|
@@ -145,8 +151,8 @@ class MetricsApi extends runtime.BaseAPI {
|
|
|
145
151
|
* Retrieves metrics for a brain agent
|
|
146
152
|
* Get metrics for a brain agent
|
|
147
153
|
*/
|
|
148
|
-
async getMetricsBrainsAgent(organizationId, agentId, initOverrides) {
|
|
149
|
-
const response = await this.getMetricsBrainsAgentRaw({ organizationId: organizationId, agentId: agentId }, initOverrides);
|
|
154
|
+
async getMetricsBrainsAgent(organizationId, agentId, startDate, endDate, initOverrides) {
|
|
155
|
+
const response = await this.getMetricsBrainsAgentRaw({ organizationId: organizationId, agentId: agentId, startDate: startDate, endDate: endDate }, initOverrides);
|
|
150
156
|
return await response.value();
|
|
151
157
|
}
|
|
152
158
|
/**
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { AccessRoleCreateRequestUio, AccessRolePermissionsRequestUio, AccessRoleUio, AccessRoleUpdateRequestUio, OrganizationEngineUio, OrganizationMemberUio, OrganizationUio, OrganizationUserInviteRequestUio, OrganizationUserInviteResponseUio, RoleCreateRequestUio, RoleUio, UserAccessRolesRequestUio, UserAccessUio,
|
|
13
|
+
import type { AccessRoleCreateRequestUio, AccessRolePermissionsRequestUio, AccessRoleUio, AccessRoleUpdateRequestUio, OrganizationEngineUio, OrganizationMemberUio, OrganizationUio, OrganizationUserInviteRequestUio, OrganizationUserInviteResponseUio, RoleCreateRequestUio, RoleUio, UserAccessRolesRequestUio, UserAccessUio, UserDirectPermissionsRequestUio } from '../models/index';
|
|
14
14
|
export interface CreateOrganizationAccessRoleRequest {
|
|
15
15
|
organizationId: string;
|
|
16
16
|
accessRoleCreateRequestUio: AccessRoleCreateRequestUio;
|
|
@@ -47,10 +47,6 @@ export interface GetOrganizationUserAccessRequest {
|
|
|
47
47
|
organizationId: string;
|
|
48
48
|
userId: string;
|
|
49
49
|
}
|
|
50
|
-
export interface GetOrganizationUserAgentsAccessRequest {
|
|
51
|
-
organizationId: string;
|
|
52
|
-
userId: string;
|
|
53
|
-
}
|
|
54
50
|
export interface InviteOrganizationUserRequest {
|
|
55
51
|
organizationId: string;
|
|
56
52
|
organizationUserInviteRequestUio: OrganizationUserInviteRequestUio;
|
|
@@ -74,11 +70,6 @@ export interface SetOrganizationUserAccessRolesRequest {
|
|
|
74
70
|
userId: string;
|
|
75
71
|
userAccessRolesRequestUio: UserAccessRolesRequestUio;
|
|
76
72
|
}
|
|
77
|
-
export interface SetOrganizationUserAgentsAccessRequest {
|
|
78
|
-
organizationId: string;
|
|
79
|
-
userId: string;
|
|
80
|
-
userAgentAccessRequestUio: UserAgentAccessRequestUio;
|
|
81
|
-
}
|
|
82
73
|
export interface SetOrganizationUserDirectPermissionsRequest {
|
|
83
74
|
organizationId: string;
|
|
84
75
|
userId: string;
|
|
@@ -192,14 +183,6 @@ export declare class OrganizationsApi extends runtime.BaseAPI {
|
|
|
192
183
|
* Get user access roles and direct permissions
|
|
193
184
|
*/
|
|
194
185
|
getOrganizationUserAccess(organizationId: string, userId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserAccessUio>;
|
|
195
|
-
/**
|
|
196
|
-
* Get user agent access configuration
|
|
197
|
-
*/
|
|
198
|
-
getOrganizationUserAgentsAccessRaw(requestParameters: GetOrganizationUserAgentsAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserAgentAccessUio>>;
|
|
199
|
-
/**
|
|
200
|
-
* Get user agent access configuration
|
|
201
|
-
*/
|
|
202
|
-
getOrganizationUserAgentsAccess(organizationId: string, userId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserAgentAccessUio>;
|
|
203
186
|
/**
|
|
204
187
|
* Invite a user to an organization
|
|
205
188
|
*/
|
|
@@ -260,14 +243,6 @@ export declare class OrganizationsApi extends runtime.BaseAPI {
|
|
|
260
243
|
* Set user access roles
|
|
261
244
|
*/
|
|
262
245
|
setOrganizationUserAccessRoles(organizationId: string, userId: string, userAccessRolesRequestUio: UserAccessRolesRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
263
|
-
/**
|
|
264
|
-
* Set user agent access configuration
|
|
265
|
-
*/
|
|
266
|
-
setOrganizationUserAgentsAccessRaw(requestParameters: SetOrganizationUserAgentsAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
267
|
-
/**
|
|
268
|
-
* Set user agent access configuration
|
|
269
|
-
*/
|
|
270
|
-
setOrganizationUserAgentsAccess(organizationId: string, userId: string, userAgentAccessRequestUio: UserAgentAccessRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
271
246
|
/**
|
|
272
247
|
* Set user direct permissions
|
|
273
248
|
*/
|
|
@@ -352,36 +352,6 @@ class OrganizationsApi extends runtime.BaseAPI {
|
|
|
352
352
|
const response = await this.getOrganizationUserAccessRaw({ organizationId: organizationId, userId: userId }, initOverrides);
|
|
353
353
|
return await response.value();
|
|
354
354
|
}
|
|
355
|
-
/**
|
|
356
|
-
* Get user agent access configuration
|
|
357
|
-
*/
|
|
358
|
-
async getOrganizationUserAgentsAccessRaw(requestParameters, initOverrides) {
|
|
359
|
-
if (requestParameters['organizationId'] == null) {
|
|
360
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getOrganizationUserAgentsAccess().');
|
|
361
|
-
}
|
|
362
|
-
if (requestParameters['userId'] == null) {
|
|
363
|
-
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling getOrganizationUserAgentsAccess().');
|
|
364
|
-
}
|
|
365
|
-
const queryParameters = {};
|
|
366
|
-
const headerParameters = {};
|
|
367
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
368
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
369
|
-
}
|
|
370
|
-
const response = await this.request({
|
|
371
|
-
path: `/organizations/{organizationId}/users/{userId}/agents-access`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))).replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))),
|
|
372
|
-
method: 'GET',
|
|
373
|
-
headers: headerParameters,
|
|
374
|
-
query: queryParameters,
|
|
375
|
-
}, initOverrides);
|
|
376
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UserAgentAccessUioFromJSON)(jsonValue));
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* Get user agent access configuration
|
|
380
|
-
*/
|
|
381
|
-
async getOrganizationUserAgentsAccess(organizationId, userId, initOverrides) {
|
|
382
|
-
const response = await this.getOrganizationUserAgentsAccessRaw({ organizationId: organizationId, userId: userId }, initOverrides);
|
|
383
|
-
return await response.value();
|
|
384
|
-
}
|
|
385
355
|
/**
|
|
386
356
|
* Invite a user to an organization
|
|
387
357
|
*/
|
|
@@ -591,40 +561,6 @@ class OrganizationsApi extends runtime.BaseAPI {
|
|
|
591
561
|
async setOrganizationUserAccessRoles(organizationId, userId, userAccessRolesRequestUio, initOverrides) {
|
|
592
562
|
await this.setOrganizationUserAccessRolesRaw({ organizationId: organizationId, userId: userId, userAccessRolesRequestUio: userAccessRolesRequestUio }, initOverrides);
|
|
593
563
|
}
|
|
594
|
-
/**
|
|
595
|
-
* Set user agent access configuration
|
|
596
|
-
*/
|
|
597
|
-
async setOrganizationUserAgentsAccessRaw(requestParameters, initOverrides) {
|
|
598
|
-
if (requestParameters['organizationId'] == null) {
|
|
599
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling setOrganizationUserAgentsAccess().');
|
|
600
|
-
}
|
|
601
|
-
if (requestParameters['userId'] == null) {
|
|
602
|
-
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling setOrganizationUserAgentsAccess().');
|
|
603
|
-
}
|
|
604
|
-
if (requestParameters['userAgentAccessRequestUio'] == null) {
|
|
605
|
-
throw new runtime.RequiredError('userAgentAccessRequestUio', 'Required parameter "userAgentAccessRequestUio" was null or undefined when calling setOrganizationUserAgentsAccess().');
|
|
606
|
-
}
|
|
607
|
-
const queryParameters = {};
|
|
608
|
-
const headerParameters = {};
|
|
609
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
610
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
611
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
612
|
-
}
|
|
613
|
-
const response = await this.request({
|
|
614
|
-
path: `/organizations/{organizationId}/users/{userId}/agents-access`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))).replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))),
|
|
615
|
-
method: 'PUT',
|
|
616
|
-
headers: headerParameters,
|
|
617
|
-
query: queryParameters,
|
|
618
|
-
body: (0, index_1.UserAgentAccessRequestUioToJSON)(requestParameters['userAgentAccessRequestUio']),
|
|
619
|
-
}, initOverrides);
|
|
620
|
-
return new runtime.VoidApiResponse(response);
|
|
621
|
-
}
|
|
622
|
-
/**
|
|
623
|
-
* Set user agent access configuration
|
|
624
|
-
*/
|
|
625
|
-
async setOrganizationUserAgentsAccess(organizationId, userId, userAgentAccessRequestUio, initOverrides) {
|
|
626
|
-
await this.setOrganizationUserAgentsAccessRaw({ organizationId: organizationId, userId: userId, userAgentAccessRequestUio: userAgentAccessRequestUio }, initOverrides);
|
|
627
|
-
}
|
|
628
564
|
/**
|
|
629
565
|
* Set user direct permissions
|
|
630
566
|
*/
|