sarvam-agents-client 0.5.2 → 0.5.4
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/README.md +52 -29
- package/dist/apis/AgentsApi.d.ts +96 -11
- package/dist/apis/AgentsApi.js +229 -9
- package/dist/apis/ConversationsApi.d.ts +5 -2
- package/dist/apis/ConversationsApi.js +7 -2
- package/dist/client.d.ts +3 -2
- package/dist/client.js +2 -1
- package/dist/compat/core/agents.d.ts +6 -1
- package/dist/compat/core/agents.js +237 -27
- package/dist/compat/core/customApis.d.ts +76 -0
- package/dist/compat/core/customApis.js +424 -0
- package/dist/compat/core/data.js +1 -1
- package/dist/compat/openai/client.d.ts +3 -0
- package/dist/compat/openai/client.js +5 -1
- package/dist/compat/openai/index.d.ts +1 -0
- package/dist/compat/openai/index.js +0 -1
- package/dist/compat/openai/resources/agents.js +8 -1
- package/dist/compat/openai/resources/sarvam.d.ts +26 -0
- package/dist/compat/openai/resources/sarvam.js +56 -0
- package/dist/compose/deploy.d.ts +14 -3
- package/dist/compose/deploy.js +60 -7
- package/dist/compose/errors.d.ts +4 -0
- package/dist/compose/errors.js +6 -1
- package/dist/compose/settingsTransport.d.ts +18 -13
- package/dist/compose/settingsTransport.js +78 -130
- package/dist/compose/transport.d.ts +12 -2
- package/dist/compose/webhook.d.ts +10 -13
- package/dist/compose/webhook.js +48 -45
- package/dist/compose/webhookSecrets.d.ts +79 -49
- package/dist/compose/webhookSecrets.js +244 -195
- package/dist/esm/apis/AgentsApi.d.ts +96 -11
- package/dist/esm/apis/AgentsApi.js +230 -10
- package/dist/esm/apis/ConversationsApi.d.ts +5 -2
- package/dist/esm/apis/ConversationsApi.js +7 -2
- package/dist/esm/client.d.ts +3 -2
- package/dist/esm/client.js +2 -1
- package/dist/esm/compat/core/agents.d.ts +6 -1
- package/dist/esm/compat/core/agents.js +237 -27
- package/dist/esm/compat/core/customApis.d.ts +76 -0
- package/dist/esm/compat/core/customApis.js +419 -0
- package/dist/esm/compat/core/data.js +1 -1
- package/dist/esm/compat/openai/client.d.ts +3 -0
- package/dist/esm/compat/openai/client.js +5 -1
- package/dist/esm/compat/openai/index.d.ts +1 -0
- package/dist/esm/compat/openai/index.js +0 -1
- package/dist/esm/compat/openai/resources/agents.js +8 -1
- package/dist/esm/compat/openai/resources/sarvam.d.ts +26 -0
- package/dist/esm/compat/openai/resources/sarvam.js +51 -0
- package/dist/esm/compose/deploy.d.ts +14 -3
- package/dist/esm/compose/deploy.js +60 -7
- package/dist/esm/compose/errors.d.ts +4 -0
- package/dist/esm/compose/errors.js +4 -0
- package/dist/esm/compose/settingsTransport.d.ts +18 -13
- package/dist/esm/compose/settingsTransport.js +80 -132
- package/dist/esm/compose/transport.d.ts +12 -2
- package/dist/esm/compose/webhook.d.ts +10 -13
- package/dist/esm/compose/webhook.js +45 -42
- package/dist/esm/compose/webhookSecrets.d.ts +79 -49
- package/dist/esm/compose/webhookSecrets.js +241 -193
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/models/AgentConversationDetail.d.ts +12 -0
- package/dist/esm/models/AgentConversationDetail.js +4 -0
- package/dist/esm/models/AgentConversationView.d.ts +12 -0
- package/dist/esm/models/AgentConversationView.js +4 -0
- package/dist/esm/models/AgentResource.d.ts +7 -0
- package/dist/esm/models/AgentResource.js +3 -0
- package/dist/esm/models/AgentVersionSavedResource.d.ts +65 -0
- package/dist/esm/models/AgentVersionSavedResource.js +60 -0
- package/dist/esm/models/AgentWebhookList.d.ts +33 -0
- package/dist/esm/models/AgentWebhookList.js +44 -0
- package/dist/esm/models/AgentWebhookView.d.ts +76 -0
- package/dist/esm/models/AgentWebhookView.js +70 -0
- package/dist/esm/models/ConversationDetail.d.ts +6 -0
- package/dist/esm/models/ConversationDetail.js +2 -0
- package/dist/esm/models/ConversationView.d.ts +6 -0
- package/dist/esm/models/ConversationView.js +2 -0
- package/dist/esm/models/ErrorDetailItem.d.ts +3 -0
- package/dist/esm/models/FileNodeView.d.ts +7 -0
- package/dist/esm/models/FileNodeView.js +3 -0
- package/dist/esm/models/QueueMessageInput.d.ts +6 -0
- package/dist/esm/models/QueueMessageInput.js +2 -0
- package/dist/esm/models/RotatedWebhookSecretView.d.ts +58 -0
- package/dist/esm/models/RotatedWebhookSecretView.js +61 -0
- package/dist/esm/models/SaveWarningView.d.ts +44 -0
- package/dist/esm/models/SaveWarningView.js +51 -0
- package/dist/esm/models/ShareSkippedResource.d.ts +41 -0
- package/dist/esm/models/ShareSkippedResource.js +47 -0
- package/dist/esm/models/WebhookSecretPutBody.d.ts +32 -0
- package/dist/esm/models/WebhookSecretPutBody.js +43 -0
- package/dist/esm/models/WebhookSecretStateView.d.ts +52 -0
- package/dist/esm/models/WebhookSecretStateView.js +56 -0
- package/dist/esm/models/WebhookSecretValueView.d.ts +32 -0
- package/dist/esm/models/WebhookSecretValueView.js +44 -0
- package/dist/esm/models/WebhookWarning.d.ts +44 -0
- package/dist/esm/models/WebhookWarning.js +51 -0
- package/dist/esm/models/index.d.ts +10 -0
- package/dist/esm/models/index.js +10 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -1
- package/dist/models/AgentConversationDetail.d.ts +12 -0
- package/dist/models/AgentConversationDetail.js +4 -0
- package/dist/models/AgentConversationView.d.ts +12 -0
- package/dist/models/AgentConversationView.js +4 -0
- package/dist/models/AgentResource.d.ts +7 -0
- package/dist/models/AgentResource.js +3 -0
- package/dist/models/AgentVersionSavedResource.d.ts +65 -0
- package/dist/models/AgentVersionSavedResource.js +67 -0
- package/dist/models/AgentWebhookList.d.ts +33 -0
- package/dist/models/AgentWebhookList.js +51 -0
- package/dist/models/AgentWebhookView.d.ts +76 -0
- package/dist/models/AgentWebhookView.js +78 -0
- package/dist/models/ConversationDetail.d.ts +6 -0
- package/dist/models/ConversationDetail.js +2 -0
- package/dist/models/ConversationView.d.ts +6 -0
- package/dist/models/ConversationView.js +2 -0
- package/dist/models/ErrorDetailItem.d.ts +3 -0
- package/dist/models/FileNodeView.d.ts +7 -0
- package/dist/models/FileNodeView.js +3 -0
- package/dist/models/QueueMessageInput.d.ts +6 -0
- package/dist/models/QueueMessageInput.js +2 -0
- package/dist/models/RotatedWebhookSecretView.d.ts +58 -0
- package/dist/models/RotatedWebhookSecretView.js +69 -0
- package/dist/models/SaveWarningView.d.ts +44 -0
- package/dist/models/SaveWarningView.js +58 -0
- package/dist/models/ShareSkippedResource.d.ts +41 -0
- package/dist/models/ShareSkippedResource.js +54 -0
- package/dist/models/WebhookSecretPutBody.d.ts +32 -0
- package/dist/models/WebhookSecretPutBody.js +50 -0
- package/dist/models/WebhookSecretStateView.d.ts +52 -0
- package/dist/models/WebhookSecretStateView.js +64 -0
- package/dist/models/WebhookSecretValueView.d.ts +32 -0
- package/dist/models/WebhookSecretValueView.js +51 -0
- package/dist/models/WebhookWarning.d.ts +44 -0
- package/dist/models/WebhookWarning.js +58 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +10 -0
- package/package.json +1 -1
- package/src/apis/AgentsApi.ts +366 -11
- package/src/apis/ConversationsApi.ts +9 -2
- package/src/client.ts +3 -2
- package/src/compat/core/agents.ts +265 -36
- package/src/compat/core/customApis.ts +506 -0
- package/src/compat/core/data.ts +1 -1
- package/src/compat/openai/client.ts +7 -1
- package/src/compat/openai/index.ts +9 -0
- package/src/compat/openai/resources/agents.ts +9 -1
- package/src/compat/openai/resources/sarvam.ts +94 -0
- package/src/compose/deploy.ts +71 -10
- package/src/compose/errors.ts +4 -0
- package/src/compose/settingsTransport.ts +78 -131
- package/src/compose/transport.ts +10 -2
- package/src/compose/webhook.ts +49 -45
- package/src/compose/webhookSecrets.ts +227 -179
- package/src/index.ts +2 -1
- package/src/models/AgentConversationDetail.ts +16 -0
- package/src/models/AgentConversationView.ts +16 -0
- package/src/models/AgentResource.ts +15 -0
- package/src/models/AgentVersionSavedResource.ts +119 -0
- package/src/models/AgentWebhookList.ts +74 -0
- package/src/models/AgentWebhookView.ts +129 -0
- package/src/models/ConversationDetail.ts +8 -0
- package/src/models/ConversationView.ts +8 -0
- package/src/models/ErrorDetailItem.ts +3 -0
- package/src/models/FileNodeView.ts +16 -0
- package/src/models/QueueMessageInput.ts +8 -0
- package/src/models/RotatedWebhookSecretView.ts +103 -0
- package/src/models/SaveWarningView.ts +84 -0
- package/src/models/ShareSkippedResource.ts +78 -0
- package/src/models/WebhookSecretPutBody.ts +66 -0
- package/src/models/WebhookSecretStateView.ts +94 -0
- package/src/models/WebhookSecretValueView.ts +66 -0
- package/src/models/WebhookWarning.ts +84 -0
- package/src/models/index.ts +10 -0
|
@@ -62,6 +62,13 @@ import {
|
|
|
62
62
|
EntityCategoryToJSON,
|
|
63
63
|
EntityCategoryToJSONTyped,
|
|
64
64
|
} from './EntityCategory.js';
|
|
65
|
+
import type { WebhookWarning } from './WebhookWarning.js';
|
|
66
|
+
import {
|
|
67
|
+
WebhookWarningFromJSON,
|
|
68
|
+
WebhookWarningFromJSONTyped,
|
|
69
|
+
WebhookWarningToJSON,
|
|
70
|
+
WebhookWarningToJSONTyped,
|
|
71
|
+
} from './WebhookWarning.js';
|
|
65
72
|
|
|
66
73
|
/**
|
|
67
74
|
*
|
|
@@ -201,6 +208,12 @@ export interface AgentResource {
|
|
|
201
208
|
* @memberof AgentResource
|
|
202
209
|
*/
|
|
203
210
|
triggerTokens?: Array<TriggerToken> | null;
|
|
211
|
+
/**
|
|
212
|
+
*
|
|
213
|
+
* @type {Array<WebhookWarning>}
|
|
214
|
+
* @memberof AgentResource
|
|
215
|
+
*/
|
|
216
|
+
webhookWarnings?: Array<WebhookWarning> | null;
|
|
204
217
|
/**
|
|
205
218
|
*
|
|
206
219
|
* @type {string}
|
|
@@ -329,6 +342,7 @@ export function AgentResourceFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
329
342
|
'settings': json['settings'] == null ? undefined : json['settings'],
|
|
330
343
|
'interactionCount': json['interactionCount'] == null ? undefined : json['interactionCount'],
|
|
331
344
|
'triggerTokens': json['triggerTokens'] == null ? undefined : ((json['triggerTokens'] as Array<any>).map(TriggerTokenFromJSON)),
|
|
345
|
+
'webhookWarnings': json['webhookWarnings'] == null ? undefined : ((json['webhookWarnings'] as Array<any>).map(WebhookWarningFromJSON)),
|
|
332
346
|
'slackChannelName': json['slackChannelName'] == null ? undefined : json['slackChannelName'],
|
|
333
347
|
'slackUrl': json['slackUrl'] == null ? undefined : json['slackUrl'],
|
|
334
348
|
'slackWorkspaceName': json['slackWorkspaceName'] == null ? undefined : json['slackWorkspaceName'],
|
|
@@ -372,6 +386,7 @@ export function AgentResourceToJSONTyped(value?: AgentResource | null, ignoreDis
|
|
|
372
386
|
'settings': value['settings'],
|
|
373
387
|
'interactionCount': value['interactionCount'],
|
|
374
388
|
'triggerTokens': value['triggerTokens'] == null ? undefined : ((value['triggerTokens'] as Array<any>).map(TriggerTokenToJSON)),
|
|
389
|
+
'webhookWarnings': value['webhookWarnings'] == null ? undefined : ((value['webhookWarnings'] as Array<any>).map(WebhookWarningToJSON)),
|
|
375
390
|
'slackChannelName': value['slackChannelName'],
|
|
376
391
|
'slackUrl': value['slackUrl'],
|
|
377
392
|
'slackWorkspaceName': value['slackWorkspaceName'],
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Sarvam Agents API
|
|
5
|
+
* Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
* Contact: support@sarvam.ai
|
|
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.js';
|
|
16
|
+
import type { ShareSkippedResource } from './ShareSkippedResource.js';
|
|
17
|
+
import {
|
|
18
|
+
ShareSkippedResourceFromJSON,
|
|
19
|
+
ShareSkippedResourceFromJSONTyped,
|
|
20
|
+
ShareSkippedResourceToJSON,
|
|
21
|
+
ShareSkippedResourceToJSONTyped,
|
|
22
|
+
} from './ShareSkippedResource.js';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A saved version. ``shareSkipped`` is set when the agent is still
|
|
26
|
+
* private because its automatic workspace share was refused; null once it
|
|
27
|
+
* is shared. The next save tries the share again.
|
|
28
|
+
* @export
|
|
29
|
+
* @interface AgentVersionSavedResource
|
|
30
|
+
*/
|
|
31
|
+
export interface AgentVersionSavedResource {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {number}
|
|
35
|
+
* @memberof AgentVersionSavedResource
|
|
36
|
+
*/
|
|
37
|
+
version: number;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @type {Date}
|
|
41
|
+
* @memberof AgentVersionSavedResource
|
|
42
|
+
*/
|
|
43
|
+
committedAt: Date;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @type {string}
|
|
47
|
+
* @memberof AgentVersionSavedResource
|
|
48
|
+
*/
|
|
49
|
+
note: string;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @type {boolean}
|
|
53
|
+
* @memberof AgentVersionSavedResource
|
|
54
|
+
*/
|
|
55
|
+
everLive: boolean;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @type {string}
|
|
59
|
+
* @memberof AgentVersionSavedResource
|
|
60
|
+
*/
|
|
61
|
+
createdBy?: string | null;
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @type {ShareSkippedResource}
|
|
65
|
+
* @memberof AgentVersionSavedResource
|
|
66
|
+
*/
|
|
67
|
+
shareSkipped?: ShareSkippedResource | null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Check if a given object implements the AgentVersionSavedResource interface.
|
|
72
|
+
*/
|
|
73
|
+
export function instanceOfAgentVersionSavedResource(value: object): value is AgentVersionSavedResource {
|
|
74
|
+
if (!('version' in value) || value['version'] === undefined) return false;
|
|
75
|
+
if (!('committedAt' in value) || value['committedAt'] === undefined) return false;
|
|
76
|
+
if (!('note' in value) || value['note'] === undefined) return false;
|
|
77
|
+
if (!('everLive' in value) || value['everLive'] === undefined) return false;
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function AgentVersionSavedResourceFromJSON(json: any): AgentVersionSavedResource {
|
|
82
|
+
return AgentVersionSavedResourceFromJSONTyped(json, false);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function AgentVersionSavedResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentVersionSavedResource {
|
|
86
|
+
if (json == null) {
|
|
87
|
+
return json;
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
|
|
91
|
+
'version': json['version'],
|
|
92
|
+
'committedAt': (new Date(json['committedAt'])),
|
|
93
|
+
'note': json['note'],
|
|
94
|
+
'everLive': json['everLive'],
|
|
95
|
+
'createdBy': json['createdBy'] == null ? undefined : json['createdBy'],
|
|
96
|
+
'shareSkipped': json['shareSkipped'] == null ? undefined : ShareSkippedResourceFromJSON(json['shareSkipped']),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function AgentVersionSavedResourceToJSON(json: any): AgentVersionSavedResource {
|
|
101
|
+
return AgentVersionSavedResourceToJSONTyped(json, false);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function AgentVersionSavedResourceToJSONTyped(value?: AgentVersionSavedResource | null, ignoreDiscriminator: boolean = false): any {
|
|
105
|
+
if (value == null) {
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
|
|
111
|
+
'version': value['version'],
|
|
112
|
+
'committedAt': ((value['committedAt']).toISOString()),
|
|
113
|
+
'note': value['note'],
|
|
114
|
+
'everLive': value['everLive'],
|
|
115
|
+
'createdBy': value['createdBy'],
|
|
116
|
+
'shareSkipped': ShareSkippedResourceToJSON(value['shareSkipped']),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Sarvam Agents API
|
|
5
|
+
* Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
* Contact: support@sarvam.ai
|
|
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.js';
|
|
16
|
+
import type { AgentWebhookView } from './AgentWebhookView.js';
|
|
17
|
+
import {
|
|
18
|
+
AgentWebhookViewFromJSON,
|
|
19
|
+
AgentWebhookViewFromJSONTyped,
|
|
20
|
+
AgentWebhookViewToJSON,
|
|
21
|
+
AgentWebhookViewToJSONTyped,
|
|
22
|
+
} from './AgentWebhookView.js';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AgentWebhookList
|
|
28
|
+
*/
|
|
29
|
+
export interface AgentWebhookList {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<AgentWebhookView>}
|
|
33
|
+
* @memberof AgentWebhookList
|
|
34
|
+
*/
|
|
35
|
+
items: Array<AgentWebhookView>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Check if a given object implements the AgentWebhookList interface.
|
|
40
|
+
*/
|
|
41
|
+
export function instanceOfAgentWebhookList(value: object): value is AgentWebhookList {
|
|
42
|
+
if (!('items' in value) || value['items'] === undefined) return false;
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function AgentWebhookListFromJSON(json: any): AgentWebhookList {
|
|
47
|
+
return AgentWebhookListFromJSONTyped(json, false);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function AgentWebhookListFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentWebhookList {
|
|
51
|
+
if (json == null) {
|
|
52
|
+
return json;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
|
|
56
|
+
'items': ((json['items'] as Array<any>).map(AgentWebhookViewFromJSON)),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function AgentWebhookListToJSON(json: any): AgentWebhookList {
|
|
61
|
+
return AgentWebhookListToJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function AgentWebhookListToJSONTyped(value?: AgentWebhookList | null, ignoreDiscriminator: boolean = false): any {
|
|
65
|
+
if (value == null) {
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
|
|
71
|
+
'items': ((value['items'] as Array<any>).map(AgentWebhookViewToJSON)),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Sarvam Agents API
|
|
5
|
+
* Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
* Contact: support@sarvam.ai
|
|
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.js';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface AgentWebhookView
|
|
20
|
+
*/
|
|
21
|
+
export interface AgentWebhookView {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof AgentWebhookView
|
|
26
|
+
*/
|
|
27
|
+
webhookKey: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof AgentWebhookView
|
|
32
|
+
*/
|
|
33
|
+
url: string | null;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {Array<string>}
|
|
37
|
+
* @memberof AgentWebhookView
|
|
38
|
+
*/
|
|
39
|
+
events: Array<string>;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
* @memberof AgentWebhookView
|
|
44
|
+
*/
|
|
45
|
+
inAgentJson: boolean;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof AgentWebhookView
|
|
50
|
+
*/
|
|
51
|
+
secretStatus: AgentWebhookViewSecretStatusEnum;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {Date}
|
|
55
|
+
* @memberof AgentWebhookView
|
|
56
|
+
*/
|
|
57
|
+
secretUpdatedAt?: Date | null;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {Date}
|
|
61
|
+
* @memberof AgentWebhookView
|
|
62
|
+
*/
|
|
63
|
+
previousExpiresAt?: Date | null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @export
|
|
69
|
+
*/
|
|
70
|
+
export const AgentWebhookViewSecretStatusEnum = {
|
|
71
|
+
Set: 'set',
|
|
72
|
+
Missing: 'missing'
|
|
73
|
+
} as const;
|
|
74
|
+
export type AgentWebhookViewSecretStatusEnum = typeof AgentWebhookViewSecretStatusEnum[keyof typeof AgentWebhookViewSecretStatusEnum];
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Check if a given object implements the AgentWebhookView interface.
|
|
79
|
+
*/
|
|
80
|
+
export function instanceOfAgentWebhookView(value: object): value is AgentWebhookView {
|
|
81
|
+
if (!('webhookKey' in value) || value['webhookKey'] === undefined) return false;
|
|
82
|
+
if (!('url' in value) || value['url'] === undefined) return false;
|
|
83
|
+
if (!('events' in value) || value['events'] === undefined) return false;
|
|
84
|
+
if (!('inAgentJson' in value) || value['inAgentJson'] === undefined) return false;
|
|
85
|
+
if (!('secretStatus' in value) || value['secretStatus'] === undefined) return false;
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function AgentWebhookViewFromJSON(json: any): AgentWebhookView {
|
|
90
|
+
return AgentWebhookViewFromJSONTyped(json, false);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function AgentWebhookViewFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentWebhookView {
|
|
94
|
+
if (json == null) {
|
|
95
|
+
return json;
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
|
|
99
|
+
'webhookKey': json['webhookKey'],
|
|
100
|
+
'url': json['url'],
|
|
101
|
+
'events': json['events'],
|
|
102
|
+
'inAgentJson': json['inAgentJson'],
|
|
103
|
+
'secretStatus': json['secretStatus'],
|
|
104
|
+
'secretUpdatedAt': json['secretUpdatedAt'] == null ? undefined : (new Date(json['secretUpdatedAt'])),
|
|
105
|
+
'previousExpiresAt': json['previousExpiresAt'] == null ? undefined : (new Date(json['previousExpiresAt'])),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function AgentWebhookViewToJSON(json: any): AgentWebhookView {
|
|
110
|
+
return AgentWebhookViewToJSONTyped(json, false);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function AgentWebhookViewToJSONTyped(value?: AgentWebhookView | null, ignoreDiscriminator: boolean = false): any {
|
|
114
|
+
if (value == null) {
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
|
|
120
|
+
'webhookKey': value['webhookKey'],
|
|
121
|
+
'url': value['url'],
|
|
122
|
+
'events': value['events'],
|
|
123
|
+
'inAgentJson': value['inAgentJson'],
|
|
124
|
+
'secretStatus': value['secretStatus'],
|
|
125
|
+
'secretUpdatedAt': value['secretUpdatedAt'] == null ? undefined : ((value['secretUpdatedAt'] as any).toISOString()),
|
|
126
|
+
'previousExpiresAt': value['previousExpiresAt'] == null ? undefined : ((value['previousExpiresAt'] as any).toISOString()),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
@@ -127,6 +127,12 @@ export interface ConversationDetail {
|
|
|
127
127
|
* @memberof ConversationDetail
|
|
128
128
|
*/
|
|
129
129
|
createdAt: Date;
|
|
130
|
+
/**
|
|
131
|
+
*
|
|
132
|
+
* @type {number}
|
|
133
|
+
* @memberof ConversationDetail
|
|
134
|
+
*/
|
|
135
|
+
lastAgentVersion?: number | null;
|
|
130
136
|
/**
|
|
131
137
|
*
|
|
132
138
|
* @type {Array<FieldHighlight>}
|
|
@@ -216,6 +222,7 @@ export function ConversationDetailFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
216
222
|
'lastActiveAt': (new Date(json['lastActiveAt'])),
|
|
217
223
|
'lastReadAt': (json['lastReadAt'] == null ? null : new Date(json['lastReadAt'])),
|
|
218
224
|
'createdAt': (new Date(json['createdAt'])),
|
|
225
|
+
'lastAgentVersion': json['lastAgentVersion'] == null ? undefined : json['lastAgentVersion'],
|
|
219
226
|
'highlight': json['highlight'] == null ? undefined : ((json['highlight'] as Array<any>).map(FieldHighlightFromJSON)),
|
|
220
227
|
'messages': ((json['messages'] as Array<any>).map(UIMessageFromJSON)),
|
|
221
228
|
'lastEventId': json['lastEventId'],
|
|
@@ -250,6 +257,7 @@ export function ConversationDetailToJSONTyped(value?: ConversationDetail | null,
|
|
|
250
257
|
'lastActiveAt': ((value['lastActiveAt']).toISOString()),
|
|
251
258
|
'lastReadAt': (value['lastReadAt'] == null ? null : (value['lastReadAt'] as any).toISOString()),
|
|
252
259
|
'createdAt': ((value['createdAt']).toISOString()),
|
|
260
|
+
'lastAgentVersion': value['lastAgentVersion'],
|
|
253
261
|
'highlight': value['highlight'] == null ? undefined : ((value['highlight'] as Array<any>).map(FieldHighlightToJSON)),
|
|
254
262
|
'messages': ((value['messages'] as Array<any>).map(UIMessageToJSON)),
|
|
255
263
|
'lastEventId': value['lastEventId'],
|
|
@@ -105,6 +105,12 @@ export interface ConversationView {
|
|
|
105
105
|
* @memberof ConversationView
|
|
106
106
|
*/
|
|
107
107
|
createdAt: Date;
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* @type {number}
|
|
111
|
+
* @memberof ConversationView
|
|
112
|
+
*/
|
|
113
|
+
lastAgentVersion?: number | null;
|
|
108
114
|
/**
|
|
109
115
|
*
|
|
110
116
|
* @type {Array<FieldHighlight>}
|
|
@@ -156,6 +162,7 @@ export function ConversationViewFromJSONTyped(json: any, ignoreDiscriminator: bo
|
|
|
156
162
|
'lastActiveAt': (new Date(json['lastActiveAt'])),
|
|
157
163
|
'lastReadAt': (json['lastReadAt'] == null ? null : new Date(json['lastReadAt'])),
|
|
158
164
|
'createdAt': (new Date(json['createdAt'])),
|
|
165
|
+
'lastAgentVersion': json['lastAgentVersion'] == null ? undefined : json['lastAgentVersion'],
|
|
159
166
|
'highlight': json['highlight'] == null ? undefined : ((json['highlight'] as Array<any>).map(FieldHighlightFromJSON)),
|
|
160
167
|
};
|
|
161
168
|
}
|
|
@@ -184,6 +191,7 @@ export function ConversationViewToJSONTyped(value?: ConversationView | null, ign
|
|
|
184
191
|
'lastActiveAt': ((value['lastActiveAt']).toISOString()),
|
|
185
192
|
'lastReadAt': (value['lastReadAt'] == null ? null : (value['lastReadAt'] as any).toISOString()),
|
|
186
193
|
'createdAt': ((value['createdAt']).toISOString()),
|
|
194
|
+
'lastAgentVersion': value['lastAgentVersion'],
|
|
187
195
|
'highlight': value['highlight'] == null ? undefined : ((value['highlight'] as Array<any>).map(FieldHighlightToJSON)),
|
|
188
196
|
};
|
|
189
197
|
}
|
|
@@ -52,6 +52,9 @@ import {
|
|
|
52
52
|
* flow.
|
|
53
53
|
* - ``AGENT_NOT_DEPLOYED`` (409 on an ``origin=managed_agents`` conversation
|
|
54
54
|
* or turn): carries ``agentId``.
|
|
55
|
+
* - ``AGENT_VERSION_PINNED`` (409 on a Playground turn or queued message
|
|
56
|
+
* whose ``agentVersion`` differs from its chat's pinned version): carries
|
|
57
|
+
* ``pinnedVersion`` and ``pickedVersion``.
|
|
55
58
|
* - ``SERVICE_TOKEN_EXISTS`` (409 on ``POST /v1/service-tokens``): carries
|
|
56
59
|
* ``tokenId`` and ``tokenPrefix`` of the caller's live token, when it still
|
|
57
60
|
* exists at the time of the read.
|
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime.js';
|
|
16
|
+
import type { SaveWarningView } from './SaveWarningView.js';
|
|
17
|
+
import {
|
|
18
|
+
SaveWarningViewFromJSON,
|
|
19
|
+
SaveWarningViewFromJSONTyped,
|
|
20
|
+
SaveWarningViewToJSON,
|
|
21
|
+
SaveWarningViewToJSONTyped,
|
|
22
|
+
} from './SaveWarningView.js';
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
*
|
|
18
26
|
* @export
|
|
@@ -55,6 +63,12 @@ export interface FileNodeView {
|
|
|
55
63
|
* @memberof FileNodeView
|
|
56
64
|
*/
|
|
57
65
|
isOwnedByMe?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @type {Array<SaveWarningView>}
|
|
69
|
+
* @memberof FileNodeView
|
|
70
|
+
*/
|
|
71
|
+
warnings?: Array<SaveWarningView> | null;
|
|
58
72
|
}
|
|
59
73
|
|
|
60
74
|
/**
|
|
@@ -81,6 +95,7 @@ export function FileNodeViewFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
|
|
81
95
|
'previousVersion': json['previousVersion'] == null ? undefined : json['previousVersion'],
|
|
82
96
|
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
|
|
83
97
|
'isOwnedByMe': json['isOwnedByMe'] == null ? undefined : json['isOwnedByMe'],
|
|
98
|
+
'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array<any>).map(SaveWarningViewFromJSON)),
|
|
84
99
|
};
|
|
85
100
|
}
|
|
86
101
|
|
|
@@ -101,6 +116,7 @@ export function FileNodeViewToJSONTyped(value?: FileNodeView | null, ignoreDiscr
|
|
|
101
116
|
'previousVersion': value['previousVersion'],
|
|
102
117
|
'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt'] as any).toISOString()),
|
|
103
118
|
'isOwnedByMe': value['isOwnedByMe'],
|
|
119
|
+
'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array<any>).map(SaveWarningViewToJSON)),
|
|
104
120
|
};
|
|
105
121
|
}
|
|
106
122
|
|
|
@@ -63,6 +63,12 @@ export interface QueueMessageInput {
|
|
|
63
63
|
* @memberof QueueMessageInput
|
|
64
64
|
*/
|
|
65
65
|
endUserId?: string | null;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @type {number}
|
|
69
|
+
* @memberof QueueMessageInput
|
|
70
|
+
*/
|
|
71
|
+
agentVersion?: number | null;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
|
|
@@ -112,6 +118,7 @@ export function QueueMessageInputFromJSONTyped(json: any, ignoreDiscriminator: b
|
|
|
112
118
|
'retryOf': json['retryOf'] == null ? undefined : json['retryOf'],
|
|
113
119
|
'surface': json['surface'] == null ? undefined : json['surface'],
|
|
114
120
|
'endUserId': json['endUserId'] == null ? undefined : json['endUserId'],
|
|
121
|
+
'agentVersion': json['agentVersion'] == null ? undefined : json['agentVersion'],
|
|
115
122
|
};
|
|
116
123
|
}
|
|
117
124
|
|
|
@@ -132,6 +139,7 @@ export function QueueMessageInputToJSONTyped(value?: QueueMessageInput | null, i
|
|
|
132
139
|
'retryOf': value['retryOf'],
|
|
133
140
|
'surface': value['surface'],
|
|
134
141
|
'endUserId': value['endUserId'],
|
|
142
|
+
'agentVersion': value['agentVersion'],
|
|
135
143
|
};
|
|
136
144
|
}
|
|
137
145
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Sarvam Agents API
|
|
5
|
+
* Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
* Contact: support@sarvam.ai
|
|
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, hideSecret } from '../runtime.js'; // sarvam: hide-secret-import
|
|
16
|
+
/**
|
|
17
|
+
* The new secret: the only time it is shown. Give it to your receiver.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface RotatedWebhookSecretView
|
|
20
|
+
*/
|
|
21
|
+
export interface RotatedWebhookSecretView {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof RotatedWebhookSecretView
|
|
26
|
+
*/
|
|
27
|
+
secretStatus: RotatedWebhookSecretViewSecretStatusEnum;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {Date}
|
|
31
|
+
* @memberof RotatedWebhookSecretView
|
|
32
|
+
*/
|
|
33
|
+
updatedAt: Date;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {Date}
|
|
37
|
+
* @memberof RotatedWebhookSecretView
|
|
38
|
+
*/
|
|
39
|
+
previousExpiresAt?: Date | null;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof RotatedWebhookSecretView
|
|
44
|
+
*/
|
|
45
|
+
secret: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @export
|
|
51
|
+
*/
|
|
52
|
+
export const RotatedWebhookSecretViewSecretStatusEnum = {
|
|
53
|
+
Set: 'set',
|
|
54
|
+
Missing: 'missing'
|
|
55
|
+
} as const;
|
|
56
|
+
export type RotatedWebhookSecretViewSecretStatusEnum = typeof RotatedWebhookSecretViewSecretStatusEnum[keyof typeof RotatedWebhookSecretViewSecretStatusEnum];
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Check if a given object implements the RotatedWebhookSecretView interface.
|
|
61
|
+
*/
|
|
62
|
+
export function instanceOfRotatedWebhookSecretView(value: object): value is RotatedWebhookSecretView {
|
|
63
|
+
if (!('secretStatus' in value) || value['secretStatus'] === undefined) return false;
|
|
64
|
+
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
|
65
|
+
if (!('secret' in value) || value['secret'] === undefined) return false;
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function RotatedWebhookSecretViewFromJSON(json: any): RotatedWebhookSecretView {
|
|
70
|
+
return RotatedWebhookSecretViewFromJSONTyped(json, false);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function RotatedWebhookSecretViewFromJSONTyped(json: any, ignoreDiscriminator: boolean): RotatedWebhookSecretView {
|
|
74
|
+
if (json == null) {
|
|
75
|
+
return json;
|
|
76
|
+
}
|
|
77
|
+
return hideSecret({ // sarvam: hide-secret-fields
|
|
78
|
+
|
|
79
|
+
'secretStatus': json['secretStatus'],
|
|
80
|
+
'updatedAt': (new Date(json['updatedAt'])),
|
|
81
|
+
'previousExpiresAt': json['previousExpiresAt'] == null ? undefined : (new Date(json['previousExpiresAt'])),
|
|
82
|
+
'secret': json['secret'],
|
|
83
|
+
}, 'secret');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function RotatedWebhookSecretViewToJSON(json: any): RotatedWebhookSecretView {
|
|
87
|
+
return RotatedWebhookSecretViewToJSONTyped(json, false);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function RotatedWebhookSecretViewToJSONTyped(value?: RotatedWebhookSecretView | null, ignoreDiscriminator: boolean = false): any {
|
|
91
|
+
if (value == null) {
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
|
|
97
|
+
'secretStatus': value['secretStatus'],
|
|
98
|
+
'updatedAt': ((value['updatedAt']).toISOString()),
|
|
99
|
+
'previousExpiresAt': value['previousExpiresAt'] == null ? undefined : ((value['previousExpiresAt'] as any).toISOString()),
|
|
100
|
+
'secret': value['secret'],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|