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

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 (127) hide show
  1. package/dist/api-client.d.ts +29 -2
  2. package/dist/api-client.js +24 -1
  3. package/dist/apis/PhonebookApi.d.ts +133 -0
  4. package/dist/apis/PhonebookApi.js +434 -0
  5. package/dist/apis/RAGApi.d.ts +15 -13
  6. package/dist/apis/RAGApi.js +47 -45
  7. package/dist/apis/ToolsApi.d.ts +68 -0
  8. package/dist/apis/ToolsApi.js +205 -0
  9. package/dist/apis/index.d.ts +2 -0
  10. package/dist/apis/index.js +2 -0
  11. package/dist/esm/api-client.d.ts +29 -2
  12. package/dist/esm/api-client.js +24 -1
  13. package/dist/esm/apis/PhonebookApi.d.ts +133 -0
  14. package/dist/esm/apis/PhonebookApi.js +430 -0
  15. package/dist/esm/apis/RAGApi.d.ts +15 -13
  16. package/dist/esm/apis/RAGApi.js +47 -45
  17. package/dist/esm/apis/ToolsApi.d.ts +68 -0
  18. package/dist/esm/apis/ToolsApi.js +201 -0
  19. package/dist/esm/apis/index.d.ts +2 -0
  20. package/dist/esm/apis/index.js +2 -0
  21. package/dist/esm/models/AgentTool.d.ts +79 -0
  22. package/dist/esm/models/AgentTool.js +66 -0
  23. package/dist/esm/models/AgentToolUpsert.d.ts +40 -0
  24. package/dist/esm/models/AgentToolUpsert.js +45 -0
  25. package/dist/esm/models/Notification.d.ts +16 -17
  26. package/dist/esm/models/Notification.js +8 -8
  27. package/dist/esm/models/NotificationCreate.d.ts +3 -4
  28. package/dist/esm/models/NotificationCreate.js +4 -2
  29. package/dist/esm/models/NotificationLocalizedContentValue.d.ts +38 -0
  30. package/dist/esm/models/NotificationLocalizedContentValue.js +47 -0
  31. package/dist/esm/models/NotificationUpdate.d.ts +3 -4
  32. package/dist/esm/models/NotificationUpdate.js +4 -2
  33. package/dist/esm/models/Phonebook.d.ts +56 -0
  34. package/dist/esm/models/Phonebook.js +59 -0
  35. package/dist/esm/models/PhonebookEntry.d.ts +89 -0
  36. package/dist/esm/models/PhonebookEntry.js +79 -0
  37. package/dist/esm/models/PhonebookEntryCreate.d.ts +50 -0
  38. package/dist/esm/models/PhonebookEntryCreate.js +51 -0
  39. package/dist/esm/models/PhonebookEntryUpdate.d.ts +50 -0
  40. package/dist/esm/models/PhonebookEntryUpdate.js +47 -0
  41. package/dist/esm/models/PhonebookImportResult.d.ts +57 -0
  42. package/dist/esm/models/PhonebookImportResult.js +60 -0
  43. package/dist/esm/models/PhonebookImportResultErrorsInner.d.ts +38 -0
  44. package/dist/esm/models/PhonebookImportResultErrorsInner.js +47 -0
  45. package/dist/esm/models/PhonebookUpdate.d.ts +32 -0
  46. package/dist/esm/models/PhonebookUpdate.js +41 -0
  47. package/dist/esm/models/Tool.d.ts +102 -0
  48. package/dist/esm/models/Tool.js +77 -0
  49. package/dist/esm/models/ToolCreate.d.ts +84 -0
  50. package/dist/esm/models/ToolCreate.js +63 -0
  51. package/dist/esm/models/ToolUpdate.d.ts +78 -0
  52. package/dist/esm/models/ToolUpdate.js +55 -0
  53. package/dist/esm/models/UserPreferences.d.ts +1 -1
  54. package/dist/esm/models/UserPreferences.js +3 -1
  55. package/dist/esm/models/UserPreferencesUpdate.d.ts +1 -1
  56. package/dist/esm/models/UserPreferencesUpdate.js +3 -1
  57. package/dist/esm/models/index.d.ts +13 -0
  58. package/dist/esm/models/index.js +13 -0
  59. package/dist/models/AgentTool.d.ts +79 -0
  60. package/dist/models/AgentTool.js +73 -0
  61. package/dist/models/AgentToolUpsert.d.ts +40 -0
  62. package/dist/models/AgentToolUpsert.js +52 -0
  63. package/dist/models/Notification.d.ts +16 -17
  64. package/dist/models/Notification.js +8 -8
  65. package/dist/models/NotificationCreate.d.ts +3 -4
  66. package/dist/models/NotificationCreate.js +4 -2
  67. package/dist/models/NotificationLocalizedContentValue.d.ts +38 -0
  68. package/dist/models/NotificationLocalizedContentValue.js +54 -0
  69. package/dist/models/NotificationUpdate.d.ts +3 -4
  70. package/dist/models/NotificationUpdate.js +4 -2
  71. package/dist/models/Phonebook.d.ts +56 -0
  72. package/dist/models/Phonebook.js +66 -0
  73. package/dist/models/PhonebookEntry.d.ts +89 -0
  74. package/dist/models/PhonebookEntry.js +87 -0
  75. package/dist/models/PhonebookEntryCreate.d.ts +50 -0
  76. package/dist/models/PhonebookEntryCreate.js +58 -0
  77. package/dist/models/PhonebookEntryUpdate.d.ts +50 -0
  78. package/dist/models/PhonebookEntryUpdate.js +54 -0
  79. package/dist/models/PhonebookImportResult.d.ts +57 -0
  80. package/dist/models/PhonebookImportResult.js +67 -0
  81. package/dist/models/PhonebookImportResultErrorsInner.d.ts +38 -0
  82. package/dist/models/PhonebookImportResultErrorsInner.js +54 -0
  83. package/dist/models/PhonebookUpdate.d.ts +32 -0
  84. package/dist/models/PhonebookUpdate.js +48 -0
  85. package/dist/models/Tool.d.ts +102 -0
  86. package/dist/models/Tool.js +84 -0
  87. package/dist/models/ToolCreate.d.ts +84 -0
  88. package/dist/models/ToolCreate.js +70 -0
  89. package/dist/models/ToolUpdate.d.ts +78 -0
  90. package/dist/models/ToolUpdate.js +62 -0
  91. package/dist/models/UserPreferences.d.ts +1 -1
  92. package/dist/models/UserPreferences.js +3 -1
  93. package/dist/models/UserPreferencesUpdate.d.ts +1 -1
  94. package/dist/models/UserPreferencesUpdate.js +3 -1
  95. package/dist/models/index.d.ts +13 -0
  96. package/dist/models/index.js +13 -0
  97. package/package.json +1 -1
  98. package/src/api-client.ts +54 -2
  99. package/src/apis/PhonebookApi.ts +599 -0
  100. package/src/apis/RAGApi.ts +69 -67
  101. package/src/apis/ToolsApi.ts +287 -0
  102. package/src/apis/index.ts +2 -0
  103. package/src/models/AgentTool.ts +134 -0
  104. package/src/models/AgentToolUpsert.ts +74 -0
  105. package/src/models/CalendarEvent.ts +1 -0
  106. package/src/models/CalendarEventCreate.ts +1 -0
  107. package/src/models/CalendarEventUpdate.ts +1 -0
  108. package/src/models/Call.ts +1 -0
  109. package/src/models/CallCreate.ts +1 -0
  110. package/src/models/CallUpdate.ts +1 -0
  111. package/src/models/Notification.ts +29 -22
  112. package/src/models/NotificationCreate.ts +12 -4
  113. package/src/models/NotificationLocalizedContentValue.ts +75 -0
  114. package/src/models/NotificationUpdate.ts +12 -4
  115. package/src/models/Phonebook.ts +102 -0
  116. package/src/models/PhonebookEntry.ts +148 -0
  117. package/src/models/PhonebookEntryCreate.ts +91 -0
  118. package/src/models/PhonebookEntryUpdate.ts +89 -0
  119. package/src/models/PhonebookImportResult.ts +110 -0
  120. package/src/models/PhonebookImportResultErrorsInner.ts +75 -0
  121. package/src/models/PhonebookUpdate.ts +65 -0
  122. package/src/models/Tool.ts +160 -0
  123. package/src/models/ToolCreate.ts +132 -0
  124. package/src/models/ToolUpdate.ts +121 -0
  125. package/src/models/UserPreferences.ts +4 -4
  126. package/src/models/UserPreferencesUpdate.ts +4 -4
  127. package/src/models/index.ts +13 -0
