@l7mp/tivadar-ai-api-sdk 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/api-client.d.ts +10 -2
  2. package/dist/api-client.js +9 -1
  3. package/dist/apis/RAGApi.d.ts +15 -13
  4. package/dist/apis/RAGApi.js +47 -45
  5. package/dist/apis/ToolsApi.d.ts +68 -0
  6. package/dist/apis/ToolsApi.js +205 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/api-client.d.ts +10 -2
  10. package/dist/esm/api-client.js +9 -1
  11. package/dist/esm/apis/RAGApi.d.ts +15 -13
  12. package/dist/esm/apis/RAGApi.js +47 -45
  13. package/dist/esm/apis/ToolsApi.d.ts +68 -0
  14. package/dist/esm/apis/ToolsApi.js +201 -0
  15. package/dist/esm/apis/index.d.ts +1 -0
  16. package/dist/esm/apis/index.js +1 -0
  17. package/dist/esm/models/AgentTool.d.ts +79 -0
  18. package/dist/esm/models/AgentTool.js +66 -0
  19. package/dist/esm/models/AgentToolUpsert.d.ts +40 -0
  20. package/dist/esm/models/AgentToolUpsert.js +45 -0
  21. package/dist/esm/models/Notification.d.ts +16 -17
  22. package/dist/esm/models/Notification.js +8 -8
  23. package/dist/esm/models/NotificationCreate.d.ts +3 -4
  24. package/dist/esm/models/NotificationCreate.js +4 -2
  25. package/dist/esm/models/NotificationLocalizedContentValue.d.ts +38 -0
  26. package/dist/esm/models/NotificationLocalizedContentValue.js +47 -0
  27. package/dist/esm/models/NotificationUpdate.d.ts +3 -4
  28. package/dist/esm/models/NotificationUpdate.js +4 -2
  29. package/dist/esm/models/Tool.d.ts +102 -0
  30. package/dist/esm/models/Tool.js +77 -0
  31. package/dist/esm/models/ToolCreate.d.ts +84 -0
  32. package/dist/esm/models/ToolCreate.js +63 -0
  33. package/dist/esm/models/ToolUpdate.d.ts +78 -0
  34. package/dist/esm/models/ToolUpdate.js +55 -0
  35. package/dist/esm/models/UserPreferences.d.ts +1 -1
  36. package/dist/esm/models/UserPreferences.js +3 -1
  37. package/dist/esm/models/UserPreferencesUpdate.d.ts +1 -1
  38. package/dist/esm/models/UserPreferencesUpdate.js +3 -1
  39. package/dist/esm/models/index.d.ts +6 -0
  40. package/dist/esm/models/index.js +6 -0
  41. package/dist/models/AgentTool.d.ts +79 -0
  42. package/dist/models/AgentTool.js +73 -0
  43. package/dist/models/AgentToolUpsert.d.ts +40 -0
  44. package/dist/models/AgentToolUpsert.js +52 -0
  45. package/dist/models/Notification.d.ts +16 -17
  46. package/dist/models/Notification.js +8 -8
  47. package/dist/models/NotificationCreate.d.ts +3 -4
  48. package/dist/models/NotificationCreate.js +4 -2
  49. package/dist/models/NotificationLocalizedContentValue.d.ts +38 -0
  50. package/dist/models/NotificationLocalizedContentValue.js +54 -0
  51. package/dist/models/NotificationUpdate.d.ts +3 -4
  52. package/dist/models/NotificationUpdate.js +4 -2
  53. package/dist/models/Tool.d.ts +102 -0
  54. package/dist/models/Tool.js +84 -0
  55. package/dist/models/ToolCreate.d.ts +84 -0
  56. package/dist/models/ToolCreate.js +70 -0
  57. package/dist/models/ToolUpdate.d.ts +78 -0
  58. package/dist/models/ToolUpdate.js +62 -0
  59. package/dist/models/UserPreferences.d.ts +1 -1
  60. package/dist/models/UserPreferences.js +3 -1
  61. package/dist/models/UserPreferencesUpdate.d.ts +1 -1
  62. package/dist/models/UserPreferencesUpdate.js +3 -1
  63. package/dist/models/index.d.ts +6 -0
  64. package/dist/models/index.js +6 -0
  65. package/package.json +1 -1
  66. package/src/api-client.ts +21 -2
  67. package/src/apis/RAGApi.ts +69 -67
  68. package/src/apis/ToolsApi.ts +287 -0
  69. package/src/apis/index.ts +1 -0
  70. package/src/models/AgentTool.ts +134 -0
  71. package/src/models/AgentToolUpsert.ts +74 -0
  72. package/src/models/CalendarEvent.ts +1 -0
  73. package/src/models/CalendarEventCreate.ts +1 -0
  74. package/src/models/CalendarEventUpdate.ts +1 -0
  75. package/src/models/Call.ts +1 -0
  76. package/src/models/CallCreate.ts +1 -0
  77. package/src/models/CallUpdate.ts +1 -0
  78. package/src/models/Notification.ts +29 -22
  79. package/src/models/NotificationCreate.ts +12 -4
  80. package/src/models/NotificationLocalizedContentValue.ts +75 -0
  81. package/src/models/NotificationUpdate.ts +12 -4
  82. package/src/models/Tool.ts +160 -0
  83. package/src/models/ToolCreate.ts +132 -0
  84. package/src/models/ToolUpdate.ts +121 -0
  85. package/src/models/UserPreferences.ts +4 -4
  86. package/src/models/UserPreferencesUpdate.ts +4 -4
  87. package/src/models/index.ts +6 -0
