@breign/client 1.0.24 → 1.0.26

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.
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AgentModuleUio, BodyWithMessageUio, DocumentAddRequestUio, FileCreationRequestUio, FileCreationResponseUio, FileStatusUpdateRequestUio, FileWithDownloadUrlUio, ImportFileToAgentKnowledge200ResponseUio } from '../models/index';
13
+ import type { AgentModuleUio, BodyWithMessageUio, DocumentAddRequestUio, FileCreationRequestUio, FileCreationResponseUio, FileStatusUio, FileStatusUpdateRequestUio, FileWithDownloadUrlUio, ImageKnowledgeUio, ImportFileToAgentKnowledge200ResponseUio, S3UploadBodyUio } from '../models/index';
14
14
  export interface AddDocumentToKnowledgeBaseRequest {
15
15
  agentId: string;
16
16
  documentAddRequestUio: DocumentAddRequestUio;
@@ -32,10 +32,17 @@ export interface DeleteFileFromAgentKnowledgeRequest {
32
32
  agentId: string;
33
33
  fileId: string;
34
34
  }
35
+ export interface DeleteImageFromKnowledgeBaseLibraryRequest {
36
+ knowledgebaseId: string;
37
+ imageId: string;
38
+ }
35
39
  export interface GetFileFromAgentKnowledgeRequest {
36
40
  agentId: string;
37
41
  fileId: string;
38
42
  }
43
+ export interface GetImagesFromKnowledgeBaseLibraryRequest {
44
+ knowledgebaseId: string;
45
+ }
39
46
  export interface ImportFileToAgentKnowledgeRequest {
40
47
  agentId: string;
41
48
  file: Blob;
@@ -58,6 +65,15 @@ export interface UpdateFileStatusRequest {
58
65
  fileId: string;
59
66
  fileStatusUpdateRequestUio: FileStatusUpdateRequestUio;
60
67
  }
68
+ export interface UpdateImageStatusInKnowledgeBaseLibraryRequest {
69
+ knowledgebaseId: string;
70
+ imageId: string;
71
+ fileStatusUpdateRequestUio: FileStatusUpdateRequestUio;
72
+ }
73
+ export interface UploadImageToKnowledgeBaseLibraryRequest {
74
+ knowledgebaseId: string;
75
+ image: Blob;
76
+ }
61
77
  /**
62
78
  *
63
79
  */
@@ -112,6 +128,16 @@ export declare class KnowledgeApi extends runtime.BaseAPI {
112
128
  * Delete a knowledge file from an agent
113
129
  */
114
130
  deleteFileFromAgentKnowledge(agentId: string, fileId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
131
+ /**
132
+ * Delete a specific knowledge image from a library image in knowledge base
133
+ * Delete a specific knowledge image from a library image in knowledge base
134
+ */
135
+ deleteImageFromKnowledgeBaseLibraryRaw(requestParameters: DeleteImageFromKnowledgeBaseLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
136
+ /**
137
+ * Delete a specific knowledge image from a library image in knowledge base
138
+ * Delete a specific knowledge image from a library image in knowledge base
139
+ */
140
+ deleteImageFromKnowledgeBaseLibrary(knowledgebaseId: string, imageId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
115
141
  /**
116
142
  * Retrieves metadata for a file that has been imported into the agent\'s knowledge base
117
143
  * Get a specific knowledge file from an agent
@@ -122,6 +148,16 @@ export declare class KnowledgeApi extends runtime.BaseAPI {
122
148
  * Get a specific knowledge file from an agent
123
149
  */
124
150
  getFileFromAgentKnowledge(agentId: string, fileId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileWithDownloadUrlUio>;
151
+ /**
152
+ * Get all images from a library image in knowledge base
153
+ * Get all knowledge images from a knowledge base
154
+ */
155
+ getImagesFromKnowledgeBaseLibraryRaw(requestParameters: GetImagesFromKnowledgeBaseLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ImageKnowledgeUio>>;
156
+ /**
157
+ * Get all images from a library image in knowledge base
158
+ * Get all knowledge images from a knowledge base
159
+ */
160
+ getImagesFromKnowledgeBaseLibrary(knowledgebaseId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ImageKnowledgeUio>;
125
161
  /**
126
162
  * Processes documents like PDFs, CSVs, and text files, and adds them to the brain\'s knowledge base
127
163
  * Upload and import a file into the brain\'s knowledge base
@@ -182,4 +218,24 @@ export declare class KnowledgeApi extends runtime.BaseAPI {
182
218
  * Update file status and trigger indexing
183
219
  */
184
220
  updateFileStatus(agentId: string, fileId: string, fileStatusUpdateRequestUio: FileStatusUpdateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any>;
221
+ /**
222
+ * Update the status of a specific knowledge image in a library image in knowledge base
223
+ * Update the status of a specific knowledge image in a library image in knowledge base
224
+ */
225
+ updateImageStatusInKnowledgeBaseLibraryRaw(requestParameters: UpdateImageStatusInKnowledgeBaseLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileStatusUio>>;
226
+ /**
227
+ * Update the status of a specific knowledge image in a library image in knowledge base
228
+ * Update the status of a specific knowledge image in a library image in knowledge base
229
+ */
230
+ updateImageStatusInKnowledgeBaseLibrary(knowledgebaseId: string, imageId: string, fileStatusUpdateRequestUio: FileStatusUpdateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileStatusUio>;
231
+ /**
232
+ * Upload a new image to a library image in knowledge base and return the upload URL
233
+ * Upload a new image to a library image in knowledge base
234
+ */
235
+ uploadImageToKnowledgeBaseLibraryRaw(requestParameters: UploadImageToKnowledgeBaseLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<S3UploadBodyUio>>;
236
+ /**
237
+ * Upload a new image to a library image in knowledge base and return the upload URL
238
+ * Upload a new image to a library image in knowledge base
239
+ */
240
+ uploadImageToKnowledgeBaseLibrary(knowledgebaseId: string, image: Blob, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<S3UploadBodyUio>;
185
241
  }
@@ -219,6 +219,37 @@ class KnowledgeApi extends runtime.BaseAPI {
219
219
  async deleteFileFromAgentKnowledge(agentId, fileId, initOverrides) {
220
220
  await this.deleteFileFromAgentKnowledgeRaw({ agentId: agentId, fileId: fileId }, initOverrides);
221
221
  }
222
+ /**
223
+ * Delete a specific knowledge image from a library image in knowledge base
224
+ * Delete a specific knowledge image from a library image in knowledge base
225
+ */
226
+ async deleteImageFromKnowledgeBaseLibraryRaw(requestParameters, initOverrides) {
227
+ if (requestParameters['knowledgebaseId'] == null) {
228
+ throw new runtime.RequiredError('knowledgebaseId', 'Required parameter "knowledgebaseId" was null or undefined when calling deleteImageFromKnowledgeBaseLibrary().');
229
+ }
230
+ if (requestParameters['imageId'] == null) {
231
+ throw new runtime.RequiredError('imageId', 'Required parameter "imageId" was null or undefined when calling deleteImageFromKnowledgeBaseLibrary().');
232
+ }
233
+ const queryParameters = {};
234
+ const headerParameters = {};
235
+ if (this.configuration && this.configuration.apiKey) {
236
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
237
+ }
238
+ const response = await this.request({
239
+ path: `/knowledge-bases/{knowledgebaseId}/images`.replace(`{${"knowledgebaseId"}}`, encodeURIComponent(String(requestParameters['knowledgebaseId']))).replace(`{${"imageId"}}`, encodeURIComponent(String(requestParameters['imageId']))),
240
+ method: 'DELETE',
241
+ headers: headerParameters,
242
+ query: queryParameters,
243
+ }, initOverrides);
244
+ return new runtime.VoidApiResponse(response);
245
+ }
246
+ /**
247
+ * Delete a specific knowledge image from a library image in knowledge base
248
+ * Delete a specific knowledge image from a library image in knowledge base
249
+ */
250
+ async deleteImageFromKnowledgeBaseLibrary(knowledgebaseId, imageId, initOverrides) {
251
+ await this.deleteImageFromKnowledgeBaseLibraryRaw({ knowledgebaseId: knowledgebaseId, imageId: imageId }, initOverrides);
252
+ }
222
253
  /**
223
254
  * Retrieves metadata for a file that has been imported into the agent\'s knowledge base
224
255
  * Get a specific knowledge file from an agent
@@ -251,6 +282,35 @@ class KnowledgeApi extends runtime.BaseAPI {
251
282
  const response = await this.getFileFromAgentKnowledgeRaw({ agentId: agentId, fileId: fileId }, initOverrides);
252
283
  return await response.value();
253
284
  }
285
+ /**
286
+ * Get all images from a library image in knowledge base
287
+ * Get all knowledge images from a knowledge base
288
+ */
289
+ async getImagesFromKnowledgeBaseLibraryRaw(requestParameters, initOverrides) {
290
+ if (requestParameters['knowledgebaseId'] == null) {
291
+ throw new runtime.RequiredError('knowledgebaseId', 'Required parameter "knowledgebaseId" was null or undefined when calling getImagesFromKnowledgeBaseLibrary().');
292
+ }
293
+ const queryParameters = {};
294
+ const headerParameters = {};
295
+ if (this.configuration && this.configuration.apiKey) {
296
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
297
+ }
298
+ const response = await this.request({
299
+ path: `/knowledge-bases/{knowledgebaseId}/images`.replace(`{${"knowledgebaseId"}}`, encodeURIComponent(String(requestParameters['knowledgebaseId']))),
300
+ method: 'GET',
301
+ headers: headerParameters,
302
+ query: queryParameters,
303
+ }, initOverrides);
304
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ImageKnowledgeUioFromJSON)(jsonValue));
305
+ }
306
+ /**
307
+ * Get all images from a library image in knowledge base
308
+ * Get all knowledge images from a knowledge base
309
+ */
310
+ async getImagesFromKnowledgeBaseLibrary(knowledgebaseId, initOverrides) {
311
+ const response = await this.getImagesFromKnowledgeBaseLibraryRaw({ knowledgebaseId: knowledgebaseId }, initOverrides);
312
+ return await response.value();
313
+ }
254
314
  /**
255
315
  * Processes documents like PDFs, CSVs, and text files, and adds them to the brain\'s knowledge base
256
316
  * Upload and import a file into the brain\'s knowledge base
@@ -463,5 +523,93 @@ class KnowledgeApi extends runtime.BaseAPI {
463
523
  const response = await this.updateFileStatusRaw({ agentId: agentId, fileId: fileId, fileStatusUpdateRequestUio: fileStatusUpdateRequestUio }, initOverrides);
464
524
  return await response.value();
465
525
  }
526
+ /**
527
+ * Update the status of a specific knowledge image in a library image in knowledge base
528
+ * Update the status of a specific knowledge image in a library image in knowledge base
529
+ */
530
+ async updateImageStatusInKnowledgeBaseLibraryRaw(requestParameters, initOverrides) {
531
+ if (requestParameters['knowledgebaseId'] == null) {
532
+ throw new runtime.RequiredError('knowledgebaseId', 'Required parameter "knowledgebaseId" was null or undefined when calling updateImageStatusInKnowledgeBaseLibrary().');
533
+ }
534
+ if (requestParameters['imageId'] == null) {
535
+ throw new runtime.RequiredError('imageId', 'Required parameter "imageId" was null or undefined when calling updateImageStatusInKnowledgeBaseLibrary().');
536
+ }
537
+ if (requestParameters['fileStatusUpdateRequestUio'] == null) {
538
+ throw new runtime.RequiredError('fileStatusUpdateRequestUio', 'Required parameter "fileStatusUpdateRequestUio" was null or undefined when calling updateImageStatusInKnowledgeBaseLibrary().');
539
+ }
540
+ const queryParameters = {};
541
+ const headerParameters = {};
542
+ headerParameters['Content-Type'] = 'application/json';
543
+ if (this.configuration && this.configuration.apiKey) {
544
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
545
+ }
546
+ const response = await this.request({
547
+ path: `/knowledge-bases/{knowledgebaseId}/images/{imageId}/status`.replace(`{${"knowledgebaseId"}}`, encodeURIComponent(String(requestParameters['knowledgebaseId']))).replace(`{${"imageId"}}`, encodeURIComponent(String(requestParameters['imageId']))),
548
+ method: 'POST',
549
+ headers: headerParameters,
550
+ query: queryParameters,
551
+ body: (0, index_1.FileStatusUpdateRequestUioToJSON)(requestParameters['fileStatusUpdateRequestUio']),
552
+ }, initOverrides);
553
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FileStatusUioFromJSON)(jsonValue));
554
+ }
555
+ /**
556
+ * Update the status of a specific knowledge image in a library image in knowledge base
557
+ * Update the status of a specific knowledge image in a library image in knowledge base
558
+ */
559
+ async updateImageStatusInKnowledgeBaseLibrary(knowledgebaseId, imageId, fileStatusUpdateRequestUio, initOverrides) {
560
+ const response = await this.updateImageStatusInKnowledgeBaseLibraryRaw({ knowledgebaseId: knowledgebaseId, imageId: imageId, fileStatusUpdateRequestUio: fileStatusUpdateRequestUio }, initOverrides);
561
+ return await response.value();
562
+ }
563
+ /**
564
+ * Upload a new image to a library image in knowledge base and return the upload URL
565
+ * Upload a new image to a library image in knowledge base
566
+ */
567
+ async uploadImageToKnowledgeBaseLibraryRaw(requestParameters, initOverrides) {
568
+ if (requestParameters['knowledgebaseId'] == null) {
569
+ throw new runtime.RequiredError('knowledgebaseId', 'Required parameter "knowledgebaseId" was null or undefined when calling uploadImageToKnowledgeBaseLibrary().');
570
+ }
571
+ if (requestParameters['image'] == null) {
572
+ throw new runtime.RequiredError('image', 'Required parameter "image" was null or undefined when calling uploadImageToKnowledgeBaseLibrary().');
573
+ }
574
+ const queryParameters = {};
575
+ const headerParameters = {};
576
+ if (this.configuration && this.configuration.apiKey) {
577
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
578
+ }
579
+ const consumes = [
580
+ { contentType: 'multipart/form-data' },
581
+ ];
582
+ // @ts-ignore: canConsumeForm may be unused
583
+ const canConsumeForm = runtime.canConsumeForm(consumes);
584
+ let formParams;
585
+ let useForm = false;
586
+ // use FormData to transmit files using content-type "multipart/form-data"
587
+ useForm = canConsumeForm;
588
+ if (useForm) {
589
+ formParams = new FormData();
590
+ }
591
+ else {
592
+ formParams = new URLSearchParams();
593
+ }
594
+ if (requestParameters['image'] != null) {
595
+ formParams.append('image', requestParameters['image']);
596
+ }
597
+ const response = await this.request({
598
+ path: `/knowledge-bases/{knowledgebaseId}/images`.replace(`{${"knowledgebaseId"}}`, encodeURIComponent(String(requestParameters['knowledgebaseId']))),
599
+ method: 'POST',
600
+ headers: headerParameters,
601
+ query: queryParameters,
602
+ body: formParams,
603
+ }, initOverrides);
604
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.S3UploadBodyUioFromJSON)(jsonValue));
605
+ }
606
+ /**
607
+ * Upload a new image to a library image in knowledge base and return the upload URL
608
+ * Upload a new image to a library image in knowledge base
609
+ */
610
+ async uploadImageToKnowledgeBaseLibrary(knowledgebaseId, image, initOverrides) {
611
+ const response = await this.uploadImageToKnowledgeBaseLibraryRaw({ knowledgebaseId: knowledgebaseId, image: image }, initOverrides);
612
+ return await response.value();
613
+ }
466
614
  }
467
615
  exports.KnowledgeApi = KnowledgeApi;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface ImageKnowledgeUio
16
+ */
17
+ export interface ImageKnowledgeUio {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ImageKnowledgeUio
22
+ */
23
+ id?: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof ImageKnowledgeUio
28
+ */
29
+ knowledgeBaseId?: string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof ImageKnowledgeUio
34
+ */
35
+ name?: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof ImageKnowledgeUio
40
+ */
41
+ contentType?: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof ImageKnowledgeUio
46
+ */
47
+ ext?: string;
48
+ /**
49
+ *
50
+ * @type {number}
51
+ * @memberof ImageKnowledgeUio
52
+ */
53
+ size?: number;
54
+ /**
55
+ *
56
+ * @type {string}
57
+ * @memberof ImageKnowledgeUio
58
+ */
59
+ key?: string;
60
+ /**
61
+ *
62
+ * @type {string}
63
+ * @memberof ImageKnowledgeUio
64
+ */
65
+ createdAt?: string;
66
+ /**
67
+ *
68
+ * @type {string}
69
+ * @memberof ImageKnowledgeUio
70
+ */
71
+ updatedAt?: string;
72
+ /**
73
+ *
74
+ * @type {string}
75
+ * @memberof ImageKnowledgeUio
76
+ */
77
+ url?: string;
78
+ }
79
+ /**
80
+ * Check if a given object implements the ImageKnowledgeUio interface.
81
+ */
82
+ export declare function instanceOfImageKnowledgeUio(value: object): value is ImageKnowledgeUio;
83
+ export declare function ImageKnowledgeUioFromJSON(json: any): ImageKnowledgeUio;
84
+ export declare function ImageKnowledgeUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): ImageKnowledgeUio;
85
+ export declare function ImageKnowledgeUioToJSON(json: any): ImageKnowledgeUio;
86
+ export declare function ImageKnowledgeUioToJSONTyped(value?: ImageKnowledgeUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfImageKnowledgeUio = instanceOfImageKnowledgeUio;
17
+ exports.ImageKnowledgeUioFromJSON = ImageKnowledgeUioFromJSON;
18
+ exports.ImageKnowledgeUioFromJSONTyped = ImageKnowledgeUioFromJSONTyped;
19
+ exports.ImageKnowledgeUioToJSON = ImageKnowledgeUioToJSON;
20
+ exports.ImageKnowledgeUioToJSONTyped = ImageKnowledgeUioToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the ImageKnowledgeUio interface.
23
+ */
24
+ function instanceOfImageKnowledgeUio(value) {
25
+ return true;
26
+ }
27
+ function ImageKnowledgeUioFromJSON(json) {
28
+ return ImageKnowledgeUioFromJSONTyped(json, false);
29
+ }
30
+ function ImageKnowledgeUioFromJSONTyped(json, ignoreDiscriminator) {
31
+ if (json == null) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'id': json['id'] == null ? undefined : json['id'],
36
+ 'knowledgeBaseId': json['knowledgeBaseId'] == null ? undefined : json['knowledgeBaseId'],
37
+ 'name': json['name'] == null ? undefined : json['name'],
38
+ 'contentType': json['contentType'] == null ? undefined : json['contentType'],
39
+ 'ext': json['ext'] == null ? undefined : json['ext'],
40
+ 'size': json['size'] == null ? undefined : json['size'],
41
+ 'key': json['key'] == null ? undefined : json['key'],
42
+ 'createdAt': json['createdAt'] == null ? undefined : json['createdAt'],
43
+ 'updatedAt': json['updatedAt'] == null ? undefined : json['updatedAt'],
44
+ 'url': json['url'] == null ? undefined : json['url'],
45
+ };
46
+ }
47
+ function ImageKnowledgeUioToJSON(json) {
48
+ return ImageKnowledgeUioToJSONTyped(json, false);
49
+ }
50
+ function ImageKnowledgeUioToJSONTyped(value, ignoreDiscriminator = false) {
51
+ if (value == null) {
52
+ return value;
53
+ }
54
+ return {
55
+ 'id': value['id'],
56
+ 'knowledgeBaseId': value['knowledgeBaseId'],
57
+ 'name': value['name'],
58
+ 'contentType': value['contentType'],
59
+ 'ext': value['ext'],
60
+ 'size': value['size'],
61
+ 'key': value['key'],
62
+ 'createdAt': value['createdAt'],
63
+ 'updatedAt': value['updatedAt'],
64
+ 'url': value['url'],
65
+ };
66
+ }
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import type { SuggestionUio } from './SuggestionUio';
13
13
  import type { InputUio } from './InputUio';
14
+ import type { ToolUsedUio } from './ToolUsedUio';
14
15
  /**
15
16
  *
16
17
  * @export
@@ -47,6 +48,12 @@ export interface PromptCreateResponseUio {
47
48
  * @memberof PromptCreateResponseUio
48
49
  */
49
50
  input: InputUio;
51
+ /**
52
+ *
53
+ * @type {Array<ToolUsedUio>}
54
+ * @memberof PromptCreateResponseUio
55
+ */
56
+ toolsUsed?: Array<ToolUsedUio> | null;
50
57
  }
51
58
  /**
52
59
  * Check if a given object implements the PromptCreateResponseUio interface.
@@ -20,6 +20,7 @@ exports.PromptCreateResponseUioToJSON = PromptCreateResponseUioToJSON;
20
20
  exports.PromptCreateResponseUioToJSONTyped = PromptCreateResponseUioToJSONTyped;
21
21
  const SuggestionUio_1 = require("./SuggestionUio");
22
22
  const InputUio_1 = require("./InputUio");
23
+ const ToolUsedUio_1 = require("./ToolUsedUio");
23
24
  /**
24
25
  * Check if a given object implements the PromptCreateResponseUio interface.
25
26
  */
@@ -47,6 +48,7 @@ function PromptCreateResponseUioFromJSONTyped(json, ignoreDiscriminator) {
47
48
  'text': json['text'],
48
49
  'suggestions': json['suggestions'] == null ? undefined : (json['suggestions'].map(SuggestionUio_1.SuggestionUioFromJSON)),
49
50
  'input': (0, InputUio_1.InputUioFromJSON)(json['input']),
51
+ 'toolsUsed': json['toolsUsed'] == null ? undefined : (json['toolsUsed'].map(ToolUsedUio_1.ToolUsedUioFromJSON)),
50
52
  };
51
53
  }
52
54
  function PromptCreateResponseUioToJSON(json) {
@@ -62,5 +64,6 @@ function PromptCreateResponseUioToJSONTyped(value, ignoreDiscriminator = false)
62
64
  'text': value['text'],
63
65
  'suggestions': value['suggestions'] == null ? undefined : (value['suggestions'].map(SuggestionUio_1.SuggestionUioToJSON)),
64
66
  'input': (0, InputUio_1.InputUioToJSON)(value['input']),
67
+ 'toolsUsed': value['toolsUsed'] == null ? undefined : (value['toolsUsed'].map(ToolUsedUio_1.ToolUsedUioToJSON)),
65
68
  };
66
69
  }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface ToolUsedUio
16
+ */
17
+ export interface ToolUsedUio {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ToolUsedUio
22
+ */
23
+ name: string;
24
+ /**
25
+ *
26
+ * @type {{ [key: string]: any; }}
27
+ * @memberof ToolUsedUio
28
+ */
29
+ params?: {
30
+ [key: string]: any;
31
+ } | null;
32
+ /**
33
+ *
34
+ * @type {boolean}
35
+ * @memberof ToolUsedUio
36
+ */
37
+ askConfirmation?: boolean | null;
38
+ /**
39
+ *
40
+ * @type {string}
41
+ * @memberof ToolUsedUio
42
+ */
43
+ confirmationLink?: string | null;
44
+ }
45
+ /**
46
+ * Check if a given object implements the ToolUsedUio interface.
47
+ */
48
+ export declare function instanceOfToolUsedUio(value: object): value is ToolUsedUio;
49
+ export declare function ToolUsedUioFromJSON(json: any): ToolUsedUio;
50
+ export declare function ToolUsedUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): ToolUsedUio;
51
+ export declare function ToolUsedUioToJSON(json: any): ToolUsedUio;
52
+ export declare function ToolUsedUioToJSONTyped(value?: ToolUsedUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfToolUsedUio = instanceOfToolUsedUio;
17
+ exports.ToolUsedUioFromJSON = ToolUsedUioFromJSON;
18
+ exports.ToolUsedUioFromJSONTyped = ToolUsedUioFromJSONTyped;
19
+ exports.ToolUsedUioToJSON = ToolUsedUioToJSON;
20
+ exports.ToolUsedUioToJSONTyped = ToolUsedUioToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the ToolUsedUio interface.
23
+ */
24
+ function instanceOfToolUsedUio(value) {
25
+ if (!('name' in value) || value['name'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ function ToolUsedUioFromJSON(json) {
30
+ return ToolUsedUioFromJSONTyped(json, false);
31
+ }
32
+ function ToolUsedUioFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'name': json['name'],
38
+ 'params': json['params'] == null ? undefined : json['params'],
39
+ 'askConfirmation': json['askConfirmation'] == null ? undefined : json['askConfirmation'],
40
+ 'confirmationLink': json['confirmationLink'] == null ? undefined : json['confirmationLink'],
41
+ };
42
+ }
43
+ function ToolUsedUioToJSON(json) {
44
+ return ToolUsedUioToJSONTyped(json, false);
45
+ }
46
+ function ToolUsedUioToJSONTyped(value, ignoreDiscriminator = false) {
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'name': value['name'],
52
+ 'params': value['params'],
53
+ 'askConfirmation': value['askConfirmation'],
54
+ 'confirmationLink': value['confirmationLink'],
55
+ };
56
+ }
@@ -106,6 +106,7 @@ export * from './HealthCheckResponseComponentsApiUio';
106
106
  export * from './HealthCheckResponseComponentsUio';
107
107
  export * from './HealthCheckResponseUio';
108
108
  export * from './HealthStatusUio';
109
+ export * from './ImageKnowledgeUio';
109
110
  export * from './ImportFileToAgentKnowledge200ResponseUio';
110
111
  export * from './InputUio';
111
112
  export * from './InstanceUio';
@@ -163,6 +164,7 @@ export * from './ToolSecureManifestUio';
163
164
  export * from './ToolSecureMcpDefinitionUio';
164
165
  export * from './ToolSecureMcpUio';
165
166
  export * from './ToolSecureUio';
167
+ export * from './ToolUsedUio';
166
168
  export * from './TransactionUio';
167
169
  export * from './UserUio';
168
170
  export * from './UserUserUio';
@@ -124,6 +124,7 @@ __exportStar(require("./HealthCheckResponseComponentsApiUio"), exports);
124
124
  __exportStar(require("./HealthCheckResponseComponentsUio"), exports);
125
125
  __exportStar(require("./HealthCheckResponseUio"), exports);
126
126
  __exportStar(require("./HealthStatusUio"), exports);
127
+ __exportStar(require("./ImageKnowledgeUio"), exports);
127
128
  __exportStar(require("./ImportFileToAgentKnowledge200ResponseUio"), exports);
128
129
  __exportStar(require("./InputUio"), exports);
129
130
  __exportStar(require("./InstanceUio"), exports);
@@ -181,6 +182,7 @@ __exportStar(require("./ToolSecureManifestUio"), exports);
181
182
  __exportStar(require("./ToolSecureMcpDefinitionUio"), exports);
182
183
  __exportStar(require("./ToolSecureMcpUio"), exports);
183
184
  __exportStar(require("./ToolSecureUio"), exports);
185
+ __exportStar(require("./ToolUsedUio"), exports);
184
186
  __exportStar(require("./TransactionUio"), exports);
185
187
  __exportStar(require("./UserUio"), exports);
186
188
  __exportStar(require("./UserUserUio"), exports);
package/dist/openapi.json CHANGED
@@ -4502,6 +4502,201 @@
4502
4502
  "tags" : [ "knowledge" ]
4503
4503
  }
4504
4504
  },
4505
+ "/knowledge-bases/{knowledgebaseId}/images" : {
4506
+ "delete" : {
4507
+ "description" : "Delete a specific knowledge image from a library image in knowledge base",
4508
+ "operationId" : "deleteImageFromKnowledgeBaseLibrary",
4509
+ "parameters" : [ {
4510
+ "description" : "ID of the knowledge base to retrieve",
4511
+ "in" : "path",
4512
+ "name" : "knowledgebaseId",
4513
+ "required" : true,
4514
+ "schema" : {
4515
+ "format" : "uuid",
4516
+ "type" : "string"
4517
+ }
4518
+ }, {
4519
+ "description" : "ID of the image to delete",
4520
+ "in" : "path",
4521
+ "name" : "imageId",
4522
+ "required" : true,
4523
+ "schema" : {
4524
+ "format" : "uuid",
4525
+ "type" : "string"
4526
+ }
4527
+ } ],
4528
+ "responses" : {
4529
+ "204" : {
4530
+ "description" : "Image deleted successfully"
4531
+ },
4532
+ "401" : {
4533
+ "description" : "Unauthorized"
4534
+ },
4535
+ "403" : {
4536
+ "description" : "Forbidden - User doesn't have access to this knowledge base"
4537
+ },
4538
+ "404" : {
4539
+ "description" : "Knowledge base or image not found"
4540
+ },
4541
+ "500" : {
4542
+ "description" : "Server error"
4543
+ }
4544
+ },
4545
+ "summary" : "Delete a specific knowledge image from a library image in knowledge base",
4546
+ "tags" : [ "knowledge" ]
4547
+ },
4548
+ "get" : {
4549
+ "description" : "Get all images from a library image in knowledge base",
4550
+ "operationId" : "getImagesFromKnowledgeBaseLibrary",
4551
+ "parameters" : [ {
4552
+ "description" : "ID of the knowledge base to retrieve",
4553
+ "in" : "path",
4554
+ "name" : "knowledgebaseId",
4555
+ "required" : true,
4556
+ "schema" : {
4557
+ "format" : "uuid",
4558
+ "type" : "string"
4559
+ }
4560
+ } ],
4561
+ "responses" : {
4562
+ "200" : {
4563
+ "content" : {
4564
+ "application/json" : {
4565
+ "schema" : {
4566
+ "$ref" : "#/components/schemas/ImageKnowledge"
4567
+ }
4568
+ }
4569
+ },
4570
+ "description" : "Images retrieved successfully"
4571
+ },
4572
+ "401" : {
4573
+ "description" : "Unauthorized"
4574
+ },
4575
+ "403" : {
4576
+ "description" : "Forbidden - User cannot access this knowledge base"
4577
+ },
4578
+ "404" : {
4579
+ "description" : "Images not found"
4580
+ },
4581
+ "500" : {
4582
+ "description" : "Server error"
4583
+ }
4584
+ },
4585
+ "summary" : "Get all knowledge images from a knowledge base",
4586
+ "tags" : [ "knowledge" ]
4587
+ },
4588
+ "post" : {
4589
+ "description" : "Upload a new image to a library image in knowledge base and return the upload URL",
4590
+ "operationId" : "uploadImageToKnowledgeBaseLibrary",
4591
+ "parameters" : [ {
4592
+ "description" : "ID of the knowledge base to retrieve",
4593
+ "in" : "path",
4594
+ "name" : "knowledgebaseId",
4595
+ "required" : true,
4596
+ "schema" : {
4597
+ "format" : "uuid",
4598
+ "type" : "string"
4599
+ }
4600
+ } ],
4601
+ "requestBody" : {
4602
+ "content" : {
4603
+ "multipart/form-data" : {
4604
+ "schema" : {
4605
+ "$ref" : "#/components/schemas/uploadImageToKnowledgeBaseLibrary_request"
4606
+ }
4607
+ }
4608
+ },
4609
+ "required" : true
4610
+ },
4611
+ "responses" : {
4612
+ "201" : {
4613
+ "content" : {
4614
+ "application/json" : {
4615
+ "schema" : {
4616
+ "$ref" : "#/components/schemas/S3UploadBody"
4617
+ }
4618
+ }
4619
+ },
4620
+ "description" : "Image uploaded successfully with upload URL"
4621
+ },
4622
+ "401" : {
4623
+ "description" : "Unauthorized"
4624
+ },
4625
+ "403" : {
4626
+ "description" : "Forbidden - User doesn't have access to this knowledge base"
4627
+ },
4628
+ "404" : {
4629
+ "description" : "Knowledge base or image not found"
4630
+ },
4631
+ "500" : {
4632
+ "description" : "Server error"
4633
+ }
4634
+ },
4635
+ "summary" : "Upload a new image to a library image in knowledge base",
4636
+ "tags" : [ "knowledge" ]
4637
+ }
4638
+ },
4639
+ "/knowledge-bases/{knowledgebaseId}/images/{imageId}/status" : {
4640
+ "post" : {
4641
+ "description" : "Update the status of a specific knowledge image in a library image in knowledge base",
4642
+ "operationId" : "updateImageStatusInKnowledgeBaseLibrary",
4643
+ "parameters" : [ {
4644
+ "description" : "ID of the knowledge base to retrieve",
4645
+ "in" : "path",
4646
+ "name" : "knowledgebaseId",
4647
+ "required" : true,
4648
+ "schema" : {
4649
+ "format" : "uuid",
4650
+ "type" : "string"
4651
+ }
4652
+ }, {
4653
+ "description" : "ID of the image to delete",
4654
+ "in" : "path",
4655
+ "name" : "imageId",
4656
+ "required" : true,
4657
+ "schema" : {
4658
+ "format" : "uuid",
4659
+ "type" : "string"
4660
+ }
4661
+ } ],
4662
+ "requestBody" : {
4663
+ "content" : {
4664
+ "application/json" : {
4665
+ "schema" : {
4666
+ "$ref" : "#/components/schemas/FileStatusUpdateRequest"
4667
+ }
4668
+ }
4669
+ },
4670
+ "required" : true
4671
+ },
4672
+ "responses" : {
4673
+ "200" : {
4674
+ "content" : {
4675
+ "application/json" : {
4676
+ "schema" : {
4677
+ "$ref" : "#/components/schemas/FileStatus"
4678
+ }
4679
+ }
4680
+ },
4681
+ "description" : "Image status updated successfully"
4682
+ },
4683
+ "401" : {
4684
+ "description" : "Unauthorized"
4685
+ },
4686
+ "403" : {
4687
+ "description" : "Forbidden - User doesn't have access to this knowledge base"
4688
+ },
4689
+ "404" : {
4690
+ "description" : "Knowledge base or image not found or status not found"
4691
+ },
4692
+ "500" : {
4693
+ "description" : "Server error"
4694
+ }
4695
+ },
4696
+ "summary" : "Update the status of a specific knowledge image in a library image in knowledge base",
4697
+ "tags" : [ "knowledge" ]
4698
+ }
4699
+ },
4505
4700
  "/tools" : {
4506
4701
  "post" : {
4507
4702
  "description" : "Creates a tool in an organization (admin only)",
@@ -5435,6 +5630,16 @@
5435
5630
  "type" : "string"
5436
5631
  }
5437
5632
  },
5633
+ "imageIdPath" : {
5634
+ "description" : "ID of the image to delete",
5635
+ "in" : "path",
5636
+ "name" : "imageId",
5637
+ "required" : true,
5638
+ "schema" : {
5639
+ "format" : "uuid",
5640
+ "type" : "string"
5641
+ }
5642
+ },
5438
5643
  "dry" : {
5439
5644
  "description" : "If true, returns a mock transcription without processing the file",
5440
5645
  "in" : "query",
@@ -5471,6 +5676,41 @@
5471
5676
  }
5472
5677
  },