@@ -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
@@ -10,6 +10,7 @@ export * from './LLMProvidersApi';
10
10
  export * from './MembersApi';
11
11
  export * from './NotificationsApi';
12
12
  export * from './OrganizationsApi';
13
+ export * from './PhonebookApi';
13
14
  export * from './PlaygroundApi';
14
15
  export * from './ProfileApi';
15
16
  export * from './RAGApi';
@@ -18,4 +19,5 @@ export * from './SIPApi';
18
19
  export * from './STTProvidersApi';
19
20
  export * from './SubscriptionApi';
20
21
  export * from './TTSProvidersApi';
22
+ export * from './ToolsApi';
21
23
  export * from './VoiceAgentsApi';
@@ -0,0 +1,134 @@
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
+ import { mapValues } from '../runtime';
16
+ import type { Tool } from './Tool';
17
+ import {
18
+ ToolFromJSON,
19
+ ToolFromJSONTyped,
20
+ ToolToJSON,
21
+ ToolToJSONTyped,
22
+ } from './Tool';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface AgentTool
28
+ */
29
+ export interface AgentTool {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof AgentTool
34
+ */
35
+ id: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof AgentTool
40
+ */
41
+ voice_agent_id: string;
42
+ /**
43
+ *
44
+ * @type {Tool}
45
+ * @memberof AgentTool
46
+ */
47
+ tool: Tool;
48
+ /**
49
+ *
50
+ * @type {boolean}
51
+ * @memberof AgentTool
52
+ */
53
+ enabled: boolean;
54
+ /**
55
+ * Non-secret config values. Secret fields are stored encrypted server-side and returned as `null` placeholders for fields that have a value set.
56
+ * @type {{ [key: string]: any; }}
57
+ * @memberof AgentTool
58
+ */
59
+ config: { [key: string]: any; };
60
+ /**
61
+ * For each secret field, whether a value is currently stored.
62
+ * @type {{ [key: string]: boolean; }}
63
+ * @memberof AgentTool
64
+ */
65
+ secret_field_status?: { [key: string]: boolean; };
66
+ /**
67
+ *
68
+ * @type {Date}
69
+ * @memberof AgentTool
70
+ */
71
+ created_at?: Date;
72
+ /**
73
+ *
74
+ * @type {Date}
75
+ * @memberof AgentTool
76
+ */
77
+ updated_at?: Date;
78
+ }
79
+
80
+ /**
81
+ * Check if a given object implements the AgentTool interface.
82
+ */
83
+ export function instanceOfAgentTool(value: object): value is AgentTool {
84
+ if (!('id' in value) || value['id'] === undefined) return false;
85
+ if (!('voice_agent_id' in value) || value['voice_agent_id'] === undefined) return false;
86
+ if (!('tool' in value) || value['tool'] === undefined) return false;
87
+ if (!('enabled' in value) || value['enabled'] === undefined) return false;
88
+ if (!('config' in value) || value['config'] === undefined) return false;
89
+ return true;
90
+ }
91
+
92
+ export function AgentToolFromJSON(json: any): AgentTool {
93
+ return AgentToolFromJSONTyped(json, false);
94
+ }
95
+
96
+ export function AgentToolFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentTool {
97
+ if (json == null) {
98
+ return json;
99
+ }
100
+ return {
101
+
102
+ 'id': json['id'],
103
+ 'voice_agent_id': json['voice_agent_id'],
104
+ 'tool': ToolFromJSON(json['tool']),
105
+ 'enabled': json['enabled'],
106
+ 'config': json['config'],
107
+ 'secret_field_status': json['secret_field_status'] == null ? undefined : json['secret_field_status'],
108
+ 'created_at': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
109
+ 'updated_at': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
110
+ };
111
+ }
112
+
113
+ export function AgentToolToJSON(json: any): AgentTool {
114
+ return AgentToolToJSONTyped(json, false);
115
+ }
116
+
117
+ export function AgentToolToJSONTyped(value?: AgentTool | null, ignoreDiscriminator: boolean = false): any {
118
+ if (value == null) {
119
+ return value;
120
+ }
121
+
122
+ return {
123
+
124
+ 'id': value['id'],
125
+ 'voice_agent_id': value['voice_agent_id'],
126
+ 'tool': ToolToJSON(value['tool']),
127
+ 'enabled': value['enabled'],
128
+ 'config': value['config'],
129
+ 'secret_field_status': value['secret_field_status'],
130
+ 'created_at': value['created_at'] == null ? value['created_at'] : value['created_at'].toISOString(),
131
+ 'updated_at': value['updated_at'] == null ? value['updated_at'] : value['updated_at'].toISOString(),
132
+ };
133
+ }
134
+
@@ -0,0 +1,74 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface AgentToolUpsert
20
+ */
21
+ export interface AgentToolUpsert {
22
+ /**
23
+ *
24
+ * @type {boolean}
25
+ * @memberof AgentToolUpsert
26
+ */
27
+ enabled: boolean;
28
+ /**
29
+ * Full config object including secret fields. Secrets sent here are encrypted server-side; omit a secret field to keep its existing value.
30
+ * @type {{ [key: string]: any; }}
31
+ * @memberof AgentToolUpsert
32
+ */
33
+ config?: { [key: string]: any; };
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the AgentToolUpsert interface.
38
+ */
39
+ export function instanceOfAgentToolUpsert(value: object): value is AgentToolUpsert {
40
+ if (!('enabled' in value) || value['enabled'] === undefined) return false;
41
+ return true;
42
+ }
43
+
44
+ export function AgentToolUpsertFromJSON(json: any): AgentToolUpsert {
45
+ return AgentToolUpsertFromJSONTyped(json, false);
46
+ }
47
+
48
+ export function AgentToolUpsertFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentToolUpsert {
49
+ if (json == null) {
50
+ return json;
51
+ }
52
+ return {
53
+
54
+ 'enabled': json['enabled'],
55
+ 'config': json['config'] == null ? undefined : json['config'],
56
+ };
57
+ }
58
+
59
+ export function AgentToolUpsertToJSON(json: any): AgentToolUpsert {
60
+ return AgentToolUpsertToJSONTyped(json, false);
61
+ }
62
+
63
+ export function AgentToolUpsertToJSONTyped(value?: AgentToolUpsert | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'enabled': value['enabled'],
71
+ 'config': value['config'],
72
+ };
73
+ }
74
+
@@ -115,3 +115,4 @@ export function CalendarEventToJSONTyped(value?: CalendarEvent | null, ignoreDis
115
115
  'calendar_id': value['calendar_id'],
116
116
  };
117
117
  }
118
+
@@ -97,3 +97,4 @@ export function CalendarEventCreateToJSONTyped(value?: CalendarEventCreate | nul
97
97
  'end_time': value['end_time'].toISOString(),
98
98
  };
99
99
  }
100
+
@@ -94,3 +94,4 @@ export function CalendarEventUpdateToJSONTyped(value?: CalendarEventUpdate | nul
94
94
  'end_time': value['end_time'] == null ? value['end_time'] : value['end_time'].toISOString(),
95
95
  };
96
96
  }
97
+