sarvam-agents-client 0.1.2 → 0.2.0

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 (298) hide show
  1. package/README.md +15 -0
  2. package/dist/apis/AgentConversationsApi.d.ts +44 -1
  3. package/dist/apis/AgentConversationsApi.js +104 -1
  4. package/dist/apis/AgentsApi.d.ts +77 -5
  5. package/dist/apis/AgentsApi.js +163 -5
  6. package/dist/apis/AppsApi.d.ts +43 -1
  7. package/dist/apis/AppsApi.js +108 -0
  8. package/dist/apis/ArtifactsApi.d.ts +31 -1
  9. package/dist/apis/ArtifactsApi.js +82 -0
  10. package/dist/apis/CustomAPIsApi.d.ts +124 -0
  11. package/dist/apis/CustomAPIsApi.js +305 -0
  12. package/dist/apis/ModelsApi.d.ts +26 -0
  13. package/dist/apis/ModelsApi.js +52 -0
  14. package/dist/apis/index.d.ts +2 -0
  15. package/dist/apis/index.js +2 -0
  16. package/dist/compose/agent.d.ts +40 -0
  17. package/dist/compose/agent.js +191 -0
  18. package/dist/compose/deploy.d.ts +30 -0
  19. package/dist/compose/deploy.js +146 -0
  20. package/dist/compose/errors.d.ts +48 -0
  21. package/dist/compose/errors.js +68 -0
  22. package/dist/compose/events.d.ts +63 -0
  23. package/dist/compose/events.js +100 -0
  24. package/dist/compose/fingerprint.d.ts +6 -0
  25. package/dist/compose/fingerprint.js +83 -0
  26. package/dist/compose/index.d.ts +13 -0
  27. package/dist/compose/index.js +33 -0
  28. package/dist/compose/run.d.ts +100 -0
  29. package/dist/compose/run.js +536 -0
  30. package/dist/compose/runState.d.ts +26 -0
  31. package/dist/compose/runState.js +79 -0
  32. package/dist/compose/settingsTransport.d.ts +24 -0
  33. package/dist/compose/settingsTransport.js +280 -0
  34. package/dist/compose/tools.d.ts +17 -0
  35. package/dist/compose/tools.js +29 -0
  36. package/dist/compose/transport.d.ts +34 -0
  37. package/dist/compose/transport.js +2 -0
  38. package/dist/esm/apis/AgentConversationsApi.d.ts +44 -1
  39. package/dist/esm/apis/AgentConversationsApi.js +104 -1
  40. package/dist/esm/apis/AgentsApi.d.ts +77 -5
  41. package/dist/esm/apis/AgentsApi.js +163 -5
  42. package/dist/esm/apis/AppsApi.d.ts +43 -1
  43. package/dist/esm/apis/AppsApi.js +109 -1
  44. package/dist/esm/apis/ArtifactsApi.d.ts +31 -1
  45. package/dist/esm/apis/ArtifactsApi.js +83 -1
  46. package/dist/esm/apis/CustomAPIsApi.d.ts +124 -0
  47. package/dist/esm/apis/CustomAPIsApi.js +301 -0
  48. package/dist/esm/apis/ModelsApi.d.ts +26 -0
  49. package/dist/esm/apis/ModelsApi.js +48 -0
  50. package/dist/esm/apis/index.d.ts +2 -0
  51. package/dist/esm/apis/index.js +2 -0
  52. package/dist/esm/compose/agent.d.ts +40 -0
  53. package/dist/esm/compose/agent.js +187 -0
  54. package/dist/esm/compose/deploy.d.ts +30 -0
  55. package/dist/esm/compose/deploy.js +137 -0
  56. package/dist/esm/compose/errors.d.ts +48 -0
  57. package/dist/esm/compose/errors.js +53 -0
  58. package/dist/esm/compose/events.d.ts +63 -0
  59. package/dist/esm/compose/events.js +97 -0
  60. package/dist/esm/compose/fingerprint.d.ts +6 -0
  61. package/dist/esm/compose/fingerprint.js +78 -0
  62. package/dist/esm/compose/index.d.ts +13 -0
  63. package/dist/esm/compose/index.js +8 -0
  64. package/dist/esm/compose/run.d.ts +100 -0
  65. package/dist/esm/compose/run.js +530 -0
  66. package/dist/esm/compose/runState.d.ts +26 -0
  67. package/dist/esm/compose/runState.js +75 -0
  68. package/dist/esm/compose/settingsTransport.d.ts +24 -0
  69. package/dist/esm/compose/settingsTransport.js +276 -0
  70. package/dist/esm/compose/tools.d.ts +17 -0
  71. package/dist/esm/compose/tools.js +19 -0
  72. package/dist/esm/compose/transport.d.ts +34 -0
  73. package/dist/esm/compose/transport.js +1 -0
  74. package/dist/esm/models/AgentChannelRef.d.ts +1 -0
  75. package/dist/esm/models/AgentChannelRef.js +2 -1
  76. package/dist/esm/models/AgentConversationDetail.d.ts +15 -2
  77. package/dist/esm/models/AgentConversationDetail.js +6 -4
  78. package/dist/esm/models/AgentConversationView.d.ts +11 -5
  79. package/dist/esm/models/AgentConversationView.js +4 -4
  80. package/dist/esm/models/AgentCreate.d.ts +8 -0
  81. package/dist/esm/models/AgentCreate.js +2 -0
  82. package/dist/esm/models/AgentCustomApiList.d.ts +33 -0
  83. package/dist/esm/models/AgentCustomApiList.js +44 -0
  84. package/dist/esm/models/AgentResource.d.ts +14 -0
  85. package/dist/esm/models/AgentResource.js +4 -0
  86. package/dist/esm/models/AgentSettingsResponse.d.ts +53 -0
  87. package/dist/esm/models/AgentSettingsResponse.js +52 -0
  88. package/dist/esm/models/AgentUpdate.d.ts +8 -0
  89. package/dist/esm/models/AgentUpdate.js +2 -0
  90. package/dist/esm/models/AppAccountView.d.ts +88 -0
  91. package/dist/esm/models/AppAccountView.js +79 -0
  92. package/dist/esm/models/AppAccountsView.d.ts +66 -0
  93. package/dist/esm/models/AppAccountsView.js +60 -0
  94. package/dist/esm/models/AppResource.d.ts +36 -0
  95. package/dist/esm/models/AppResource.js +12 -0
  96. package/dist/esm/models/AppResourceCheckView.d.ts +74 -0
  97. package/dist/esm/models/AppResourceCheckView.js +63 -0
  98. package/dist/esm/models/AppResourceView.d.ts +68 -0
  99. package/dist/esm/models/AppResourceView.js +67 -0
  100. package/dist/esm/models/AppResourcesView.d.ts +54 -0
  101. package/dist/esm/models/AppResourcesView.js +56 -0
  102. package/dist/esm/models/AppToolsResponse.d.ts +14 -0
  103. package/dist/esm/models/AppToolsResponse.js +4 -0
  104. package/dist/esm/models/AppView.d.ts +42 -0
  105. package/dist/esm/models/AppView.js +14 -0
  106. package/dist/esm/models/ArtifactVersionResponse.d.ts +94 -0
  107. package/dist/esm/models/ArtifactVersionResponse.js +80 -0
  108. package/dist/esm/models/AttachedAgent.d.ts +44 -0
  109. package/dist/esm/models/AttachedAgent.js +49 -0
  110. package/dist/esm/models/Auth.d.ts +30 -0
  111. package/dist/esm/models/Auth.js +52 -0
  112. package/dist/esm/models/BindCustomApiBody.d.ts +32 -0
  113. package/dist/esm/models/BindCustomApiBody.js +43 -0
  114. package/dist/esm/models/ConversationArtifact.d.ts +14 -0
  115. package/dist/esm/models/ConversationArtifact.js +9 -0
  116. package/dist/esm/models/CustomApi.d.ts +102 -0
  117. package/dist/esm/models/CustomApi.js +90 -0
  118. package/dist/esm/models/CustomApiBasicAuth.d.ts +51 -0
  119. package/dist/esm/models/CustomApiBasicAuth.js +57 -0
  120. package/dist/esm/models/CustomApiBearerAuth.d.ts +45 -0
  121. package/dist/esm/models/CustomApiBearerAuth.js +53 -0
  122. package/dist/esm/models/CustomApiCreate.d.ts +57 -0
  123. package/dist/esm/models/CustomApiCreate.js +56 -0
  124. package/dist/esm/models/CustomApiHeader.d.ts +44 -0
  125. package/dist/esm/models/CustomApiHeader.js +47 -0
  126. package/dist/esm/models/CustomApiHeadersAuth.d.ts +46 -0
  127. package/dist/esm/models/CustomApiHeadersAuth.js +54 -0
  128. package/dist/esm/models/CustomApiList.d.ts +64 -0
  129. package/dist/esm/models/CustomApiList.js +64 -0
  130. package/dist/esm/models/CustomApiName.d.ts +44 -0
  131. package/dist/esm/models/CustomApiName.js +49 -0
  132. package/dist/esm/models/CustomApiUpdate.d.ts +58 -0
  133. package/dist/esm/models/CustomApiUpdate.js +50 -0
  134. package/dist/esm/models/CustomApiUpdateAuth.d.ts +30 -0
  135. package/dist/esm/models/CustomApiUpdateAuth.js +52 -0
  136. package/dist/esm/models/ErrorDetailItem.d.ts +5 -0
  137. package/dist/esm/models/ListModels403Response.d.ts +23 -0
  138. package/dist/esm/models/ListModels403Response.js +45 -0
  139. package/dist/esm/models/ModelEndpointView.d.ts +38 -0
  140. package/dist/esm/models/ModelEndpointView.js +45 -0
  141. package/dist/esm/models/ModelView.d.ts +69 -0
  142. package/dist/esm/models/ModelView.js +56 -0
  143. package/dist/esm/models/ModelsResponse.d.ts +33 -0
  144. package/dist/esm/models/ModelsResponse.js +44 -0
  145. package/dist/esm/models/SettingsIssueView.d.ts +44 -0
  146. package/dist/esm/models/SettingsIssueView.js +51 -0
  147. package/dist/esm/models/VersionCommitBody.d.ts +44 -0
  148. package/dist/esm/models/VersionCommitBody.js +51 -0
  149. package/dist/esm/models/VersionUploadUrlBody.d.ts +32 -0
  150. package/dist/esm/models/VersionUploadUrlBody.js +43 -0
  151. package/dist/esm/models/index.d.ts +28 -0
  152. package/dist/esm/models/index.js +28 -0
  153. package/dist/models/AgentChannelRef.d.ts +1 -0
  154. package/dist/models/AgentChannelRef.js +2 -1
  155. package/dist/models/AgentConversationDetail.d.ts +15 -2
  156. package/dist/models/AgentConversationDetail.js +6 -4
  157. package/dist/models/AgentConversationView.d.ts +11 -5
  158. package/dist/models/AgentConversationView.js +4 -4
  159. package/dist/models/AgentCreate.d.ts +8 -0
  160. package/dist/models/AgentCreate.js +2 -0
  161. package/dist/models/AgentCustomApiList.d.ts +33 -0
  162. package/dist/models/AgentCustomApiList.js +51 -0
  163. package/dist/models/AgentResource.d.ts +14 -0
  164. package/dist/models/AgentResource.js +4 -0
  165. package/dist/models/AgentSettingsResponse.d.ts +53 -0
  166. package/dist/models/AgentSettingsResponse.js +59 -0
  167. package/dist/models/AgentUpdate.d.ts +8 -0
  168. package/dist/models/AgentUpdate.js +2 -0
  169. package/dist/models/AppAccountView.d.ts +88 -0
  170. package/dist/models/AppAccountView.js +87 -0
  171. package/dist/models/AppAccountsView.d.ts +66 -0
  172. package/dist/models/AppAccountsView.js +68 -0
  173. package/dist/models/AppResource.d.ts +36 -0
  174. package/dist/models/AppResource.js +12 -0
  175. package/dist/models/AppResourceCheckView.d.ts +74 -0
  176. package/dist/models/AppResourceCheckView.js +71 -0
  177. package/dist/models/AppResourceView.d.ts +68 -0
  178. package/dist/models/AppResourceView.js +74 -0
  179. package/dist/models/AppResourcesView.d.ts +54 -0
  180. package/dist/models/AppResourcesView.js +64 -0
  181. package/dist/models/AppToolsResponse.d.ts +14 -0
  182. package/dist/models/AppToolsResponse.js +4 -0
  183. package/dist/models/AppView.d.ts +42 -0
  184. package/dist/models/AppView.js +14 -0
  185. package/dist/models/ArtifactVersionResponse.d.ts +94 -0
  186. package/dist/models/ArtifactVersionResponse.js +88 -0
  187. package/dist/models/AttachedAgent.d.ts +44 -0
  188. package/dist/models/AttachedAgent.js +56 -0
  189. package/dist/models/Auth.d.ts +30 -0
  190. package/dist/models/Auth.js +58 -0
  191. package/dist/models/BindCustomApiBody.d.ts +32 -0
  192. package/dist/models/BindCustomApiBody.js +50 -0
  193. package/dist/models/ConversationArtifact.d.ts +14 -0
  194. package/dist/models/ConversationArtifact.js +10 -0
  195. package/dist/models/CustomApi.d.ts +102 -0
  196. package/dist/models/CustomApi.js +98 -0
  197. package/dist/models/CustomApiBasicAuth.d.ts +51 -0
  198. package/dist/models/CustomApiBasicAuth.js +65 -0
  199. package/dist/models/CustomApiBearerAuth.d.ts +45 -0
  200. package/dist/models/CustomApiBearerAuth.js +61 -0
  201. package/dist/models/CustomApiCreate.d.ts +57 -0
  202. package/dist/models/CustomApiCreate.js +63 -0
  203. package/dist/models/CustomApiHeader.d.ts +44 -0
  204. package/dist/models/CustomApiHeader.js +54 -0
  205. package/dist/models/CustomApiHeadersAuth.d.ts +46 -0
  206. package/dist/models/CustomApiHeadersAuth.js +62 -0
  207. package/dist/models/CustomApiList.d.ts +64 -0
  208. package/dist/models/CustomApiList.js +71 -0
  209. package/dist/models/CustomApiName.d.ts +44 -0
  210. package/dist/models/CustomApiName.js +56 -0
  211. package/dist/models/CustomApiUpdate.d.ts +58 -0
  212. package/dist/models/CustomApiUpdate.js +57 -0
  213. package/dist/models/CustomApiUpdateAuth.d.ts +30 -0
  214. package/dist/models/CustomApiUpdateAuth.js +58 -0
  215. package/dist/models/ErrorDetailItem.d.ts +5 -0
  216. package/dist/models/ListModels403Response.d.ts +23 -0
  217. package/dist/models/ListModels403Response.js +51 -0
  218. package/dist/models/ModelEndpointView.d.ts +38 -0
  219. package/dist/models/ModelEndpointView.js +52 -0
  220. package/dist/models/ModelView.d.ts +69 -0
  221. package/dist/models/ModelView.js +63 -0
  222. package/dist/models/ModelsResponse.d.ts +33 -0
  223. package/dist/models/ModelsResponse.js +51 -0
  224. package/dist/models/SettingsIssueView.d.ts +44 -0
  225. package/dist/models/SettingsIssueView.js +58 -0
  226. package/dist/models/VersionCommitBody.d.ts +44 -0
  227. package/dist/models/VersionCommitBody.js +58 -0
  228. package/dist/models/VersionUploadUrlBody.d.ts +32 -0
  229. package/dist/models/VersionUploadUrlBody.js +50 -0
  230. package/dist/models/index.d.ts +28 -0
  231. package/dist/models/index.js +28 -0
  232. package/package.json +15 -2
  233. package/src/apis/AgentConversationsApi.ts +172 -3
  234. package/src/apis/AgentsApi.ts +242 -7
  235. package/src/apis/AppsApi.ts +174 -3
  236. package/src/apis/ArtifactsApi.ts +144 -0
  237. package/src/apis/ClarifyApi.ts +3 -3
  238. package/src/apis/CollectionsApi.ts +3 -3
  239. package/src/apis/ConversationsApi.ts +3 -3
  240. package/src/apis/CronsApi.ts +3 -3
  241. package/src/apis/CustomAPIsApi.ts +471 -0
  242. package/src/apis/MessagesApi.ts +3 -3
  243. package/src/apis/ModelsApi.ts +70 -0
  244. package/src/apis/QueueApi.ts +3 -3
  245. package/src/apis/ResponsesApi.ts +3 -3
  246. package/src/apis/SkillsApi.ts +3 -3
  247. package/src/apis/index.ts +2 -0
  248. package/src/compose/agent.ts +223 -0
  249. package/src/compose/deploy.ts +168 -0
  250. package/src/compose/errors.ts +66 -0
  251. package/src/compose/events.ts +122 -0
  252. package/src/compose/fingerprint.ts +74 -0
  253. package/src/compose/index.ts +13 -0
  254. package/src/compose/run.ts +601 -0
  255. package/src/compose/runState.ts +95 -0
  256. package/src/compose/settingsTransport.ts +299 -0
  257. package/src/compose/tools.ts +27 -0
  258. package/src/compose/transport.ts +48 -0
  259. package/src/models/AgentChannelRef.ts +2 -1
  260. package/src/models/AgentConversationDetail.ts +21 -5
  261. package/src/models/AgentConversationView.ts +15 -8
  262. package/src/models/AgentCreate.ts +8 -0
  263. package/src/models/AgentCustomApiList.ts +74 -0
  264. package/src/models/AgentResource.ts +16 -0
  265. package/src/models/AgentSettingsResponse.ts +99 -0
  266. package/src/models/AgentUpdate.ts +8 -0
  267. package/src/models/AppAccountView.ts +143 -0
  268. package/src/models/AppAccountsView.ts +118 -0
  269. package/src/models/AppResource.ts +48 -0
  270. package/src/models/AppResourceCheckView.ts +117 -0
  271. package/src/models/AppResourceView.ts +120 -0
  272. package/src/models/AppResourcesView.ts +102 -0
  273. package/src/models/AppToolsResponse.ts +16 -0
  274. package/src/models/AppView.ts +56 -0
  275. package/src/models/ArtifactVersionResponse.ts +155 -0
  276. package/src/models/AttachedAgent.ts +83 -0
  277. package/src/models/Auth.ts +84 -0
  278. package/src/models/BindCustomApiBody.ts +66 -0
  279. package/src/models/ConversationArtifact.ts +19 -0
  280. package/src/models/CustomApi.ts +175 -0
  281. package/src/models/CustomApiBasicAuth.ts +94 -0
  282. package/src/models/CustomApiBearerAuth.ts +85 -0
  283. package/src/models/CustomApiCreate.ts +108 -0
  284. package/src/models/CustomApiHeader.ts +82 -0
  285. package/src/models/CustomApiHeadersAuth.ts +93 -0
  286. package/src/models/CustomApiList.ts +120 -0
  287. package/src/models/CustomApiName.ts +83 -0
  288. package/src/models/CustomApiUpdate.ts +106 -0
  289. package/src/models/CustomApiUpdateAuth.ts +84 -0
  290. package/src/models/ErrorDetailItem.ts +5 -0
  291. package/src/models/ListModels403Response.ts +73 -0
  292. package/src/models/ModelEndpointView.ts +74 -0
  293. package/src/models/ModelView.ts +122 -0
  294. package/src/models/ModelsResponse.ts +74 -0
  295. package/src/models/SettingsIssueView.ts +84 -0
  296. package/src/models/VersionCommitBody.ts +84 -0
  297. package/src/models/VersionUploadUrlBody.ts +66 -0
  298. package/src/models/index.ts +28 -0