@@ -1,3 +1,5 @@
1
+ export * from './AgentTool';
2
+ export * from './AgentToolUpsert';
1
3
  export * from './BillingPortalRequest';
2
4
  export * from './BillingPortalResponse';
3
5
  export * from './Calendar';
@@ -37,6 +39,7 @@ export * from './Member';
37
39
  export * from './Notification';
38
40
  export * from './NotificationChannel';
39
41
  export * from './NotificationCreate';
42
+ export * from './NotificationLocalizedContentValue';
40
43
  export * from './NotificationScope';
41
44
  export * from './NotificationSeverity';
42
45
  export * from './NotificationType';
@@ -76,7 +79,10 @@ export * from './SubscriptionStatus';
76
79
  export * from './SubscriptionStatusPlan';
77
80
  export * from './SubscriptionStatusService';
78
81
  export * from './SubscriptionStatusSubscription';
82
+ export * from './Tool';
79
83
  export * from './ToolConfig';
84
+ export * from './ToolCreate';
85
+ export * from './ToolUpdate';
80
86
  export * from './TtsProvider';
81
87
  export * from './TtsProviderModel';
82
88
  export * from './TtsProviderVoice';
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
+ __exportStar(require("./AgentTool"), exports);
20
+ __exportStar(require("./AgentToolUpsert"), exports);
19
21
  __exportStar(require("./BillingPortalRequest"), exports);
20
22
  __exportStar(require("./BillingPortalResponse"), exports);
21
23
  __exportStar(require("./Calendar"), exports);
@@ -55,6 +57,7 @@ __exportStar(require("./Member"), exports);
55
57
  __exportStar(require("./Notification"), exports);
56
58
  __exportStar(require("./NotificationChannel"), exports);
57
59
  __exportStar(require("./NotificationCreate"), exports);
60
+ __exportStar(require("./NotificationLocalizedContentValue"), exports);
58
61
  __exportStar(require("./NotificationScope"), exports);
59
62
  __exportStar(require("./NotificationSeverity"), exports);
60
63
  __exportStar(require("./NotificationType"), exports);
@@ -94,7 +97,10 @@ __exportStar(require("./SubscriptionStatus"), exports);
94
97
  __exportStar(require("./SubscriptionStatusPlan"), exports);
95
98
  __exportStar(require("./SubscriptionStatusService"), exports);
