@l7mp/tivadar-ai-api-sdk 0.2.1 → 0.2.3

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.
@@ -92,6 +92,7 @@ export declare class Api {
92
92
  upload: (organizationId: string, ragConfigName: string, file: File, sourceUrl?: string, metadata?: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsPost"]>;
93
93
  list: (organizationId: string, ragConfigName: string, status?: OrganizationsOrganizationIdRagRagConfigNameDocumentsGetStatusEnum, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsGet"]>;
94
94
  get: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet"]>;
95
+ download: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet"]>;
95
96
  replace: (organizationId: string, ragConfigName: string, documentId: string, file: File, sourceUrl?: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPut"]>;
96
97
  delete: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdDelete"]>;
97
98
  };
@@ -137,6 +137,7 @@ class Api {
137
137
  upload: (organizationId, ragConfigName, file, sourceUrl, metadata, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsPost({ organizationId, ragConfigName, file, sourceUrl, metadata }, options),
138
138
  list: (organizationId, ragConfigName, status, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsGet({ organizationId, ragConfigName, status }, options),
139
139
  get: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet({ organizationId, ragConfigName, documentId }, options),
140
+ download: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet({ organizationId, ragConfigName, documentId }, options),
140
141
  replace: (organizationId, ragConfigName, documentId, file, sourceUrl, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPut({ organizationId, ragConfigName, documentId, file, sourceUrl }, options),
141
142
  delete: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdDelete({ organizationId, ragConfigName, documentId }, options),
142
143
  },
@@ -32,6 +32,11 @@ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdG
32
32
  ragConfigName: string;
33
33
  documentId: string;
34
34
  }
35
+ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest {
36
+ organizationId: string;
37
+ ragConfigName: string;
38
+ documentId: string;
39
+ }
35
40
  export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPutRequest {
36
41
  organizationId: string;
37
42
  ragConfigName: string;
@@ -95,6 +100,14 @@ export declare class RAGApi extends runtime.BaseAPI {
95
100
  * Get document chunks
96
101
  */
97
102
  organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet(requestParameters: OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RagDocumentChunkList>;
103
+ /**
104
+ * Download original document file
105
+ */
106
+ organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRaw(requestParameters: OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
107
+ /**
108
+ * Download original document file
109
+ */
110
+ organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet(requestParameters: OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
98
111
  /**
99
112
  * Replace a document in a RAG configuration
100
113
  */
@@ -237,6 +237,51 @@ class RAGApi extends runtime.BaseAPI {
237
237
  return yield response.value();
238
238
  });
239
239
  }
240
+ /**
241
+ * Download original document file
242
+ */
243
+ organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRaw(requestParameters, initOverrides) {
244
+ return __awaiter(this, void 0, void 0, function* () {
245
+ if (requestParameters['organizationId'] == null) {
246
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet().');
247
+ }
248
+ if (requestParameters['ragConfigName'] == null) {
249
+ throw new runtime.RequiredError('ragConfigName', 'Required parameter "ragConfigName" was null or undefined when calling organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet().');
250
+ }
251
+ if (requestParameters['documentId'] == null) {
252
+ throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet().');
253
+ }
254
+ const queryParameters = {};
255
+ const headerParameters = {};
256
+ if (this.configuration && this.configuration.accessToken) {
257
+ const token = this.configuration.accessToken;
258
+ const tokenString = yield token("bearerAuth", []);
259
+ if (tokenString) {
260
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
261
+ }
262
+ }
263
+ let urlPath = `/organizations/{organizationId}/rag/{ragConfigName}/documents/{documentId}/file`;
264
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
265
+ urlPath = urlPath.replace(`{${"ragConfigName"}}`, encodeURIComponent(String(requestParameters['ragConfigName'])));
266
+ urlPath = urlPath.replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters['documentId'])));
267
+ const response = yield this.request({
268
+ path: urlPath,
269
+ method: 'GET',
270
+ headers: headerParameters,
271
+ query: queryParameters,
272
+ }, initOverrides);
273
+ return new runtime.BlobApiResponse(response);
274
+ });
275
+ }
276
+ /**
277
+ * Download original document file
278
+ */
279
+ organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet(requestParameters, initOverrides) {
280
+ return __awaiter(this, void 0, void 0, function* () {
281
+ const response = yield this.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRaw(requestParameters, initOverrides);
282
+ return yield response.value();
283
+ });
284
+ }
240
285
  /**
241
286
  * Replace a document in a RAG configuration
242
287
  */
@@ -92,6 +92,7 @@ export declare class Api {
92
92
  upload: (organizationId: string, ragConfigName: string, file: File, sourceUrl?: string, metadata?: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsPost"]>;
93
93
  list: (organizationId: string, ragConfigName: string, status?: OrganizationsOrganizationIdRagRagConfigNameDocumentsGetStatusEnum, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsGet"]>;
94
94
  get: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet"]>;
95
+ download: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet"]>;
95
96
  replace: (organizationId: string, ragConfigName: string, documentId: string, file: File, sourceUrl?: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPut"]>;
96
97
  delete: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdDelete"]>;
97
98
  };
@@ -134,6 +134,7 @@ export class Api {
134
134
  upload: (organizationId, ragConfigName, file, sourceUrl, metadata, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsPost({ organizationId, ragConfigName, file, sourceUrl, metadata }, options),
135
135
  list: (organizationId, ragConfigName, status, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsGet({ organizationId, ragConfigName, status }, options),
136
136
  get: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet({ organizationId, ragConfigName, documentId }, options),
137
+ download: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet({ organizationId, ragConfigName, documentId }, options),
137
138
  replace: (organizationId, ragConfigName, documentId, file, sourceUrl, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPut({ organizationId, ragConfigName, documentId, file, sourceUrl }, options),
138
139
  delete: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdDelete({ organizationId, ragConfigName, documentId }, options),
139
140
  },
@@ -32,6 +32,11 @@ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdG
32
32
  ragConfigName: string;
33
33
  documentId: string;
34
34
  }
35
+ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest {
36
+ organizationId: string;
37
+ ragConfigName: string;
38
+ documentId: string;
39
+ }
35
40
  export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPutRequest {
36
41
  organizationId: string;
37
42
  ragConfigName: string;
@@ -95,6 +100,14 @@ export declare class RAGApi extends runtime.BaseAPI {
95
100
  * Get document chunks
96
101
  */
97
102
  organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet(requestParameters: OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RagDocumentChunkList>;
103
+ /**
104
+ * Download original document file
105
+ */
106
+ organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRaw(requestParameters: OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
107
+ /**
108
+ * Download original document file
109
+ */
110
+ organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet(requestParameters: OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
98
111
  /**
99
112
  * Replace a document in a RAG configuration
100
113
  */
@@ -234,6 +234,51 @@ export class RAGApi extends runtime.BaseAPI {
234
234
  return yield response.value();
235
235
  });
236
236
  }
237
+ /**
238
+ * Download original document file
239
+ */
240
+ organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRaw(requestParameters, initOverrides) {
241
+ return __awaiter(this, void 0, void 0, function* () {
242
+ if (requestParameters['organizationId'] == null) {
243
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet().');
244
+ }
245
+ if (requestParameters['ragConfigName'] == null) {
246
+ throw new runtime.RequiredError('ragConfigName', 'Required parameter "ragConfigName" was null or undefined when calling organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet().');
247
+ }
248
+ if (requestParameters['documentId'] == null) {
249
+ throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet().');
250
+ }
251
+ const queryParameters = {};
252
+ const headerParameters = {};
253
+ if (this.configuration && this.configuration.accessToken) {
254
+ const token = this.configuration.accessToken;
255
+ const tokenString = yield token("bearerAuth", []);
256
+ if (tokenString) {
257
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
258
+ }
259
+ }
260
+ let urlPath = `/organizations/{organizationId}/rag/{ragConfigName}/documents/{documentId}/file`;
261
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
262
+ urlPath = urlPath.replace(`{${"ragConfigName"}}`, encodeURIComponent(String(requestParameters['ragConfigName'])));
263
+ urlPath = urlPath.replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters['documentId'])));
264
+ const response = yield this.request({
265
+ path: urlPath,
266
+ method: 'GET',
267
+ headers: headerParameters,
268
+ query: queryParameters,
269
+ }, initOverrides);
270
+ return new runtime.BlobApiResponse(response);
271
+ });
272
+ }
273
+ /**
274
+ * Download original document file
275
+ */
276
+ organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet(requestParameters, initOverrides) {
277
+ return __awaiter(this, void 0, void 0, function* () {
278
+ const response = yield this.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRaw(requestParameters, initOverrides);
279
+ return yield response.value();
280
+ });
281
+ }
237
282
  /**
238
283
  * Replace a document in a RAG configuration
239
284
  */
@@ -35,6 +35,14 @@ export interface Call {
35
35
  data?: {
36
36
  [key: string]: any;
37
37
  } | null;
38
+ /**
39
+ *
40
+ * @type {{ [key: string]: any; }}
41
+ * @memberof Call
42
+ */
43
+ metadata?: {
44
+ [key: string]: any;
45
+ } | null;
38
46
  /**
39
47
  *
40
48
  * @type {string}
@@ -32,6 +32,7 @@ export function CallFromJSONTyped(json, ignoreDiscriminator) {
32
32
  'id': json['id'],
33
33
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
34
34
  'data': json['data'] == null ? undefined : json['data'],
35
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
35
36
  'caller': json['caller'] == null ? undefined : json['caller'],
36
37
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
37
38
  'created_at': (new Date(json['created_at'])),
@@ -48,6 +49,7 @@ export function CallToJSONTyped(value, ignoreDiscriminator = false) {
48
49
  'id': value['id'],
49
50
  'voice_agent_id': value['voice_agent_id'],
50
51
  'data': value['data'],
52
+ 'metadata': value['metadata'],
51
53
  'caller': value['caller'],
52
54
  'sandbox': value['sandbox'],
53
55
  'created_at': value['created_at'].toISOString(),
@@ -29,6 +29,14 @@ export interface CallCreate {
29
29
  data?: {
30
30
  [key: string]: any;
31
31
  } | null;
32
+ /**
33
+ *
34
+ * @type {{ [key: string]: any; }}
35
+ * @memberof CallCreate
36
+ */
37
+ metadata?: {
38
+ [key: string]: any;
39
+ } | null;
32
40
  /**
33
41
  *
34
42
  * @type {string}
@@ -27,6 +27,7 @@ export function CallCreateFromJSONTyped(json, ignoreDiscriminator) {
27
27
  return {
28
28
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
29
29
  'data': json['data'] == null ? undefined : json['data'],
30
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
30
31
  'caller': json['caller'] == null ? undefined : json['caller'],
31
32
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
32
33
  };
@@ -41,6 +42,7 @@ export function CallCreateToJSONTyped(value, ignoreDiscriminator = false) {
41
42
  return {
42
43
  'voice_agent_id': value['voice_agent_id'],
43
44
  'data': value['data'],
45
+ 'metadata': value['metadata'],
44
46
  'caller': value['caller'],
45
47
  'sandbox': value['sandbox'],
46
48
  };
@@ -29,6 +29,14 @@ export interface CallUpdate {
29
29
  data?: {
30
30
  [key: string]: any;
31
31
  } | null;
32
+ /**
33
+ *
34
+ * @type {{ [key: string]: any; }}
35
+ * @memberof CallUpdate
36
+ */
37
+ metadata?: {
38
+ [key: string]: any;
39
+ } | null;
32
40
  /**
33
41
  *
34
42
  * @type {string}
@@ -27,6 +27,7 @@ export function CallUpdateFromJSONTyped(json, ignoreDiscriminator) {
27
27
  return {
28
28
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
29
29
  'data': json['data'] == null ? undefined : json['data'],
30
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
30
31
  'caller': json['caller'] == null ? undefined : json['caller'],
31
32
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
32
33
  };
@@ -41,6 +42,7 @@ export function CallUpdateToJSONTyped(value, ignoreDiscriminator = false) {
41
42
  return {
42
43
  'voice_agent_id': value['voice_agent_id'],
43
44
  'data': value['data'],
45
+ 'metadata': value['metadata'],
44
46
  'caller': value['caller'],
45
47
  'sandbox': value['sandbox'],
46
48
  };
@@ -35,6 +35,14 @@ export interface Call {
35
35
  data?: {
36
36
  [key: string]: any;
37
37
  } | null;
38
+ /**
39
+ *
40
+ * @type {{ [key: string]: any; }}
41
+ * @memberof Call
42
+ */
43
+ metadata?: {
44
+ [key: string]: any;
45
+ } | null;
38
46
  /**
39
47
  *
40
48
  * @type {string}
@@ -39,6 +39,7 @@ function CallFromJSONTyped(json, ignoreDiscriminator) {
39
39
  'id': json['id'],
40
40
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
41
41
  'data': json['data'] == null ? undefined : json['data'],
42
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
42
43
  'caller': json['caller'] == null ? undefined : json['caller'],
43
44
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
44
45
  'created_at': (new Date(json['created_at'])),
@@ -55,6 +56,7 @@ function CallToJSONTyped(value, ignoreDiscriminator = false) {
55
56
  'id': value['id'],
56
57
  'voice_agent_id': value['voice_agent_id'],
57
58
  'data': value['data'],
59
+ 'metadata': value['metadata'],
58
60
  'caller': value['caller'],
59
61
  'sandbox': value['sandbox'],
60
62
  'created_at': value['created_at'].toISOString(),
@@ -29,6 +29,14 @@ export interface CallCreate {
29
29
  data?: {
30
30
  [key: string]: any;
31
31
  } | null;
32
+ /**
33
+ *
34
+ * @type {{ [key: string]: any; }}
35
+ * @memberof CallCreate
36
+ */
37
+ metadata?: {
38
+ [key: string]: any;
39
+ } | null;
32
40
  /**
33
41
  *
34
42
  * @type {string}
@@ -34,6 +34,7 @@ function CallCreateFromJSONTyped(json, ignoreDiscriminator) {
34
34
  return {
35
35
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
36
36
  'data': json['data'] == null ? undefined : json['data'],
37
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
37
38
  'caller': json['caller'] == null ? undefined : json['caller'],
38
39
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
39
40
  };
@@ -48,6 +49,7 @@ function CallCreateToJSONTyped(value, ignoreDiscriminator = false) {
48
49
  return {
49
50
  'voice_agent_id': value['voice_agent_id'],
50
51
  'data': value['data'],
52
+ 'metadata': value['metadata'],
51
53
  'caller': value['caller'],
52
54
  'sandbox': value['sandbox'],
53
55
  };
@@ -29,6 +29,14 @@ export interface CallUpdate {
29
29
  data?: {
30
30
  [key: string]: any;
31
31
  } | null;
32
+ /**
33
+ *
34
+ * @type {{ [key: string]: any; }}
35
+ * @memberof CallUpdate
36
+ */
37
+ metadata?: {
38
+ [key: string]: any;
39
+ } | null;
32
40
  /**
33
41
  *
34
42
  * @type {string}
@@ -34,6 +34,7 @@ function CallUpdateFromJSONTyped(json, ignoreDiscriminator) {
34
34
  return {
35
35
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
36
36
  'data': json['data'] == null ? undefined : json['data'],
37
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
37
38
  'caller': json['caller'] == null ? undefined : json['caller'],
38
39
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
39
40
  };
@@ -48,6 +49,7 @@ function CallUpdateToJSONTyped(value, ignoreDiscriminator = false) {
48
49
  return {
49
50
  'voice_agent_id': value['voice_agent_id'],
50
51
  'data': value['data'],
52
+ 'metadata': value['metadata'],
51
53
  'caller': value['caller'],
52
54
  'sandbox': value['sandbox'],
53
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@l7mp/tivadar-ai-api-sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "TypeScript/JavaScript SDK for Tivadar AI Backend API",
5
5
  "author": "L7mp Technologies",
6
6
  "repository": {
package/src/api-client.ts CHANGED
@@ -125,6 +125,7 @@ export class Api {
125
125
  upload: (organizationId: string, ragConfigName: string, file: File, sourceUrl?: string, metadata?: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsPost"]>;
126
126
  list: (organizationId: string, ragConfigName: string, status?: OrganizationsOrganizationIdRagRagConfigNameDocumentsGetStatusEnum, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsGet"]>;
127
127
  get: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet"]>;
128
+ download: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet"]>;
128
129
  replace: (organizationId: string, ragConfigName: string, documentId: string, file: File, sourceUrl?: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPut"]>;
129
130
  delete: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdDelete"]>;
130
131
  };
@@ -311,6 +312,7 @@ export class Api {
311
312
  upload: (organizationId, ragConfigName, file, sourceUrl, metadata, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsPost({ organizationId, ragConfigName, file, sourceUrl, metadata }, options),
312
313
  list: (organizationId, ragConfigName, status, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsGet({ organizationId, ragConfigName, status }, options),
313
314
  get: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet({ organizationId, ragConfigName, documentId }, options),
315
+ download: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet({ organizationId, ragConfigName, documentId }, options),
314
316
  replace: (organizationId, ragConfigName, documentId, file, sourceUrl, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPut({ organizationId, ragConfigName, documentId, file, sourceUrl }, options),
315
317
  delete: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdDelete({ organizationId, ragConfigName, documentId }, options),
316
318
  },
@@ -60,6 +60,12 @@ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdG
60
60
  documentId: string;
61
61
  }
62
62
 
63
+ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest {
64
+ organizationId: string;
65
+ ragConfigName: string;
66
+ documentId: string;
67
+ }
68
+
63
69
  export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPutRequest {
64
70
  organizationId: string;
65
71
  ragConfigName: string;
@@ -360,6 +366,67 @@ export class RAGApi extends runtime.BaseAPI {
360
366
  return await response.value();
361
367
  }
362
368
 
369
+ /**
370
+ * Download original document file
371
+ */
372
+ async organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRaw(requestParameters: OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
373
+ if (requestParameters['organizationId'] == null) {
374
+ throw new runtime.RequiredError(
375
+ 'organizationId',
376
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet().'
377
+ );
378
+ }
379
+
380
+ if (requestParameters['ragConfigName'] == null) {
381
+ throw new runtime.RequiredError(
382
+ 'ragConfigName',
383
+ 'Required parameter "ragConfigName" was null or undefined when calling organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet().'
384
+ );
385
+ }
386
+
387
+ if (requestParameters['documentId'] == null) {
388
+ throw new runtime.RequiredError(
389
+ 'documentId',
390
+ 'Required parameter "documentId" was null or undefined when calling organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet().'
391
+ );
392
+ }
393
+
394
+ const queryParameters: any = {};
395
+
396
+ const headerParameters: runtime.HTTPHeaders = {};
397
+
398
+ if (this.configuration && this.configuration.accessToken) {
399
+ const token = this.configuration.accessToken;
400
+ const tokenString = await token("bearerAuth", []);
401
+
402
+ if (tokenString) {
403
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
404
+ }
405
+ }
406
+
407
+ let urlPath = `/organizations/{organizationId}/rag/{ragConfigName}/documents/{documentId}/file`;
408
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
409
+ urlPath = urlPath.replace(`{${"ragConfigName"}}`, encodeURIComponent(String(requestParameters['ragConfigName'])));
410
+ urlPath = urlPath.replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters['documentId'])));
411
+
412
+ const response = await this.request({
413
+ path: urlPath,
414
+ method: 'GET',
415
+ headers: headerParameters,
416
+ query: queryParameters,
417
+ }, initOverrides);
418
+
419
+ return new runtime.BlobApiResponse(response);
420
+ }
421
+
422
+ /**
423
+ * Download original document file
424
+ */
425
+ async organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet(requestParameters: OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
426
+ const response = await this.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRaw(requestParameters, initOverrides);
427
+ return await response.value();
428
+ }
429
+
363
430
  /**
364
431
  * Replace a document in a RAG configuration
365
432
  */
@@ -37,6 +37,12 @@ export interface Call {
37
37
  * @memberof Call
38
38
  */
39
39
  data?: { [key: string]: any; } | null;
40
+ /**
41
+ *
42
+ * @type {{ [key: string]: any; }}
43
+ * @memberof Call
44
+ */
45
+ metadata?: { [key: string]: any; } | null;
40
46
  /**
41
47
  *
42
48
  * @type {string}
@@ -79,6 +85,7 @@ export function CallFromJSONTyped(json: any, ignoreDiscriminator: boolean): Call
79
85
  'id': json['id'],
80
86
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
81
87
  'data': json['data'] == null ? undefined : json['data'],
88
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
82
89
  'caller': json['caller'] == null ? undefined : json['caller'],
83
90
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
84
91
  'created_at': (new Date(json['created_at'])),
@@ -99,9 +106,9 @@ export function CallToJSONTyped(value?: Call | null, ignoreDiscriminator: boolea
99
106
  'id': value['id'],
100
107
  'voice_agent_id': value['voice_agent_id'],
101
108
  'data': value['data'],
109
+ 'metadata': value['metadata'],
102
110
  'caller': value['caller'],
103
111
  'sandbox': value['sandbox'],
104
112
  'created_at': value['created_at'].toISOString(),
105
113
  };
106
114
  }
107
-
@@ -31,6 +31,12 @@ export interface CallCreate {
31
31
  * @memberof CallCreate
32
32
  */
33
33
  data?: { [key: string]: any; } | null;
34
+ /**
35
+ *
36
+ * @type {{ [key: string]: any; }}
37
+ * @memberof CallCreate
38
+ */
39
+ metadata?: { [key: string]: any; } | null;
34
40
  /**
35
41
  *
36
42
  * @type {string}
@@ -64,6 +70,7 @@ export function CallCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean)
64
70
 
65
71
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
66
72
  'data': json['data'] == null ? undefined : json['data'],
73
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
67
74
  'caller': json['caller'] == null ? undefined : json['caller'],
68
75
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
69
76
  };
@@ -82,8 +89,8 @@ export function CallCreateToJSONTyped(value?: CallCreate | null, ignoreDiscrimin
82
89
 
83
90
  'voice_agent_id': value['voice_agent_id'],
84
91
  'data': value['data'],
92
+ 'metadata': value['metadata'],
85
93
  'caller': value['caller'],
86
94
  'sandbox': value['sandbox'],
87
95
  };
88
96
  }
89
-
@@ -31,6 +31,12 @@ export interface CallUpdate {
31
31
  * @memberof CallUpdate
32
32
  */
33
33
  data?: { [key: string]: any; } | null;
34
+ /**
35
+ *
36
+ * @type {{ [key: string]: any; }}
37
+ * @memberof CallUpdate
38
+ */
39
+ metadata?: { [key: string]: any; } | null;
34
40
  /**
35
41
  *
36
42
  * @type {string}
@@ -64,6 +70,7 @@ export function CallUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean)
64
70
 
65
71
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
66
72
  'data': json['data'] == null ? undefined : json['data'],
73
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
67
74
  'caller': json['caller'] == null ? undefined : json['caller'],
68
75
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
69
76
  };
@@ -82,8 +89,8 @@ export function CallUpdateToJSONTyped(value?: CallUpdate | null, ignoreDiscrimin
82
89
 
83
90
  'voice_agent_id': value['voice_agent_id'],
84
91
  'data': value['data'],
92
+ 'metadata': value['metadata'],
85
93
  'caller': value['caller'],
86
94
  'sandbox': value['sandbox'],
87
95
  };
88
96
  }
89
-