@@ -0,0 +1,471 @@
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
+
16
+ import * as runtime from '../runtime.js';
17
+ import type {
18
+ AgentCustomApiList,
19
+ BindCustomApiBody,
20
+ ChatError,
21
+ CustomApi,
22
+ CustomApiCreate,
23
+ CustomApiList,
24
+ CustomApiUpdate,
25
+ HTTPValidationError,
26
+ ListModels403Response,
27
+ Scope,
28
+ } from '../models/index.js';
29
+ import {
30
+ AgentCustomApiListFromJSON,
31
+ AgentCustomApiListToJSON,
32
+ BindCustomApiBodyFromJSON,
33
+ BindCustomApiBodyToJSON,
34
+ ChatErrorFromJSON,
35
+ ChatErrorToJSON,
36
+ CustomApiFromJSON,
37
+ CustomApiToJSON,
38
+ CustomApiCreateFromJSON,
39
+ CustomApiCreateToJSON,
40
+ CustomApiListFromJSON,
41
+ CustomApiListToJSON,
42
+ CustomApiUpdateFromJSON,
43
+ CustomApiUpdateToJSON,
44
+ HTTPValidationErrorFromJSON,
45
+ HTTPValidationErrorToJSON,
46
+ ListModels403ResponseFromJSON,
47
+ ListModels403ResponseToJSON,
48
+ ScopeFromJSON,
49
+ ScopeToJSON,
50
+ } from '../models/index.js';
51
+
52
+ export interface BindCustomApiRequest {
53
+ agentId: string;
54
+ bindCustomApiBody: BindCustomApiBody;
55
+ }
56
+
57
+ export interface CreateCustomApiRequest {
58
+ customApiCreate: CustomApiCreate;
59
+ }
60
+
61
+ export interface DeleteCustomApiRequest {
62
+ customApiId: string;
63
+ }
64
+
65
+ export interface GetCustomApiRequest {
66
+ customApiId: string;
67
+ }
68
+
69
+ export interface ListAgentCustomApisRequest {
70
+ agentId: string;
71
+ }
72
+
73
+ export interface ListCustomApisRequest {
74
+ scope?: Scope | null;
75
+ q?: string | null;
76
+ limit?: number;
77
+ offset?: number;
78
+ }
79
+
80
+ export interface UnbindCustomApiRequest {
81
+ agentId: string;
82
+ customApiId: string;
83
+ }
84
+
85
+ export interface UpdateCustomApiRequest {
86
+ customApiId: string;
87
+ customApiUpdate: CustomApiUpdate;
88
+ }
89
+
90
+ /**
91
+ *
92
+ */
93
+ export class CustomAPIsApi extends runtime.BaseAPI {
94
+
95
+ /**
96
+ * Attach one of the caller\'s own Custom APIs to an agent they own.
97
+ * Bind Custom Api
98
+ */
99
+ async bindCustomApiRaw(requestParameters: BindCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
100
+ if (requestParameters['agentId'] == null) {
101
+ throw new runtime.RequiredError(
102
+ 'agentId',
103
+ 'Required parameter "agentId" was null or undefined when calling bindCustomApi().'
104
+ );
105
+ }
106
+
107
+ if (requestParameters['bindCustomApiBody'] == null) {
108
+ throw new runtime.RequiredError(
109
+ 'bindCustomApiBody',
110
+ 'Required parameter "bindCustomApiBody" was null or undefined when calling bindCustomApi().'
111
+ );
112
+ }
113
+
114
+ const queryParameters: any = {};
115
+
116
+ const headerParameters: runtime.HTTPHeaders = {};
117
+
118
+ headerParameters['Content-Type'] = 'application/json';
119
+
120
+ if (this.configuration && this.configuration.accessToken) {
121
+ const token = this.configuration.accessToken;
122
+ const tokenString = await token("bearerAuth", []);
123
+
124
+ if (tokenString) {
125
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
126
+ }
127
+ }
128
+ const response = await this.request({
129
+ path: `/v1/agents/{agentId}/custom-apis`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
130
+ method: 'POST',
131
+ headers: headerParameters,
132
+ query: queryParameters,
133
+ body: BindCustomApiBodyToJSON(requestParameters['bindCustomApiBody']),
134
+ }, initOverrides);
135
+
136
+ return new runtime.VoidApiResponse(response);
137
+ }
138
+
139
+ /**
140
+ * Attach one of the caller\'s own Custom APIs to an agent they own.
141
+ * Bind Custom Api
142
+ */
143
+ async bindCustomApi(requestParameters: BindCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
144
+ await this.bindCustomApiRaw(requestParameters, initOverrides);
145
+ }
146
+
147
+ /**
148
+ * Create a Custom API; with ``enabledForChats`` (default) it is also attached to the caller\'s personal chats. Never attached to other agents. If that attach hits the personal-chat rules, the API is still saved, disabled, with ``enabledForChatsError`` saying why.
149
+ * Create Custom Api
150
+ */
151
+ async createCustomApiRaw(requestParameters: CreateCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomApi>> {
152
+ if (requestParameters['customApiCreate'] == null) {
153
+ throw new runtime.RequiredError(
154
+ 'customApiCreate',
155
+ 'Required parameter "customApiCreate" was null or undefined when calling createCustomApi().'
156
+ );
157
+ }
158
+
159
+ const queryParameters: any = {};
160
+
161
+ const headerParameters: runtime.HTTPHeaders = {};
162
+
163
+ headerParameters['Content-Type'] = 'application/json';
164
+
165
+ if (this.configuration && this.configuration.accessToken) {
166
+ const token = this.configuration.accessToken;
167
+ const tokenString = await token("bearerAuth", []);
168
+
169
+ if (tokenString) {
170
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
171
+ }
172
+ }
173
+ const response = await this.request({
174
+ path: `/v2/custom-apis`,
175
+ method: 'POST',
176
+ headers: headerParameters,
177
+ query: queryParameters,
178
+ body: CustomApiCreateToJSON(requestParameters['customApiCreate']),
179
+ }, initOverrides);
180
+
181
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomApiFromJSON(jsonValue));
182
+ }
183
+
184
+ /**
185
+ * Create a Custom API; with ``enabledForChats`` (default) it is also attached to the caller\'s personal chats. Never attached to other agents. If that attach hits the personal-chat rules, the API is still saved, disabled, with ``enabledForChatsError`` saying why.
186
+ * Create Custom Api
187
+ */
188
+ async createCustomApi(requestParameters: CreateCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomApi> {
189
+ const response = await this.createCustomApiRaw(requestParameters, initOverrides);
190
+ return await response.value();
191
+ }
192
+
193
+ /**
194
+ * Delete the API and every attachment (agents and personal chats).
195
+ * Delete Custom Api
196
+ */
197
+ async deleteCustomApiRaw(requestParameters: DeleteCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
198
+ if (requestParameters['customApiId'] == null) {
199
+ throw new runtime.RequiredError(
200
+ 'customApiId',
201
+ 'Required parameter "customApiId" was null or undefined when calling deleteCustomApi().'
202
+ );
203
+ }
204
+
205
+ const queryParameters: any = {};
206
+
207
+ const headerParameters: runtime.HTTPHeaders = {};
208
+
209
+ if (this.configuration && this.configuration.accessToken) {
210
+ const token = this.configuration.accessToken;
211
+ const tokenString = await token("bearerAuth", []);
212
+
213
+ if (tokenString) {
214
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
215
+ }
216
+ }
217
+ const response = await this.request({
218
+ path: `/v2/custom-apis/{customApiId}`.replace(`{${"customApiId"}}`, runtime.encodePathParam('customApiId', requestParameters['customApiId'])),
219
+ method: 'DELETE',
220
+ headers: headerParameters,
221
+ query: queryParameters,
222
+ }, initOverrides);
223
+
224
+ return new runtime.VoidApiResponse(response);
225
+ }
226
+
227
+ /**
228
+ * Delete the API and every attachment (agents and personal chats).
229
+ * Delete Custom Api
230
+ */
231
+ async deleteCustomApi(requestParameters: DeleteCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
232
+ await this.deleteCustomApiRaw(requestParameters, initOverrides);
233
+ }
234
+
235
+ /**
236
+ * Get Custom Api
237
+ */
238
+ async getCustomApiRaw(requestParameters: GetCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomApi>> {
239
+ if (requestParameters['customApiId'] == null) {
240
+ throw new runtime.RequiredError(
241
+ 'customApiId',
242
+ 'Required parameter "customApiId" was null or undefined when calling getCustomApi().'
243
+ );
244
+ }
245
+
246
+ const queryParameters: any = {};
247
+
248
+ const headerParameters: runtime.HTTPHeaders = {};
249
+
250
+ if (this.configuration && this.configuration.accessToken) {
251
+ const token = this.configuration.accessToken;
252
+ const tokenString = await token("bearerAuth", []);
253
+
254
+ if (tokenString) {
255
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
256
+ }
257
+ }
258
+ const response = await this.request({
259
+ path: `/v2/custom-apis/{customApiId}`.replace(`{${"customApiId"}}`, runtime.encodePathParam('customApiId', requestParameters['customApiId'])),
260
+ method: 'GET',
261
+ headers: headerParameters,
262
+ query: queryParameters,
263
+ }, initOverrides);
264
+
265
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomApiFromJSON(jsonValue));
266
+ }
267
+
268
+ /**
269
+ * Get Custom Api
270
+ */
271
+ async getCustomApi(requestParameters: GetCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomApi> {
272
+ const response = await this.getCustomApiRaw(requestParameters, initOverrides);
273
+ return await response.value();
274
+ }
275
+
276
+ /**
277
+ * Names of the Custom APIs attached to an agent — for any viewer of it. The host is filled only for the caller\'s own APIs.
278
+ * List Agent Custom Apis
279
+ */
280
+ async listAgentCustomApisRaw(requestParameters: ListAgentCustomApisRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentCustomApiList>> {
281
+ if (requestParameters['agentId'] == null) {
282
+ throw new runtime.RequiredError(
283
+ 'agentId',
284
+ 'Required parameter "agentId" was null or undefined when calling listAgentCustomApis().'
285
+ );
286
+ }
287
+
288
+ const queryParameters: any = {};
289
+
290
+ const headerParameters: runtime.HTTPHeaders = {};
291
+
292
+ if (this.configuration && this.configuration.accessToken) {
293
+ const token = this.configuration.accessToken;
294
+ const tokenString = await token("bearerAuth", []);
295
+
296
+ if (tokenString) {
297
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
298
+ }
299
+ }
300
+ const response = await this.request({
301
+ path: `/v1/agents/{agentId}/custom-apis`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
302
+ method: 'GET',
303
+ headers: headerParameters,
304
+ query: queryParameters,
305
+ }, initOverrides);
306
+
307
+ return new runtime.JSONApiResponse(response, (jsonValue) => AgentCustomApiListFromJSON(jsonValue));
308
+ }
309
+
310
+ /**
311
+ * Names of the Custom APIs attached to an agent — for any viewer of it. The host is filled only for the caller\'s own APIs.
312
+ * List Agent Custom Apis
313
+ */
314
+ async listAgentCustomApis(requestParameters: ListAgentCustomApisRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentCustomApiList> {
315
+ const response = await this.listAgentCustomApisRaw(requestParameters, initOverrides);
316
+ return await response.value();
317
+ }
318
+
319
+ /**
320
+ * The caller\'s own Custom APIs, newest first. ``q`` matches name, description or host; ``scope`` is ignored (the list is owner-only).
321
+ * List Custom Apis
322
+ */
323
+ async listCustomApisRaw(requestParameters: ListCustomApisRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomApiList>> {
324
+ const queryParameters: any = {};
325
+
326
+ if (requestParameters['scope'] != null) {
327
+ queryParameters['scope'] = requestParameters['scope'];
328
+ }
329
+
330
+ if (requestParameters['q'] != null) {
331
+ queryParameters['q'] = requestParameters['q'];
332
+ }
333
+
334
+ if (requestParameters['limit'] != null) {
335
+ queryParameters['limit'] = requestParameters['limit'];
336
+ }
337
+
338
+ if (requestParameters['offset'] != null) {
339
+ queryParameters['offset'] = requestParameters['offset'];
340
+ }
341
+
342
+ const headerParameters: runtime.HTTPHeaders = {};
343
+
344
+ if (this.configuration && this.configuration.accessToken) {
345
+ const token = this.configuration.accessToken;
346
+ const tokenString = await token("bearerAuth", []);
347
+
348
+ if (tokenString) {
349
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
350
+ }
351
+ }
352
+ const response = await this.request({
353
+ path: `/v2/custom-apis`,
354
+ method: 'GET',
355
+ headers: headerParameters,
356
+ query: queryParameters,
357
+ }, initOverrides);
358
+
359
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomApiListFromJSON(jsonValue));
360
+ }
361
+
362
+ /**
363
+ * The caller\'s own Custom APIs, newest first. ``q`` matches name, description or host; ``scope`` is ignored (the list is owner-only).
364
+ * List Custom Apis
365
+ */
366
+ async listCustomApis(requestParameters: ListCustomApisRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomApiList> {
367
+ const response = await this.listCustomApisRaw(requestParameters, initOverrides);
368
+ return await response.value();
369
+ }
370
+
371
+ /**
372
+ * Unbind Custom Api
373
+ */
374
+ async unbindCustomApiRaw(requestParameters: UnbindCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
375
+ if (requestParameters['agentId'] == null) {
376
+ throw new runtime.RequiredError(
377
+ 'agentId',
378
+ 'Required parameter "agentId" was null or undefined when calling unbindCustomApi().'
379
+ );
380
+ }
381
+
382
+ if (requestParameters['customApiId'] == null) {
383
+ throw new runtime.RequiredError(
384
+ 'customApiId',
385
+ 'Required parameter "customApiId" was null or undefined when calling unbindCustomApi().'
386
+ );
387
+ }
388
+
389
+ const queryParameters: any = {};
390
+
391
+ const headerParameters: runtime.HTTPHeaders = {};
392
+
393
+ if (this.configuration && this.configuration.accessToken) {
394
+ const token = this.configuration.accessToken;
395
+ const tokenString = await token("bearerAuth", []);
396
+
397
+ if (tokenString) {
398
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
399
+ }
400
+ }
401
+ const response = await this.request({
402
+ path: `/v1/agents/{agentId}/custom-apis/{customApiId}`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"customApiId"}}`, runtime.encodePathParam('customApiId', requestParameters['customApiId'])),
403
+ method: 'DELETE',
404
+ headers: headerParameters,
405
+ query: queryParameters,
406
+ }, initOverrides);
407
+
408
+ return new runtime.VoidApiResponse(response);
409
+ }
410
+
411
+ /**
412
+ * Unbind Custom Api
413
+ */
414
+ async unbindCustomApi(requestParameters: UnbindCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
415
+ await this.unbindCustomApiRaw(requestParameters, initOverrides);
416
+ }
417
+
418
+ /**
419
+ * Edit details and/or replace credentials. Attachments are kept.
420
+ * Update Custom Api
421
+ */
422
+ async updateCustomApiRaw(requestParameters: UpdateCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomApi>> {
423
+ if (requestParameters['customApiId'] == null) {
424
+ throw new runtime.RequiredError(
425
+ 'customApiId',
426
+ 'Required parameter "customApiId" was null or undefined when calling updateCustomApi().'
427
+ );
428
+ }
429
+
430
+ if (requestParameters['customApiUpdate'] == null) {
431
+ throw new runtime.RequiredError(
432
+ 'customApiUpdate',
433
+ 'Required parameter "customApiUpdate" was null or undefined when calling updateCustomApi().'
434
+ );
435
+ }
436
+
437
+ const queryParameters: any = {};
438
+
439
+ const headerParameters: runtime.HTTPHeaders = {};
440
+
441
+ headerParameters['Content-Type'] = 'application/json';
442
+
443
+ if (this.configuration && this.configuration.accessToken) {
444
+ const token = this.configuration.accessToken;
445
+ const tokenString = await token("bearerAuth", []);
446
+
447
+ if (tokenString) {
448
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
449
+ }
450
+ }
451
+ const response = await this.request({
452
+ path: `/v2/custom-apis/{customApiId}`.replace(`{${"customApiId"}}`, runtime.encodePathParam('customApiId', requestParameters['customApiId'])),
453
+ method: 'PATCH',
454
+ headers: headerParameters,
455
+ query: queryParameters,
456
+ body: CustomApiUpdateToJSON(requestParameters['customApiUpdate']),
457
+ }, initOverrides);
458
+
459
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomApiFromJSON(jsonValue));
460
+ }
461
+
462
+ /**
463
+ * Edit details and/or replace credentials. Attachments are kept.
464
+ * Update Custom Api
465
+ */
466
+ async updateCustomApi(requestParameters: UpdateCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomApi> {
467
+ const response = await this.updateCustomApiRaw(requestParameters, initOverrides);
468
+ return await response.value();
469
+ }
470
+
471
+ }
@@ -18,8 +18,8 @@ import type {
18
18
  AddMessageBody,
19
19
  ChatError,
20
20
  HTTPValidationError,
21
+ ListModels403Response,
21
22
  MessagesResponse,
22
- MintUploadUrl403Response,
23
23
  UIMessage,
24
24
  } from '../models/index.js';
25
25
  import {
@@ -29,10 +29,10 @@ import {
29
29
  ChatErrorToJSON,
30
30
  HTTPValidationErrorFromJSON,
31
31
  HTTPValidationErrorToJSON,
32
+ ListModels403ResponseFromJSON,
33
+ ListModels403ResponseToJSON,
32
34
  MessagesResponseFromJSON,
33
35
  MessagesResponseToJSON,
34
- MintUploadUrl403ResponseFromJSON,
35
- MintUploadUrl403ResponseToJSON,
36
36
  UIMessageFromJSON,
37
37
  UIMessageToJSON,
38
38
  } from '../models/index.js';
@@ -0,0 +1,70 @@
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
+
16
+ import * as runtime from '../runtime.js';
17
+ import type {
18
+ ChatError,
19
+ ListModels403Response,
20
+ ModelsResponse,
21
+ } from '../models/index.js';
22
+ import {
23
+ ChatErrorFromJSON,
24
+ ChatErrorToJSON,
25
+ ListModels403ResponseFromJSON,
26
+ ListModels403ResponseToJSON,
27
+ ModelsResponseFromJSON,
28
+ ModelsResponseToJSON,
29
+ } from '../models/index.js';
30
+
31
+ /**
32
+ *
33
+ */
34
+ export class ModelsApi extends runtime.BaseAPI {
35
+
36
+ /**
37
+ * List Models
38
+ */
39
+ async listModelsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelsResponse>> {
40
+ const queryParameters: any = {};
41
+
42
+ const headerParameters: runtime.HTTPHeaders = {};
43
+
44
+ if (this.configuration && this.configuration.accessToken) {
45
+ const token = this.configuration.accessToken;
46
+ const tokenString = await token("bearerAuth", []);
47
+
48
+ if (tokenString) {
49
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
50
+ }
51
+ }
52
+ const response = await this.request({
53
+ path: `/v1/models`,
54
+ method: 'GET',
55
+ headers: headerParameters,
56
+ query: queryParameters,
57
+ }, initOverrides);
58
+
59
+ return new runtime.JSONApiResponse(response, (jsonValue) => ModelsResponseFromJSON(jsonValue));
60
+ }
61
+
62
+ /**
63
+ * List Models
64
+ */
65
+ async listModels(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelsResponse> {
66
+ const response = await this.listModelsRaw(initOverrides);
67
+ return await response.value();
68
+ }
69
+
70
+ }
@@ -18,7 +18,7 @@ import type {
18
18
  ChatError,
19
19
  EditQueuedInput,
20
20
  HTTPValidationError,
21
- MintUploadUrl403Response,
21
+ ListModels403Response,
22
22
  QueueMessageInput,
23
23
  QueueMessageResult,
24
24
  QueuedTurnView,
@@ -30,8 +30,8 @@ import {
30
30
  EditQueuedInputToJSON,
31
31
  HTTPValidationErrorFromJSON,
32
32
  HTTPValidationErrorToJSON,
33
- MintUploadUrl403ResponseFromJSON,
34
- MintUploadUrl403ResponseToJSON,
33
+ ListModels403ResponseFromJSON,
34
+ ListModels403ResponseToJSON,
35
35
  QueueMessageInputFromJSON,
36
36
  QueueMessageInputToJSON,
37
37
  QueueMessageResultFromJSON,
@@ -17,7 +17,7 @@ import * as runtime from '../runtime.js';
17
17
  import type {
18
18
  ChatError,
19
19
  HTTPValidationError,
20
- MintUploadUrl403Response,
20
+ ListModels403Response,
21
21
  ResponseInput,
22
22
  StopResponse,
23
23
  } from '../models/index.js';
@@ -26,8 +26,8 @@ import {
26
26
  ChatErrorToJSON,
27
27
  HTTPValidationErrorFromJSON,
28
28
  HTTPValidationErrorToJSON,
29
- MintUploadUrl403ResponseFromJSON,
30
- MintUploadUrl403ResponseToJSON,
29
+ ListModels403ResponseFromJSON,
30
+ ListModels403ResponseToJSON,
31
31
  ResponseInputFromJSON,
32
32
  ResponseInputToJSON,
33
33
  StopResponseFromJSON,
@@ -22,7 +22,7 @@ import type {
22
22
  FileNodeView,
23
23
  FileWriteBody,
24
24
  HTTPValidationError,
25
- MintUploadUrl403Response,
25
+ ListModels403Response,
26
26
  PageFileNodeView,
27
27
  PageSkillView,
28
28
  PublishRequest,
@@ -49,8 +49,8 @@ import {
49
49
  FileWriteBodyToJSON,
50
50
  HTTPValidationErrorFromJSON,
51
51
  HTTPValidationErrorToJSON,
52
- MintUploadUrl403ResponseFromJSON,
53
- MintUploadUrl403ResponseToJSON,
52
+ ListModels403ResponseFromJSON,
53
+ ListModels403ResponseToJSON,
54
54
  PageFileNodeViewFromJSON,
55
55
  PageFileNodeViewToJSON,
56
56
  PageSkillViewFromJSON,
package/src/apis/index.ts CHANGED
@@ -8,7 +8,9 @@ export * from './ClarifyApi.js';
8
8
  export * from './CollectionsApi.js';
9
9
  export * from './ConversationsApi.js';
10
10
  export * from './CronsApi.js';
11
+ export * from './CustomAPIsApi.js';
11
12
  export * from './MessagesApi.js';
13
+ export * from './ModelsApi.js';
12
14
  export * from './QueueApi.js';
13
15
  export * from './ResponsesApi.js';
14
16
  export * from './SkillsApi.js';