96
99
  __exportStar(require("./SubscriptionStatusSubscription"), exports);
100
+ __exportStar(require("./Tool"), exports);
97
101
  __exportStar(require("./ToolConfig"), exports);
102
+ __exportStar(require("./ToolCreate"), exports);
103
+ __exportStar(require("./ToolUpdate"), exports);
98
104
  __exportStar(require("./TtsProvider"), exports);
99
105
  __exportStar(require("./TtsProviderModel"), exports);
100
106
  __exportStar(require("./TtsProviderVoice"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@l7mp/tivadar-ai-api-sdk",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
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
@@ -1,6 +1,8 @@
1
1
  import { CallsApi, type OrganizationsOrganizationIdCallsGetSandboxEnum } from "./apis/CallsApi";
2
2
  import { CalendarApi } from "./apis/CalendarApi";
3
3
  import { ChatAgentsApi } from "./apis/ChatAgentsApi";
4
+
5
+
4
6
  import { HistoryApi } from "./apis/HistoryApi";
5
7
  import { InvitationsApi } from "./apis/InvitationsApi";
6
8
  import { MembersApi } from "./apis/MembersApi";
@@ -17,6 +19,7 @@ import { STTProvidersApi } from "./apis/STTProvidersApi";
17
19
  import { TTSProvidersApi } from "./apis/TTSProvidersApi";
18
20
  import { SubscriptionApi } from "./apis/SubscriptionApi";
19
21
  import { VoiceAgentsApi } from "./apis/VoiceAgentsApi";
22
+ import { ToolsApi } from "./apis/ToolsApi";
20
23
  import { Configuration } from "./runtime";
21
24
 
22
25
  import type {
@@ -49,6 +52,7 @@ import type {
49
52
  BillingPortalRequest,
50
53
  OrganizationsOrganizationIdNotificationsGet200Response,
51
54
  UserPreferencesUpdate,
55
+ AgentToolUpsert,
52
56
  } from "./models";
53
57
 
54
58
  export interface ApiClientConfig {
@@ -131,7 +135,7 @@ export class Api {
131
135
  upload: (organizationId: string, ragConfigName: string, file: File, sourceUrl?: string, metadata?: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsPost"]>;
132
136
  list: (organizationId: string, ragConfigName: string, status?: OrganizationsOrganizationIdRagRagConfigNameDocumentsGetStatusEnum, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsGet"]>;
133
137
  get: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet"]>;
134
- download: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet"]>;
138
+ download: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["downloadDocumentFile"]>;
135
139
  replace: (organizationId: string, ragConfigName: string, documentId: string, file: File, sourceUrl?: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPut"]>;
136
140
  delete: (organizationId: string, ragConfigName: string, documentId: string, options?: RequestInit) => ReturnType<RAGApi["organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdDelete"]>;
137
141
  };
@@ -179,6 +183,12 @@ export class Api {
179
183
  public readonly embeddingProviders: {
180
184
  list: (organizationId: string, options?: RequestInit) => ReturnType<EmbeddingProvidersApi["organizationsOrganizationIdEmbeddingProvidersGet"]>;
181
185
  };
186
+ public readonly tools: {
187
+ listCatalog: (organizationId: string, options?: RequestInit) => ReturnType<ToolsApi["organizationsOrganizationIdToolsGet"]>;
188
+ listForAgent: (organizationId: string, voiceAgentId: string, options?: RequestInit) => ReturnType<ToolsApi["organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGet"]>;
189
+ upsertForAgent: (organizationId: string, voiceAgentId: string, toolName: string, agentToolUpsert: AgentToolUpsert, options?: RequestInit) => ReturnType<ToolsApi["organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut"]>;
190
+ removeFromAgent: (organizationId: string, voiceAgentId: string, toolName: string, options?: RequestInit) => ReturnType<ToolsApi["organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete"]>;
191
+ };
182
192
 
183
193
  private readonly callsApi: CallsApi;
184
194
  private readonly voiceAgentsApi: VoiceAgentsApi;
@@ -199,6 +209,7 @@ export class Api {
199
209
  private readonly llmProvidersApi: LLMProvidersApi;
200
210
  private readonly sttProvidersApi: STTProvidersApi;
201
211
  private readonly ttsProvidersApi: TTSProvidersApi;
212
+ private readonly toolsApi: ToolsApi;
202
213
 
203
214
  // Mutable auth state — shared by reference with all API instances
204
215
  private readonly _auth: { accessToken: string | undefined; headers: Record<string, string> } = {
@@ -238,6 +249,7 @@ export class Api {
238
249
  this.llmProvidersApi = new LLMProvidersApi(configuration);
239
250
  this.sttProvidersApi = new STTProvidersApi(configuration);
240
251
  this.ttsProvidersApi = new TTSProvidersApi(configuration);
252
+ this.toolsApi = new ToolsApi(configuration);
241
253
 
242
254
  this.calls = {
243
255
  list: (organizationId, voiceAgentId, sandbox, options) => this.callsApi.organizationsOrganizationIdCallsGet({ organizationId, voiceAgentId, sandbox }, options),
@@ -325,7 +337,7 @@ export class Api {
325
337
  upload: (organizationId, ragConfigName, file, sourceUrl, metadata, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsPost({ organizationId, ragConfigName, file, sourceUrl, metadata }, options),
326
338
  list: (organizationId, ragConfigName, status, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsGet({ organizationId, ragConfigName, status }, options),
327
339
  get: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdGet({ organizationId, ragConfigName, documentId }, options),
328
- download: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGet({ organizationId, ragConfigName, documentId }, options),
340
+ download: (organizationId, ragConfigName, documentId, options) => this.ragApi.downloadDocumentFile({ organizationId, ragConfigName, documentId }, options),
329
341
  replace: (organizationId, ragConfigName, documentId, file, sourceUrl, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPut({ organizationId, ragConfigName, documentId, file, sourceUrl }, options),
330
342
  delete: (organizationId, ragConfigName, documentId, options) => this.ragApi.organizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdDelete({ organizationId, ragConfigName, documentId }, options),
331
343
  },
@@ -379,6 +391,13 @@ export class Api {
379
391
  this.ttsProviders = {
380
392
  list: (organizationId, options) => this.ttsProvidersApi.organizationsOrganizationIdTtsProvidersGet({ organizationId }, options),
381
393
  };
394
+
395
+ this.tools = {
396
+ listCatalog: (organizationId, options) => this.toolsApi.organizationsOrganizationIdToolsGet({ organizationId }, options),
397
+ listForAgent: (organizationId, voiceAgentId, options) => this.toolsApi.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGet({ organizationId, voiceAgentId }, options),
398
+ upsertForAgent: (organizationId, voiceAgentId, toolName, agentToolUpsert, options) => this.toolsApi.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut({ organizationId, voiceAgentId, toolName, agentToolUpsert }, options),
399
+ removeFromAgent: (organizationId, voiceAgentId, toolName, options) => this.toolsApi.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete({ organizationId, voiceAgentId, toolName }, options),
400
+ };
382
401
  }
383
402
 
384
403
  /**
@@ -34,6 +34,12 @@ import {
34
34
  RagDocumentListToJSON,
35
35
  } from '../models/index';
36
36
 
37
+ export interface DownloadDocumentFileRequest {
38
+ organizationId: string;
39
+ ragConfigName: string;
40
+ documentId: string;
41
+ }
42
+
37
43
  export interface OrganizationsOrganizationIdRagGetRequest {
38
44
  organizationId: string;
39
45
  }
@@ -60,12 +66,6 @@ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdG
60
66
  documentId: string;
61
67
  }
62
68
 
63
- export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest {
64
- organizationId: string;
65
- ragConfigName: string;
66
- documentId: string;
67
- }
68
-
69
69
  export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPutRequest {
70
70
  organizationId: string;
71
71
  ragConfigName: string;
@@ -93,6 +93,69 @@ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsPostRequest
93
93
  */
94
94
  export class RAGApi extends runtime.BaseAPI {
95
95
 
96
+ /**
97
+ * Downloads the original uploaded document file from object storage. Requires S3-compatible object storage to be configured on the server.
98
+ * Download original document file
99
+ */
100
+ async downloadDocumentFileRaw(requestParameters: DownloadDocumentFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
101
+ if (requestParameters['organizationId'] == null) {
102
+ throw new runtime.RequiredError(
103
+ 'organizationId',
104
+ 'Required parameter "organizationId" was null or undefined when calling downloadDocumentFile().'
105
+ );
106
+ }
107
+
108
+ if (requestParameters['ragConfigName'] == null) {
109
+ throw new runtime.RequiredError(
110
+ 'ragConfigName',
111
+ 'Required parameter "ragConfigName" was null or undefined when calling downloadDocumentFile().'
112
+ );
113
+ }
114
+
115
+ if (requestParameters['documentId'] == null) {
116
+ throw new runtime.RequiredError(
117
+ 'documentId',
118
+ 'Required parameter "documentId" was null or undefined when calling downloadDocumentFile().'
119
+ );
120
+ }
121
+
122
+ const queryParameters: any = {};
123
+
124
+ const headerParameters: runtime.HTTPHeaders = {};
125
+
126
+ if (this.configuration && this.configuration.accessToken) {
127
+ const token = this.configuration.accessToken;
128
+ const tokenString = await token("bearerAuth", []);
129
+
130
+ if (tokenString) {
131
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
132
+ }
133
+ }
134
+
135
+ let urlPath = `/organizations/{organizationId}/rag/{ragConfigName}/documents/{documentId}/file`;
136
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
137
+ urlPath = urlPath.replace(`{${"ragConfigName"}}`, encodeURIComponent(String(requestParameters['ragConfigName'])));
138
+ urlPath = urlPath.replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters['documentId'])));
139
+
140
+ const response = await this.request({
141
+ path: urlPath,
142
+ method: 'GET',
143
+ headers: headerParameters,
144
+ query: queryParameters,
145
+ }, initOverrides);
146
+
147
+ return new runtime.BlobApiResponse(response);
148
+ }
149
+
150
+ /**
151
+ * Downloads the original uploaded document file from object storage. Requires S3-compatible object storage to be configured on the server.
152
+ * Download original document file
153
+ */
154
+ async downloadDocumentFile(requestParameters: DownloadDocumentFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
155
+ const response = await this.downloadDocumentFileRaw(requestParameters, initOverrides);
156
+ return await response.value();
157
+ }
158
+
96
159
  /**
97
160
  * List all RAG configurations for an organization
98
161
  */
@@ -366,67 +429,6 @@ export class RAGApi extends runtime.BaseAPI {
366
429
  return await response.value();
367
430
  }
368
431
 
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
-
430
432
  /**
431
433
  * Replace a document in a RAG configuration
432
434
  */
@@ -0,0 +1,287 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Tivadar AI Backend API
5
+ * Unified REST API for Tivadar AI Voice Agents platform
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ AgentTool,
19
+ AgentToolUpsert,
20
+ Tool,
21
+ } from '../models/index';
22
+ import {
23
+ AgentToolFromJSON,
24
+ AgentToolToJSON,
25
+ AgentToolUpsertFromJSON,
26
+ AgentToolUpsertToJSON,
27
+ ToolFromJSON,
28
+ ToolToJSON,
29
+ } from '../models/index';
30
+
31
+ export interface OrganizationsOrganizationIdToolsGetRequest {
32
+ organizationId: string;
33
+ }
34
+
35
+ export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRequest {
36
+ organizationId: string;
37
+ voiceAgentId: string;
38
+ }
39
+
40
+ export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRequest {
41
+ organizationId: string;
42
+ voiceAgentId: string;
43
+ toolName: string;
44
+ }
45
+
46
+ export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRequest {
47
+ organizationId: string;
48
+ voiceAgentId: string;
49
+ toolName: string;
50
+ agentToolUpsert: AgentToolUpsert;
51
+ }
52
+
53
+ /**
54
+ *
55
+ */
56
+ export class ToolsApi extends runtime.BaseAPI {
57
+
58
+ /**
59
+ * List available tools in the catalog
60
+ */
61
+ async organizationsOrganizationIdToolsGetRaw(requestParameters: OrganizationsOrganizationIdToolsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Tool>>> {
62
+ if (requestParameters['organizationId'] == null) {
63
+ throw new runtime.RequiredError(
64
+ 'organizationId',
65
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdToolsGet().'
66
+ );
67
+ }
68
+
69
+ const queryParameters: any = {};
70
+
71
+ const headerParameters: runtime.HTTPHeaders = {};
72
+
73
+ if (this.configuration && this.configuration.accessToken) {
74
+ const token = this.configuration.accessToken;
75
+ const tokenString = await token("bearerAuth", []);
76
+
77
+ if (tokenString) {
78
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
79
+ }
80
+ }
81
+
82
+ let urlPath = `/organizations/{organizationId}/tools`;
83
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
84
+
85
+ const response = await this.request({
86
+ path: urlPath,
87
+ method: 'GET',
88
+ headers: headerParameters,
89
+ query: queryParameters,
90
+ }, initOverrides);
91
+
92
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ToolFromJSON));
93
+ }
94
+
95
+ /**
96
+ * List available tools in the catalog
97
+ */
98
+ async organizationsOrganizationIdToolsGet(requestParameters: OrganizationsOrganizationIdToolsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Tool>> {
99
+ const response = await this.organizationsOrganizationIdToolsGetRaw(requestParameters, initOverrides);
100
+ return await response.value();
101
+ }
102
+
103
+ /**
104
+ * List tools enabled (or previously configured) for a voice agent
105
+ */
106
+ async organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRaw(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AgentTool>>> {
107
+ if (requestParameters['organizationId'] == null) {
108
+ throw new runtime.RequiredError(
109
+ 'organizationId',
110
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGet().'
111
+ );
112
+ }
113
+
114
+ if (requestParameters['voiceAgentId'] == null) {
115
+ throw new runtime.RequiredError(
116
+ 'voiceAgentId',
117
+ 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGet().'
118
+ );
119
+ }
120
+
121
+ const queryParameters: any = {};
122
+
123
+ const headerParameters: runtime.HTTPHeaders = {};
124
+
125
+ if (this.configuration && this.configuration.accessToken) {
126
+ const token = this.configuration.accessToken;
127
+ const tokenString = await token("bearerAuth", []);
128
+
129
+ if (tokenString) {
130
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
131
+ }
132
+ }
133
+
134
+ let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/tools`;
135
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
136
+ urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
137
+
138
+ const response = await this.request({
139
+ path: urlPath,
140
+ method: 'GET',
141
+ headers: headerParameters,
142
+ query: queryParameters,
143
+ }, initOverrides);
144
+
145
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AgentToolFromJSON));
146
+ }
147
+
148
+ /**
149
+ * List tools enabled (or previously configured) for a voice agent
150
+ */
151
+ async organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGet(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AgentTool>> {
152
+ const response = await this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRaw(requestParameters, initOverrides);
153
+ return await response.value();
154
+ }
155
+
156
+ /**
157
+ * Remove a tool configuration from a voice agent
158
+ */
159
+ async organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRaw(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
160
+ if (requestParameters['organizationId'] == null) {
161
+ throw new runtime.RequiredError(
162
+ 'organizationId',
163
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete().'
164
+ );
165
+ }
166
+
167
+ if (requestParameters['voiceAgentId'] == null) {
168
+ throw new runtime.RequiredError(
169
+ 'voiceAgentId',
170
+ 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete().'
171
+ );
172
+ }
173
+
174
+ if (requestParameters['toolName'] == null) {
175
+ throw new runtime.RequiredError(
176
+ 'toolName',
177
+ 'Required parameter "toolName" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete().'
178
+ );
179
+ }
180
+
181
+ const queryParameters: any = {};
182
+
183
+ const headerParameters: runtime.HTTPHeaders = {};
184
+
185
+ if (this.configuration && this.configuration.accessToken) {
186
+ const token = this.configuration.accessToken;
187
+ const tokenString = await token("bearerAuth", []);
188
+
189
+ if (tokenString) {
190
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
191
+ }
192
+ }
193
+
194
+ let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/tools/{toolName}`;
195
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
196
+ urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
197
+ urlPath = urlPath.replace(`{${"toolName"}}`, encodeURIComponent(String(requestParameters['toolName'])));
198
+
199
+ const response = await this.request({
200
+ path: urlPath,
201
+ method: 'DELETE',
202
+ headers: headerParameters,
203
+ query: queryParameters,
204
+ }, initOverrides);
205
+
206
+ return new runtime.VoidApiResponse(response);
207
+ }
208
+
209
+ /**
210
+ * Remove a tool configuration from a voice agent
211
+ */
212
+ async organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
213
+ await this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRaw(requestParameters, initOverrides);
214
+ }
215
+
216
+ /**
217
+ * Enable or update a tool for a voice agent
218
+ */
219
+ async organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRaw(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentTool>> {
220
+ if (requestParameters['organizationId'] == null) {
221
+ throw new runtime.RequiredError(
222
+ 'organizationId',
223
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut().'
224
+ );
225
+ }
226
+
227
+ if (requestParameters['voiceAgentId'] == null) {
228
+ throw new runtime.RequiredError(
229
+ 'voiceAgentId',
230
+ 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut().'
231
+ );
232
+ }
233
+
234
+ if (requestParameters['toolName'] == null) {
235
+ throw new runtime.RequiredError(
236
+ 'toolName',
237
+ 'Required parameter "toolName" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut().'
238
+ );
239
+ }
240
+
241
+ if (requestParameters['agentToolUpsert'] == null) {
242
+ throw new runtime.RequiredError(
243
+ 'agentToolUpsert',
244
+ 'Required parameter "agentToolUpsert" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut().'
245
+ );
246
+ }
247
+
248
+ const queryParameters: any = {};
249
+
250
+ const headerParameters: runtime.HTTPHeaders = {};
251
+
252
+ headerParameters['Content-Type'] = 'application/json';
253
+
254
+ if (this.configuration && this.configuration.accessToken) {
255
+ const token = this.configuration.accessToken;
256
+ const tokenString = await token("bearerAuth", []);
257
+
258
+ if (tokenString) {
259
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
260
+ }
261
+ }
262
+
263
+ let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/tools/{toolName}`;
264
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
265
+ urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
266
+ urlPath = urlPath.replace(`{${"toolName"}}`, encodeURIComponent(String(requestParameters['toolName'])));
267
+
268
+ const response = await this.request({
269
+ path: urlPath,
270
+ method: 'PUT',
271
+ headers: headerParameters,
272
+ query: queryParameters,
273
+ body: AgentToolUpsertToJSON(requestParameters['agentToolUpsert']),
274
+ }, initOverrides);
275
+
276
+ return new runtime.JSONApiResponse(response, (jsonValue) => AgentToolFromJSON(jsonValue));
277
+ }
278
+
279
+ /**
280
+ * Enable or update a tool for a voice agent
281
+ */
282
+ async organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentTool> {
283
+ const response = await this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRaw(requestParameters, initOverrides);
284
+ return await response.value();
285
+ }
286
+
287
+ }
package/src/apis/index.ts CHANGED
@@ -18,4 +18,5 @@ export * from './SIPApi';
18
18
  export * from './STTProvidersApi';
19
19
  export * from './SubscriptionApi';
20
20
  export * from './TTSProvidersApi';
21
+ export * from './ToolsApi';
21
22
  export * from './VoiceAgentsApi';