@breign/client 1.0.27 → 1.0.29

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.
@@ -11,10 +11,20 @@
11
11
  */
12
12
  import * as runtime from '../runtime';
13
13
  import type { AttachmentCreateRequestUio, BodyWithMessageUio, ContextUio, FileAttachmentUio } from '../models/index';
14
+ export interface CreateCustomVariableRequest {
15
+ conversationId: string;
16
+ requestBody: {
17
+ [key: string]: string;
18
+ };
19
+ }
14
20
  export interface DeleteAttachmentRequest {
15
21
  conversationId: string;
16
22
  attachmentId: string;
17
23
  }
24
+ export interface DeleteContextCustomVariableKeyRequest {
25
+ conversationId: string;
26
+ key: string;
27
+ }
18
28
  export interface GetAttachmentRequest {
19
29
  conversationId: string;
20
30
  attachmentId: string;
@@ -22,6 +32,9 @@ export interface GetAttachmentRequest {
22
32
  export interface GetContextRequest {
23
33
  conversationId: string;
24
34
  }
35
+ export interface GetContextCustomVariableRequest {
36
+ conversationId: string;
37
+ }
25
38
  export interface UpdateAttachmentStatusRequest {
26
39
  conversationId: string;
27
40
  attachmentId: string;
@@ -34,6 +47,18 @@ export interface UploadAttachmentRequest {
34
47
  *
35
48
  */
36
49
  export declare class ConversationsApi extends runtime.BaseAPI {
50
+ /**
51
+ * Create a custom variable in the context of a specific conversation by its ID.
52
+ * Create a custom variable in the context of a conversation
53
+ */
54
+ createCustomVariableRaw(requestParameters: CreateCustomVariableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
55
+ /**
56
+ * Create a custom variable in the context of a specific conversation by its ID.
57
+ * Create a custom variable in the context of a conversation
58
+ */
59
+ createCustomVariable(conversationId: string, requestBody: {
60
+ [key: string]: string;
61
+ }, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
37
62
  /**
38
63
  * Remove a specific attachment by its ID from the context of a conversation.
39
64
  * Delete an attachment from a conversation context
@@ -44,6 +69,16 @@ export declare class ConversationsApi extends runtime.BaseAPI {
44
69
  * Delete an attachment from a conversation context
45
70
  */
46
71
  deleteAttachment(conversationId: string, attachmentId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
72
+ /**
73
+ * Delete a custom variable key from the context of a specific conversation by its ID.
74
+ * Delete a custom variable key from the context of a conversation
75
+ */
76
+ deleteContextCustomVariableKeyRaw(requestParameters: DeleteContextCustomVariableKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
77
+ /**
78
+ * Delete a custom variable key from the context of a specific conversation by its ID.
79
+ * Delete a custom variable key from the context of a conversation
80
+ */
81
+ deleteContextCustomVariableKey(conversationId: string, key: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
47
82
  /**
48
83
  * Get a specific attachment by its ID from the context of a conversation.
49
84
  * Retrieve an attachment from a conversation context
@@ -64,6 +99,20 @@ export declare class ConversationsApi extends runtime.BaseAPI {
64
99
  * Get the context of a conversation
65
100
  */
66
101
  getContext(conversationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ContextUio>;
102
+ /**
103
+ * Get a custom variable from the context of a specific conversation by its ID.
104
+ * Get a custom variable from the context of a conversation
105
+ */
106
+ getContextCustomVariableRaw(requestParameters: GetContextCustomVariableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{
107
+ [key: string]: string;
108
+ }>>;
109
+ /**
110
+ * Get a custom variable from the context of a specific conversation by its ID.
111
+ * Get a custom variable from the context of a conversation
112
+ */
113
+ getContextCustomVariable(conversationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{
114
+ [key: string]: string;
115
+ }>;
67
116
  /**
68
117
  * Change the status of an attachment to \'PROCESSING\' after it has been uploaded.
69
118
  * Update the status of an uploaded attachment
@@ -53,6 +53,39 @@ const index_1 = require("../models/index");
53
53
  *
54
54
  */
55
55
  class ConversationsApi extends runtime.BaseAPI {
56
+ /**
57
+ * Create a custom variable in the context of a specific conversation by its ID.
58
+ * Create a custom variable in the context of a conversation
59
+ */
60
+ async createCustomVariableRaw(requestParameters, initOverrides) {
61
+ if (requestParameters['conversationId'] == null) {
62
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling createCustomVariable().');
63
+ }
64
+ if (requestParameters['requestBody'] == null) {
65
+ throw new runtime.RequiredError('requestBody', 'Required parameter "requestBody" was null or undefined when calling createCustomVariable().');
66
+ }
67
+ const queryParameters = {};
68
+ const headerParameters = {};
69
+ headerParameters['Content-Type'] = 'application/json';
70
+ if (this.configuration && this.configuration.apiKey) {
71
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
72
+ }
73
+ const response = await this.request({
74
+ path: `/conversations/{conversationId}/context/custom`.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId']))),
75
+ method: 'POST',
76
+ headers: headerParameters,
77
+ query: queryParameters,
78
+ body: requestParameters['requestBody'],
79
+ }, initOverrides);
80
+ return new runtime.VoidApiResponse(response);
81
+ }
82
+ /**
83
+ * Create a custom variable in the context of a specific conversation by its ID.
84
+ * Create a custom variable in the context of a conversation
85
+ */
86
+ async createCustomVariable(conversationId, requestBody, initOverrides) {
87
+ await this.createCustomVariableRaw({ conversationId: conversationId, requestBody: requestBody }, initOverrides);
88
+ }
56
89
  /**
57
90
  * Remove a specific attachment by its ID from the context of a conversation.
58
91
  * Delete an attachment from a conversation context
@@ -84,6 +117,37 @@ class ConversationsApi extends runtime.BaseAPI {
84
117
  async deleteAttachment(conversationId, attachmentId, initOverrides) {
85
118
  await this.deleteAttachmentRaw({ conversationId: conversationId, attachmentId: attachmentId }, initOverrides);
86
119
  }
120
+ /**
121
+ * Delete a custom variable key from the context of a specific conversation by its ID.
122
+ * Delete a custom variable key from the context of a conversation
123
+ */
124
+ async deleteContextCustomVariableKeyRaw(requestParameters, initOverrides) {
125
+ if (requestParameters['conversationId'] == null) {
126
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling deleteContextCustomVariableKey().');
127
+ }
128
+ if (requestParameters['key'] == null) {
129
+ throw new runtime.RequiredError('key', 'Required parameter "key" was null or undefined when calling deleteContextCustomVariableKey().');
130
+ }
131
+ const queryParameters = {};
132
+ const headerParameters = {};
133
+ if (this.configuration && this.configuration.apiKey) {
134
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
135
+ }
136
+ const response = await this.request({
137
+ path: `/conversations/{conversationId}/context/custom/{key}`.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId']))).replace(`{${"key"}}`, encodeURIComponent(String(requestParameters['key']))),
138
+ method: 'DELETE',
139
+ headers: headerParameters,
140
+ query: queryParameters,
141
+ }, initOverrides);
142
+ return new runtime.VoidApiResponse(response);
143
+ }
144
+ /**
145
+ * Delete a custom variable key from the context of a specific conversation by its ID.
146
+ * Delete a custom variable key from the context of a conversation
147
+ */
148
+ async deleteContextCustomVariableKey(conversationId, key, initOverrides) {
149
+ await this.deleteContextCustomVariableKeyRaw({ conversationId: conversationId, key: key }, initOverrides);
150
+ }
87
151
  /**
88
152
  * Get a specific attachment by its ID from the context of a conversation.
89
153
  * Retrieve an attachment from a conversation context
@@ -145,6 +209,35 @@ class ConversationsApi extends runtime.BaseAPI {
145
209
  const response = await this.getContextRaw({ conversationId: conversationId }, initOverrides);
146
210
  return await response.value();
147
211
  }
212
+ /**
213
+ * Get a custom variable from the context of a specific conversation by its ID.
214
+ * Get a custom variable from the context of a conversation
215
+ */
216
+ async getContextCustomVariableRaw(requestParameters, initOverrides) {
217
+ if (requestParameters['conversationId'] == null) {
218
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling getContextCustomVariable().');
219
+ }
220
+ const queryParameters = {};
221
+ const headerParameters = {};
222
+ if (this.configuration && this.configuration.apiKey) {
223
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
224
+ }
225
+ const response = await this.request({
226
+ path: `/conversations/{conversationId}/context/custom`.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId']))),
227
+ method: 'GET',
228
+ headers: headerParameters,
229
+ query: queryParameters,
230
+ }, initOverrides);
231
+ return new runtime.JSONApiResponse(response);
232
+ }
233
+ /**
234
+ * Get a custom variable from the context of a specific conversation by its ID.
235
+ * Get a custom variable from the context of a conversation
236
+ */
237
+ async getContextCustomVariable(conversationId, initOverrides) {
238
+ const response = await this.getContextCustomVariableRaw({ conversationId: conversationId }, initOverrides);
239
+ return await response.value();
240
+ }
148
241
  /**
149
242
  * Change the status of an attachment to \'PROCESSING\' after it has been uploaded.
150
243
  * Update the status of an uploaded attachment
@@ -0,0 +1,38 @@
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 ChatContextLocationUio
16
+ */
17
+ export interface ChatContextLocationUio {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ChatContextLocationUio
22
+ */
23
+ latitude: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof ChatContextLocationUio
28
+ */
29
+ longitude: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the ChatContextLocationUio interface.
33
+ */
34
+ export declare function instanceOfChatContextLocationUio(value: object): value is ChatContextLocationUio;
35
+ export declare function ChatContextLocationUioFromJSON(json: any): ChatContextLocationUio;
36
+ export declare function ChatContextLocationUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatContextLocationUio;
37
+ export declare function ChatContextLocationUioToJSON(json: any): ChatContextLocationUio;
38
+ export declare function ChatContextLocationUioToJSONTyped(value?: ChatContextLocationUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,54 @@
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.instanceOfChatContextLocationUio = instanceOfChatContextLocationUio;
17
+ exports.ChatContextLocationUioFromJSON = ChatContextLocationUioFromJSON;
18
+ exports.ChatContextLocationUioFromJSONTyped = ChatContextLocationUioFromJSONTyped;
19
+ exports.ChatContextLocationUioToJSON = ChatContextLocationUioToJSON;
20
+ exports.ChatContextLocationUioToJSONTyped = ChatContextLocationUioToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the ChatContextLocationUio interface.
23
+ */
24
+ function instanceOfChatContextLocationUio(value) {
25
+ if (!('latitude' in value) || value['latitude'] === undefined)
26
+ return false;
27
+ if (!('longitude' in value) || value['longitude'] === undefined)
28
+ return false;
29
+ return true;
30
+ }
31
+ function ChatContextLocationUioFromJSON(json) {
32
+ return ChatContextLocationUioFromJSONTyped(json, false);
33
+ }
34
+ function ChatContextLocationUioFromJSONTyped(json, ignoreDiscriminator) {
35
+ if (json == null) {
36
+ return json;
37
+ }
38
+ return {
39
+ 'latitude': json['latitude'],
40
+ 'longitude': json['longitude'],
41
+ };
42
+ }
43
+ function ChatContextLocationUioToJSON(json) {
44
+ return ChatContextLocationUioToJSONTyped(json, false);
45
+ }
46
+ function ChatContextLocationUioToJSONTyped(value, ignoreDiscriminator = false) {
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'latitude': value['latitude'],
52
+ 'longitude': value['longitude'],
53
+ };
54
+ }
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { ChatContextLocationUio } from './ChatContextLocationUio';
12
13
  import type { FileAttachmentUio } from './FileAttachmentUio';
13
14
  /**
14
15
  *
@@ -22,6 +23,20 @@ export interface ChatContextUio {
22
23
  * @memberof ChatContextUio
23
24
  */
24
25
  attachments: Array<FileAttachmentUio>;
26
+ /**
27
+ *
28
+ * @type {ChatContextLocationUio}
29
+ * @memberof ChatContextUio
30
+ */
31
+ location?: ChatContextLocationUio;
32
+ /**
33
+ *
34
+ * @type {{ [key: string]: any; }}
35
+ * @memberof ChatContextUio
36
+ */
37
+ custom?: {
38
+ [key: string]: any;
39
+ };
25
40
  /**
26
41
  *
27
42
  * @type {string}
@@ -18,6 +18,7 @@ exports.ChatContextUioFromJSON = ChatContextUioFromJSON;
18
18
  exports.ChatContextUioFromJSONTyped = ChatContextUioFromJSONTyped;
19
19
  exports.ChatContextUioToJSON = ChatContextUioToJSON;
20
20
  exports.ChatContextUioToJSONTyped = ChatContextUioToJSONTyped;
21
+ const ChatContextLocationUio_1 = require("./ChatContextLocationUio");
21
22
  const FileAttachmentUio_1 = require("./FileAttachmentUio");
22
23
  /**
23
24
  * Check if a given object implements the ChatContextUio interface.
@@ -36,6 +37,8 @@ function ChatContextUioFromJSONTyped(json, ignoreDiscriminator) {
36
37
  }
37
38
  return {
38
39
  'attachments': (json['attachments'].map(FileAttachmentUio_1.FileAttachmentUioFromJSON)),
40
+ 'location': json['location'] == null ? undefined : (0, ChatContextLocationUio_1.ChatContextLocationUioFromJSON)(json['location']),
41
+ 'custom': json['custom'] == null ? undefined : json['custom'],
39
42
  'openaiThreadId': json['openaiThreadId'] == null ? undefined : json['openaiThreadId'],
40
43
  };
41
44
  }
@@ -48,6 +51,8 @@ function ChatContextUioToJSONTyped(value, ignoreDiscriminator = false) {
48
51
  }
49
52
  return {
50
53
  'attachments': (value['attachments'].map(FileAttachmentUio_1.FileAttachmentUioToJSON)),
54
+ 'location': (0, ChatContextLocationUio_1.ChatContextLocationUioToJSON)(value['location']),
55
+ 'custom': value['custom'],
51
56
  'openaiThreadId': value['openaiThreadId'],
52
57
  };
53
58
  }
@@ -55,6 +55,7 @@ export * from './AuthCodeResponseUio';
55
55
  export * from './AuthTypeUio';
56
56
  export * from './BodyWithIdUio';
57
57
  export * from './BodyWithMessageUio';
58
+ export * from './ChatContextLocationUio';
58
59
  export * from './ChatContextUio';
59
60
  export * from './ChatMessageAudioInnerUio';
60
61
  export * from './ChatMessageRoleUio';
@@ -73,6 +73,7 @@ __exportStar(require("./AuthCodeResponseUio"), exports);
73
73
  __exportStar(require("./AuthTypeUio"), exports);
74
74
  __exportStar(require("./BodyWithIdUio"), exports);
75
75
  __exportStar(require("./BodyWithMessageUio"), exports);
76
+ __exportStar(require("./ChatContextLocationUio"), exports);
76
77
  __exportStar(require("./ChatContextUio"), exports);
77
78
  __exportStar(require("./ChatMessageAudioInnerUio"), exports);
78
79
  __exportStar(require("./ChatMessageRoleUio"), exports);
package/dist/openapi.json CHANGED
@@ -2638,6 +2638,137 @@
2638
2638
  "tags" : [ "contents" ]
2639
2639
  }
2640
2640
  },
2641
+ "/conversations/{conversationId}/context/custom/{key}" : {
2642
+ "delete" : {
2643
+ "description" : "Delete a custom variable key from the context of a specific conversation by its ID.",
2644
+ "operationId" : "deleteContextCustomVariableKey",
2645
+ "parameters" : [ {
2646
+ "description" : "The ID of the conversation",
2647
+ "in" : "path",
2648
+ "name" : "conversationId",
2649
+ "required" : true,
2650
+ "schema" : {
2651
+ "type" : "string"
2652
+ }
2653
+ }, {
2654
+ "description" : "Key of the custom variable to delete",
2655
+ "in" : "path",
2656
+ "name" : "key",
2657
+ "required" : true,
2658
+ "schema" : {
2659
+ "type" : "string"
2660
+ }
2661
+ } ],
2662
+ "responses" : {
2663
+ "200" : {
2664
+ "description" : "Successfully deleted the custom variable key from the context of the conversation."
2665
+ },
2666
+ "401" : {
2667
+ "description" : "Unauthorized"
2668
+ },
2669
+ "403" : {
2670
+ "description" : "Forbidden - User cannot access this conversation"
2671
+ },
2672
+ "404" : {
2673
+ "description" : "Conversation or Custom Variable Key not found"
2674
+ },
2675
+ "500" : {
2676
+ "description" : "Server error"
2677
+ }
2678
+ },
2679
+ "summary" : "Delete a custom variable key from the context of a conversation",
2680
+ "tags" : [ "conversations" ]
2681
+ }
2682
+ },
2683
+ "/conversations/{conversationId}/context/custom" : {
2684
+ "get" : {
2685
+ "description" : "Get a custom variable from the context of a specific conversation by its ID.",
2686
+ "operationId" : "getContextCustomVariable",
2687
+ "parameters" : [ {
2688
+ "description" : "The ID of the conversation",
2689
+ "in" : "path",
2690
+ "name" : "conversationId",
2691
+ "required" : true,
2692
+ "schema" : {
2693
+ "type" : "string"
2694
+ }
2695
+ } ],
2696
+ "responses" : {
2697
+ "200" : {
2698
+ "content" : {
2699
+ "application/json" : {
2700
+ "schema" : {
2701
+ "additionalProperties" : {
2702
+ "type" : "string"
2703
+ },
2704
+ "type" : "object"
2705
+ }
2706
+ }
2707
+ },
2708
+ "description" : "Successfully retrieved the custom variable from the context of the conversation."
2709
+ },
2710
+ "401" : {
2711
+ "description" : "Unauthorized"
2712
+ },
2713
+ "403" : {
2714
+ "description" : "Forbidden - User cannot access this conversation"
2715
+ },
2716
+ "404" : {
2717
+ "description" : "Conversation not found"
2718
+ },
2719
+ "500" : {
2720
+ "description" : "Server error"
2721
+ }
2722
+ },
2723
+ "summary" : "Get a custom variable from the context of a conversation",
2724
+ "tags" : [ "conversations" ]
2725
+ },
2726
+ "post" : {
2727
+ "description" : "Create a custom variable in the context of a specific conversation by its ID.",
2728
+ "operationId" : "createCustomVariable",
2729
+ "parameters" : [ {
2730
+ "description" : "The ID of the conversation",
2731
+ "in" : "path",
2732
+ "name" : "conversationId",
2733
+ "required" : true,
2734
+ "schema" : {
2735
+ "type" : "string"
2736
+ }
2737
+ } ],
2738
+ "requestBody" : {
2739
+ "content" : {
2740
+ "application/json" : {
2741
+ "schema" : {
2742
+ "additionalProperties" : {
2743
+ "type" : "string"
2744
+ },
2745
+ "type" : "object"
2746
+ }
2747
+ }
2748
+ },
2749
+ "required" : true
2750
+ },
2751
+ "responses" : {
2752
+ "200" : {
2753
+ "description" : "Successfully created the custom variable in the context of the conversation."
2754
+ },
2755
+ "401" : {
2756
+ "description" : "Unauthorized"
2757
+ },
2758
+ "403" : {
2759
+ "description" : "Forbidden - User cannot access this conversation"
2760
+ },
2761
+ "404" : {
2762
+ "description" : "Conversation not found"
2763
+ },
2764
+ "500" : {
2765
+ "description" : "Server error"
2766
+ }
2767
+ },
2768
+ "summary" : "Create a custom variable in the context of a conversation",
2769
+ "tags" : [ "conversations" ]
2770
+ }
2771
+ },
2641
2772
  "/conversations/{conversationId}/context" : {
2642
2773
  "get" : {
2643
2774
  "description" : "Retrieve the context of a specific conversation by its ID.",
@@ -6860,6 +6991,13 @@
6860
6991
  },
6861
6992
  "type" : "array"
6862
6993
  },
6994
+ "location" : {
6995
+ "$ref" : "#/components/schemas/ChatContext_location"
6996
+ },
6997
+ "custom" : {
6998
+ "additionalProperties" : true,
6999
+ "type" : "object"
7000
+ },
6863
7001
  "openaiThreadId" : {
6864
7002
  "type" : "string"
6865
7003
  }
@@ -8740,6 +8878,18 @@
8740
8878
  "$ref" : "#/components/schemas/FileAttachment_processed_oneOf_1"
8741
8879
  } ]
8742
8880
  },
8881
+ "ChatContext_location" : {
8882
+ "properties" : {
8883
+ "latitude" : {
8884
+ "type" : "string"
8885
+ },
8886
+ "longitude" : {
8887
+ "type" : "string"
8888
+ }
8889
+ },
8890
+ "required" : [ "latitude", "longitude" ],
8891
+ "type" : "object"
8892
+ },
8743
8893
  "App_sequences_inner" : {
8744
8894
  "properties" : {
8745
8895
  "id" : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/client",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",