5473
5678
  "schemas" : {
5679
+ "ImageKnowledge" : {
5680
+ "properties" : {
5681
+ "id" : {
5682
+ "type" : "string"
5683
+ },
5684
+ "knowledgeBaseId" : {
5685
+ "type" : "string"
5686
+ },
5687
+ "name" : {
5688
+ "type" : "string"
5689
+ },
5690
+ "contentType" : {
5691
+ "type" : "string"
5692
+ },
5693
+ "ext" : {
5694
+ "type" : "string"
5695
+ },
5696
+ "size" : {
5697
+ "type" : "number"
5698
+ },
5699
+ "key" : {
5700
+ "type" : "string"
5701
+ },
5702
+ "createdAt" : {
5703
+ "type" : "string"
5704
+ },
5705
+ "updatedAt" : {
5706
+ "type" : "string"
5707
+ },
5708
+ "url" : {
5709
+ "type" : "string"
5710
+ }
5711
+ },
5712
+ "type" : "object"
5713
+ },
5474
5714
  "KnowledgeBase" : {
5475
5715
  "properties" : {
5476
5716
  "id" : {
@@ -7846,6 +8086,10 @@
7846
8086
  "required" : [ "status" ],
7847
8087
  "type" : "object"
7848
8088
  },
8089
+ "FileStatus" : {
8090
+ "enum" : [ "SCRAPING", "PENDING", "UPLOADED", "INDEXED" ],
8091
+ "type" : "string"
8092
+ },
7849
8093
  "ToolCreateRequest" : {
7850
8094
  "additionalProperties" : false,
7851
8095
  "properties" : {
@@ -8077,6 +8321,13 @@
8077
8321
  },
8078
8322
  "input" : {
8079
8323
  "$ref" : "#/components/schemas/Input"
8324
+ },
8325
+ "toolsUsed" : {
8326
+ "items" : {
8327
+ "$ref" : "#/components/schemas/ToolUsed"
8328
+ },
8329
+ "nullable" : true,
8330
+ "type" : "array"
8080
8331
  }
8081
8332
  },
8082
8333
  "required" : [ "conversationId", "input", "messageId", "text" ],
@@ -8094,6 +8345,28 @@
8094
8345
  "required" : [ "id", "message" ],
8095
8346
  "type" : "object"
8096
8347
  },
8348
+ "ToolUsed" : {
8349
+ "properties" : {
8350
+ "name" : {
8351
+ "type" : "string"
8352
+ },
8353
+ "params" : {
8354
+ "additionalProperties" : true,
8355
+ "nullable" : true,
8356
+ "type" : "object"
8357
+ },
8358
+ "askConfirmation" : {
8359
+ "nullable" : true,
8360
+ "type" : "boolean"
8361
+ },
8362
+ "confirmationLink" : {
8363
+ "nullable" : true,
8364
+ "type" : "string"
8365
+ }
8366
+ },
8367
+ "required" : [ "name" ],
8368
+ "type" : "object"
8369
+ },
8097
8370
  "Conversation" : {
8098
8371
  "properties" : {
8099
8372
  "id" : {
@@ -8150,10 +8423,6 @@
8150
8423
  "enum" : [ "TOKENS", "CURRENCY", "MILLISECONDS", "CHARACTERS" ],
8151
8424
  "type" : "string"
8152
8425
  },
8153
- "FileStatus" : {
8154
- "enum" : [ "SCRAPING", "PENDING", "UPLOADED", "INDEXED" ],
8155
- "type" : "string"
8156
- },
8157
8426
  "ChatMessageRole" : {
8158
8427
  "enum" : [ "USER", "ASSISTANT", "SYSTEM" ],
8159
8428
  "type" : "string"
@@ -8299,6 +8568,17 @@
8299
8568
  },
8300
8569
  "type" : "object"
8301
8570
  },
8571
+ "uploadImageToKnowledgeBaseLibrary_request" : {
8572
+ "properties" : {
8573
+ "image" : {
8574
+ "description" : "The image to upload",
8575
+ "format" : "binary",
8576
+ "type" : "string"
8577
+ }
8578
+ },
8579
+ "required" : [ "image" ],
8580
+ "type" : "object"
8581
+ },
8302
8582
  "KnowledgeBase_files_inner" : {
8303
8583
  "properties" : {
8304
8584
  "id" : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/client",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",