@l7mp/tivadar-ai-api-sdk 0.2.4 → 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.
- package/dist/api-client.d.ts +10 -2
- package/dist/api-client.js +9 -1
- package/dist/apis/RAGApi.d.ts +15 -13
- package/dist/apis/RAGApi.js +47 -45
- package/dist/apis/ToolsApi.d.ts +68 -0
- package/dist/apis/ToolsApi.js +205 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/api-client.d.ts +10 -2
- package/dist/esm/api-client.js +9 -1
- package/dist/esm/apis/RAGApi.d.ts +15 -13
- package/dist/esm/apis/RAGApi.js +47 -45
- package/dist/esm/apis/ToolsApi.d.ts +68 -0
- package/dist/esm/apis/ToolsApi.js +201 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/AgentTool.d.ts +79 -0
- package/dist/esm/models/AgentTool.js +66 -0
- package/dist/esm/models/AgentToolUpsert.d.ts +40 -0
- package/dist/esm/models/AgentToolUpsert.js +45 -0
- package/dist/esm/models/CalendarEvent.d.ts +6 -0
- package/dist/esm/models/CalendarEvent.js +2 -0
- package/dist/esm/models/CalendarEventCreate.d.ts +6 -0
- package/dist/esm/models/CalendarEventCreate.js +2 -0
- package/dist/esm/models/CalendarEventUpdate.d.ts +6 -0
- package/dist/esm/models/CalendarEventUpdate.js +2 -0
- package/dist/esm/models/Notification.d.ts +16 -17
- package/dist/esm/models/Notification.js +8 -8
- package/dist/esm/models/NotificationCreate.d.ts +3 -4
- package/dist/esm/models/NotificationCreate.js +4 -2
- package/dist/esm/models/NotificationLocalizedContentValue.d.ts +38 -0
- package/dist/esm/models/NotificationLocalizedContentValue.js +47 -0
- package/dist/esm/models/NotificationUpdate.d.ts +3 -4
- package/dist/esm/models/NotificationUpdate.js +4 -2
- package/dist/esm/models/Tool.d.ts +102 -0
- package/dist/esm/models/Tool.js +77 -0
- package/dist/esm/models/ToolCreate.d.ts +84 -0
- package/dist/esm/models/ToolCreate.js +63 -0
- package/dist/esm/models/ToolUpdate.d.ts +78 -0
- package/dist/esm/models/ToolUpdate.js +55 -0
- package/dist/esm/models/UserPreferences.d.ts +1 -1
- package/dist/esm/models/UserPreferences.js +3 -1
- package/dist/esm/models/UserPreferencesUpdate.d.ts +1 -1
- package/dist/esm/models/UserPreferencesUpdate.js +3 -1
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.js +6 -0
- package/dist/models/AgentTool.d.ts +79 -0
- package/dist/models/AgentTool.js +73 -0
- package/dist/models/AgentToolUpsert.d.ts +40 -0
- package/dist/models/AgentToolUpsert.js +52 -0
- package/dist/models/CalendarEvent.d.ts +6 -0
- package/dist/models/CalendarEvent.js +2 -0
- package/dist/models/CalendarEventCreate.d.ts +6 -0
- package/dist/models/CalendarEventCreate.js +2 -0
- package/dist/models/CalendarEventUpdate.d.ts +6 -0
- package/dist/models/CalendarEventUpdate.js +2 -0
- package/dist/models/Notification.d.ts +16 -17
- package/dist/models/Notification.js +8 -8
- package/dist/models/NotificationCreate.d.ts +3 -4
- package/dist/models/NotificationCreate.js +4 -2
- package/dist/models/NotificationLocalizedContentValue.d.ts +38 -0
- package/dist/models/NotificationLocalizedContentValue.js +54 -0
- package/dist/models/NotificationUpdate.d.ts +3 -4
- package/dist/models/NotificationUpdate.js +4 -2
- package/dist/models/Tool.d.ts +102 -0
- package/dist/models/Tool.js +84 -0
- package/dist/models/ToolCreate.d.ts +84 -0
- package/dist/models/ToolCreate.js +70 -0
- package/dist/models/ToolUpdate.d.ts +78 -0
- package/dist/models/ToolUpdate.js +62 -0
- package/dist/models/UserPreferences.d.ts +1 -1
- package/dist/models/UserPreferences.js +3 -1
- package/dist/models/UserPreferencesUpdate.d.ts +1 -1
- package/dist/models/UserPreferencesUpdate.js +3 -1
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +6 -0
- package/package.json +1 -1
- package/src/api-client.ts +21 -2
- package/src/apis/RAGApi.ts +69 -67
- package/src/apis/ToolsApi.ts +287 -0
- package/src/apis/index.ts +1 -0
- package/src/models/AgentTool.ts +134 -0
- package/src/models/AgentToolUpsert.ts +74 -0
- package/src/models/CalendarEvent.ts +8 -0
- package/src/models/CalendarEventCreate.ts +8 -0
- package/src/models/CalendarEventUpdate.ts +8 -0
- package/src/models/Call.ts +1 -0
- package/src/models/CallCreate.ts +1 -0
- package/src/models/CallUpdate.ts +1 -0
- package/src/models/Notification.ts +29 -22
- package/src/models/NotificationCreate.ts +12 -4
- package/src/models/NotificationLocalizedContentValue.ts +75 -0
- package/src/models/NotificationUpdate.ts +12 -4
- package/src/models/Tool.ts +160 -0
- package/src/models/ToolCreate.ts +132 -0
- package/src/models/ToolUpdate.ts +121 -0
- package/src/models/UserPreferences.ts +4 -4
- package/src/models/UserPreferencesUpdate.ts +4 -4
- package/src/models/index.ts +6 -0
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
13
|
import type { RagConfig, RagConfigCreate, RagDocument, RagDocumentChunkList, RagDocumentList } from '../models/index';
|
|
14
|
+
export interface DownloadDocumentFileRequest {
|
|
15
|
+
organizationId: string;
|
|
16
|
+
ragConfigName: string;
|
|
17
|
+
documentId: string;
|
|
18
|
+
}
|
|
14
19
|
export interface OrganizationsOrganizationIdRagGetRequest {
|
|
15
20
|
organizationId: string;
|
|
16
21
|
}
|
|
@@ -32,11 +37,6 @@ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdG
|
|
|
32
37
|
ragConfigName: string;
|
|
33
38
|
documentId: string;
|
|
34
39
|
}
|
|
35
|
-
export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdFileGetRequest {
|
|
36
|
-
organizationId: string;
|
|
37
|
-
ragConfigName: string;
|
|
38
|
-
documentId: string;
|
|
39
|
-
}
|
|
40
40
|
export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsDocumentIdPutRequest {
|
|
41
41
|
organizationId: string;
|
|
42
42
|
ragConfigName: string;
|
|
@@ -60,6 +60,16 @@ export interface OrganizationsOrganizationIdRagRagConfigNameDocumentsPostRequest
|
|
|
60
60
|
*
|
|
61
61
|
*/
|
|
62
62
|
export declare class RAGApi extends runtime.BaseAPI {
|
|
63
|
+
/**
|
|
64
|
+
* Downloads the original uploaded document file from object storage. Requires S3-compatible object storage to be configured on the server.
|
|
65
|
+
* Download original document file
|
|
66
|
+
*/
|
|
67
|
+
downloadDocumentFileRaw(requestParameters: DownloadDocumentFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
68
|
+
/**
|
|
69
|
+
* Downloads the original uploaded document file from object storage. Requires S3-compatible object storage to be configured on the server.
|
|
70
|
+
* Download original document file
|
|
71
|
+
*/
|
|
72
|
+
downloadDocumentFile(requestParameters: DownloadDocumentFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
63
73
|
/**
|
|
64
74
|
* List all RAG configurations for an organization
|
|
65
75
|
*/
|
|
@@ -100,14 +110,6 @@ export declare class RAGApi extends runtime.BaseAPI {
|
|
|
100
110
|
* Get document chunks
|
|
101
111
|
*/
|
|
102
112
|
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>;
|
|
111
113
|
/**
|
|
112
114
|
* Replace a document in a RAG configuration
|
|
113
115
|
*/
|
package/dist/esm/apis/RAGApi.js
CHANGED
|
@@ -26,6 +26,53 @@ import { RagConfigFromJSON, RagConfigCreateToJSON, RagDocumentFromJSON, RagDocum
|
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
28
28
|
export class RAGApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Downloads the original uploaded document file from object storage. Requires S3-compatible object storage to be configured on the server.
|
|
31
|
+
* Download original document file
|
|
32
|
+
*/
|
|
33
|
+
downloadDocumentFileRaw(requestParameters, initOverrides) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (requestParameters['organizationId'] == null) {
|
|
36
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling downloadDocumentFile().');
|
|
37
|
+
}
|
|
38
|
+
if (requestParameters['ragConfigName'] == null) {
|
|
39
|
+
throw new runtime.RequiredError('ragConfigName', 'Required parameter "ragConfigName" was null or undefined when calling downloadDocumentFile().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['documentId'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling downloadDocumentFile().');
|
|
43
|
+
}
|
|
44
|
+
const queryParameters = {};
|
|
45
|
+
const headerParameters = {};
|
|
46
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
47
|
+
const token = this.configuration.accessToken;
|
|
48
|
+
const tokenString = yield token("bearerAuth", []);
|
|
49
|
+
if (tokenString) {
|
|
50
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
let urlPath = `/organizations/{organizationId}/rag/{ragConfigName}/documents/{documentId}/file`;
|
|
54
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
55
|
+
urlPath = urlPath.replace(`{${"ragConfigName"}}`, encodeURIComponent(String(requestParameters['ragConfigName'])));
|
|
56
|
+
urlPath = urlPath.replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters['documentId'])));
|
|
57
|
+
const response = yield this.request({
|
|
58
|
+
path: urlPath,
|
|
59
|
+
method: 'GET',
|
|
60
|
+
headers: headerParameters,
|
|
61
|
+
query: queryParameters,
|
|
62
|
+
}, initOverrides);
|
|
63
|
+
return new runtime.BlobApiResponse(response);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Downloads the original uploaded document file from object storage. Requires S3-compatible object storage to be configured on the server.
|
|
68
|
+
* Download original document file
|
|
69
|
+
*/
|
|
70
|
+
downloadDocumentFile(requestParameters, initOverrides) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const response = yield this.downloadDocumentFileRaw(requestParameters, initOverrides);
|
|
73
|
+
return yield response.value();
|
|
74
|
+
});
|
|
75
|
+
}
|
|
29
76
|
/**
|
|
30
77
|
* List all RAG configurations for an organization
|
|
31
78
|
*/
|
|
@@ -234,51 +281,6 @@ export class RAGApi extends runtime.BaseAPI {
|
|
|
234
281
|
return yield response.value();
|
|
235
282
|
});
|
|
236
283
|
}
|
|
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
|
-
}
|
|
282
284
|
/**
|
|
283
285
|
* Replace a document in a RAG configuration
|
|
284
286
|
*/
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tivadar AI Backend API
|
|
3
|
+
* Unified REST API for Tivadar AI Voice Agents platform
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { AgentTool, AgentToolUpsert, Tool } from '../models/index';
|
|
14
|
+
export interface OrganizationsOrganizationIdToolsGetRequest {
|
|
15
|
+
organizationId: string;
|
|
16
|
+
}
|
|
17
|
+
export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRequest {
|
|
18
|
+
organizationId: string;
|
|
19
|
+
voiceAgentId: string;
|
|
20
|
+
}
|
|
21
|
+
export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRequest {
|
|
22
|
+
organizationId: string;
|
|
23
|
+
voiceAgentId: string;
|
|
24
|
+
toolName: string;
|
|
25
|
+
}
|
|
26
|
+
export interface OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRequest {
|
|
27
|
+
organizationId: string;
|
|
28
|
+
voiceAgentId: string;
|
|
29
|
+
toolName: string;
|
|
30
|
+
agentToolUpsert: AgentToolUpsert;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
export declare class ToolsApi extends runtime.BaseAPI {
|
|
36
|
+
/**
|
|
37
|
+
* List available tools in the catalog
|
|
38
|
+
*/
|
|
39
|
+
organizationsOrganizationIdToolsGetRaw(requestParameters: OrganizationsOrganizationIdToolsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Tool>>>;
|
|
40
|
+
/**
|
|
41
|
+
* List available tools in the catalog
|
|
42
|
+
*/
|
|
43
|
+
organizationsOrganizationIdToolsGet(requestParameters: OrganizationsOrganizationIdToolsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Tool>>;
|
|
44
|
+
/**
|
|
45
|
+
* List tools enabled (or previously configured) for a voice agent
|
|
46
|
+
*/
|
|
47
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRaw(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AgentTool>>>;
|
|
48
|
+
/**
|
|
49
|
+
* List tools enabled (or previously configured) for a voice agent
|
|
50
|
+
*/
|
|
51
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGet(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AgentTool>>;
|
|
52
|
+
/**
|
|
53
|
+
* Remove a tool configuration from a voice agent
|
|
54
|
+
*/
|
|
55
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRaw(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
56
|
+
/**
|
|
57
|
+
* Remove a tool configuration from a voice agent
|
|
58
|
+
*/
|
|
59
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Enable or update a tool for a voice agent
|
|
62
|
+
*/
|
|
63
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRaw(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentTool>>;
|
|
64
|
+
/**
|
|
65
|
+
* Enable or update a tool for a voice agent
|
|
66
|
+
*/
|
|
67
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut(requestParameters: OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentTool>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import * as runtime from '../runtime';
|
|
24
|
+
import { AgentToolFromJSON, AgentToolUpsertToJSON, ToolFromJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class ToolsApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* List available tools in the catalog
|
|
31
|
+
*/
|
|
32
|
+
organizationsOrganizationIdToolsGetRaw(requestParameters, initOverrides) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (requestParameters['organizationId'] == null) {
|
|
35
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdToolsGet().');
|
|
36
|
+
}
|
|
37
|
+
const queryParameters = {};
|
|
38
|
+
const headerParameters = {};
|
|
39
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
40
|
+
const token = this.configuration.accessToken;
|
|
41
|
+
const tokenString = yield token("bearerAuth", []);
|
|
42
|
+
if (tokenString) {
|
|
43
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
let urlPath = `/organizations/{organizationId}/tools`;
|
|
47
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
48
|
+
const response = yield this.request({
|
|
49
|
+
path: urlPath,
|
|
50
|
+
method: 'GET',
|
|
51
|
+
headers: headerParameters,
|
|
52
|
+
query: queryParameters,
|
|
53
|
+
}, initOverrides);
|
|
54
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ToolFromJSON));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* List available tools in the catalog
|
|
59
|
+
*/
|
|
60
|
+
organizationsOrganizationIdToolsGet(requestParameters, initOverrides) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const response = yield this.organizationsOrganizationIdToolsGetRaw(requestParameters, initOverrides);
|
|
63
|
+
return yield response.value();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* List tools enabled (or previously configured) for a voice agent
|
|
68
|
+
*/
|
|
69
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRaw(requestParameters, initOverrides) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
if (requestParameters['organizationId'] == null) {
|
|
72
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGet().');
|
|
73
|
+
}
|
|
74
|
+
if (requestParameters['voiceAgentId'] == null) {
|
|
75
|
+
throw new runtime.RequiredError('voiceAgentId', 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGet().');
|
|
76
|
+
}
|
|
77
|
+
const queryParameters = {};
|
|
78
|
+
const headerParameters = {};
|
|
79
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
80
|
+
const token = this.configuration.accessToken;
|
|
81
|
+
const tokenString = yield token("bearerAuth", []);
|
|
82
|
+
if (tokenString) {
|
|
83
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/tools`;
|
|
87
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
88
|
+
urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
|
|
89
|
+
const response = yield this.request({
|
|
90
|
+
path: urlPath,
|
|
91
|
+
method: 'GET',
|
|
92
|
+
headers: headerParameters,
|
|
93
|
+
query: queryParameters,
|
|
94
|
+
}, initOverrides);
|
|
95
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AgentToolFromJSON));
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* List tools enabled (or previously configured) for a voice agent
|
|
100
|
+
*/
|
|
101
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGet(requestParameters, initOverrides) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
const response = yield this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsGetRaw(requestParameters, initOverrides);
|
|
104
|
+
return yield response.value();
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Remove a tool configuration from a voice agent
|
|
109
|
+
*/
|
|
110
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRaw(requestParameters, initOverrides) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
if (requestParameters['organizationId'] == null) {
|
|
113
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete().');
|
|
114
|
+
}
|
|
115
|
+
if (requestParameters['voiceAgentId'] == null) {
|
|
116
|
+
throw new runtime.RequiredError('voiceAgentId', 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete().');
|
|
117
|
+
}
|
|
118
|
+
if (requestParameters['toolName'] == null) {
|
|
119
|
+
throw new runtime.RequiredError('toolName', 'Required parameter "toolName" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete().');
|
|
120
|
+
}
|
|
121
|
+
const queryParameters = {};
|
|
122
|
+
const headerParameters = {};
|
|
123
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
124
|
+
const token = this.configuration.accessToken;
|
|
125
|
+
const tokenString = yield token("bearerAuth", []);
|
|
126
|
+
if (tokenString) {
|
|
127
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/tools/{toolName}`;
|
|
131
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
132
|
+
urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
|
|
133
|
+
urlPath = urlPath.replace(`{${"toolName"}}`, encodeURIComponent(String(requestParameters['toolName'])));
|
|
134
|
+
const response = yield this.request({
|
|
135
|
+
path: urlPath,
|
|
136
|
+
method: 'DELETE',
|
|
137
|
+
headers: headerParameters,
|
|
138
|
+
query: queryParameters,
|
|
139
|
+
}, initOverrides);
|
|
140
|
+
return new runtime.VoidApiResponse(response);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Remove a tool configuration from a voice agent
|
|
145
|
+
*/
|
|
146
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete(requestParameters, initOverrides) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
yield this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDeleteRaw(requestParameters, initOverrides);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Enable or update a tool for a voice agent
|
|
153
|
+
*/
|
|
154
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRaw(requestParameters, initOverrides) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
if (requestParameters['organizationId'] == null) {
|
|
157
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut().');
|
|
158
|
+
}
|
|
159
|
+
if (requestParameters['voiceAgentId'] == null) {
|
|
160
|
+
throw new runtime.RequiredError('voiceAgentId', 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut().');
|
|
161
|
+
}
|
|
162
|
+
if (requestParameters['toolName'] == null) {
|
|
163
|
+
throw new runtime.RequiredError('toolName', 'Required parameter "toolName" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut().');
|
|
164
|
+
}
|
|
165
|
+
if (requestParameters['agentToolUpsert'] == null) {
|
|
166
|
+
throw new runtime.RequiredError('agentToolUpsert', 'Required parameter "agentToolUpsert" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut().');
|
|
167
|
+
}
|
|
168
|
+
const queryParameters = {};
|
|
169
|
+
const headerParameters = {};
|
|
170
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
171
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
172
|
+
const token = this.configuration.accessToken;
|
|
173
|
+
const tokenString = yield token("bearerAuth", []);
|
|
174
|
+
if (tokenString) {
|
|
175
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/tools/{toolName}`;
|
|
179
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
180
|
+
urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
|
|
181
|
+
urlPath = urlPath.replace(`{${"toolName"}}`, encodeURIComponent(String(requestParameters['toolName'])));
|
|
182
|
+
const response = yield this.request({
|
|
183
|
+
path: urlPath,
|
|
184
|
+
method: 'PUT',
|
|
185
|
+
headers: headerParameters,
|
|
186
|
+
query: queryParameters,
|
|
187
|
+
body: AgentToolUpsertToJSON(requestParameters['agentToolUpsert']),
|
|
188
|
+
}, initOverrides);
|
|
189
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AgentToolFromJSON(jsonValue));
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Enable or update a tool for a voice agent
|
|
194
|
+
*/
|
|
195
|
+
organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut(requestParameters, initOverrides) {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
const response = yield this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePutRaw(requestParameters, initOverrides);
|
|
198
|
+
return yield response.value();
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
package/dist/esm/apis/index.d.ts
CHANGED
package/dist/esm/apis/index.js
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tivadar AI Backend API
|
|
3
|
+
* Unified REST API for Tivadar AI Voice Agents platform
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Tool } from './Tool';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface AgentTool
|
|
17
|
+
*/
|
|
18
|
+
export interface AgentTool {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof AgentTool
|
|
23
|
+
*/
|
|
24
|
+
id: string;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof AgentTool
|
|
29
|
+
*/
|
|
30
|
+
voice_agent_id: string;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {Tool}
|
|
34
|
+
* @memberof AgentTool
|
|
35
|
+
*/
|
|
36
|
+
tool: Tool;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {boolean}
|
|
40
|
+
* @memberof AgentTool
|
|
41
|
+
*/
|
|
42
|
+
enabled: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Non-secret config values. Secret fields are stored encrypted server-side and returned as `null` placeholders for fields that have a value set.
|
|
45
|
+
* @type {{ [key: string]: any; }}
|
|
46
|
+
* @memberof AgentTool
|
|
47
|
+
*/
|
|
48
|
+
config: {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* For each secret field, whether a value is currently stored.
|
|
53
|
+
* @type {{ [key: string]: boolean; }}
|
|
54
|
+
* @memberof AgentTool
|
|
55
|
+
*/
|
|
56
|
+
secret_field_status?: {
|
|
57
|
+
[key: string]: boolean;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @type {Date}
|
|
62
|
+
* @memberof AgentTool
|
|
63
|
+
*/
|
|
64
|
+
created_at?: Date;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @type {Date}
|
|
68
|
+
* @memberof AgentTool
|
|
69
|
+
*/
|
|
70
|
+
updated_at?: Date;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Check if a given object implements the AgentTool interface.
|
|
74
|
+
*/
|
|
75
|
+
export declare function instanceOfAgentTool(value: object): value is AgentTool;
|
|
76
|
+
export declare function AgentToolFromJSON(json: any): AgentTool;
|
|
77
|
+
export declare function AgentToolFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentTool;
|
|
78
|
+
export declare function AgentToolToJSON(json: any): AgentTool;
|
|
79
|
+
export declare function AgentToolToJSONTyped(value?: AgentTool | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
import { ToolFromJSON, ToolToJSON, } from './Tool';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the AgentTool interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfAgentTool(value) {
|
|
19
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
20
|
+
return false;
|
|
21
|
+
if (!('voice_agent_id' in value) || value['voice_agent_id'] === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
if (!('tool' in value) || value['tool'] === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (!('enabled' in value) || value['enabled'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('config' in value) || value['config'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
export function AgentToolFromJSON(json) {
|
|
32
|
+
return AgentToolFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
export function AgentToolFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'id': json['id'],
|
|
40
|
+
'voice_agent_id': json['voice_agent_id'],
|
|
41
|
+
'tool': ToolFromJSON(json['tool']),
|
|
42
|
+
'enabled': json['enabled'],
|
|
43
|
+
'config': json['config'],
|
|
44
|
+
'secret_field_status': json['secret_field_status'] == null ? undefined : json['secret_field_status'],
|
|
45
|
+
'created_at': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
|
|
46
|
+
'updated_at': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function AgentToolToJSON(json) {
|
|
50
|
+
return AgentToolToJSONTyped(json, false);
|
|
51
|
+
}
|
|
52
|
+
export function AgentToolToJSONTyped(value, ignoreDiscriminator = false) {
|
|
53
|
+
if (value == null) {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
'id': value['id'],
|
|
58
|
+
'voice_agent_id': value['voice_agent_id'],
|
|
59
|
+
'tool': ToolToJSON(value['tool']),
|
|
60
|
+
'enabled': value['enabled'],
|
|
61
|
+
'config': value['config'],
|
|
62
|
+
'secret_field_status': value['secret_field_status'],
|
|
63
|
+
'created_at': value['created_at'] == null ? value['created_at'] : value['created_at'].toISOString(),
|
|
64
|
+
'updated_at': value['updated_at'] == null ? value['updated_at'] : value['updated_at'].toISOString(),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tivadar AI Backend API
|
|
3
|
+
* Unified REST API for Tivadar AI Voice Agents platform
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface AgentToolUpsert
|
|
16
|
+
*/
|
|
17
|
+
export interface AgentToolUpsert {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {boolean}
|
|
21
|
+
* @memberof AgentToolUpsert
|
|
22
|
+
*/
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Full config object including secret fields. Secrets sent here are encrypted server-side; omit a secret field to keep its existing value.
|
|
26
|
+
* @type {{ [key: string]: any; }}
|
|
27
|
+
* @memberof AgentToolUpsert
|
|
28
|
+
*/
|
|
29
|
+
config?: {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if a given object implements the AgentToolUpsert interface.
|
|
35
|
+
*/
|
|
36
|
+
export declare function instanceOfAgentToolUpsert(value: object): value is AgentToolUpsert;
|
|
37
|
+
export declare function AgentToolUpsertFromJSON(json: any): AgentToolUpsert;
|
|
38
|
+
export declare function AgentToolUpsertFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentToolUpsert;
|
|
39
|
+
export declare function AgentToolUpsertToJSON(json: any): AgentToolUpsert;
|
|
40
|
+
export declare function AgentToolUpsertToJSONTyped(value?: AgentToolUpsert | null, ignoreDiscriminator?: boolean): any;
|