@vertesia/client 0.78.0-dev-28b447d → 0.78.0-dev.1

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 (221) hide show
  1. package/lib/cjs/AccountApi.js +85 -0
  2. package/lib/cjs/AccountApi.js.map +1 -0
  3. package/lib/cjs/AccountsApi.js +16 -0
  4. package/lib/cjs/AccountsApi.js.map +1 -0
  5. package/lib/cjs/AnalyticsApi.js +13 -0
  6. package/lib/cjs/AnalyticsApi.js.map +1 -0
  7. package/lib/cjs/ApiKeysApi.js +63 -0
  8. package/lib/cjs/ApiKeysApi.js.map +1 -0
  9. package/lib/cjs/AppsApi.js +119 -0
  10. package/lib/cjs/AppsApi.js.map +1 -0
  11. package/lib/cjs/CommandsApi.js +19 -0
  12. package/lib/cjs/CommandsApi.js.map +1 -0
  13. package/lib/cjs/EnvironmentsApi.js +58 -0
  14. package/lib/cjs/EnvironmentsApi.js.map +1 -0
  15. package/lib/cjs/GroupsApi.js +78 -0
  16. package/lib/cjs/GroupsApi.js.map +1 -0
  17. package/lib/cjs/IamApi.js +53 -0
  18. package/lib/cjs/IamApi.js.map +1 -0
  19. package/lib/cjs/InteractionBase.js +44 -0
  20. package/lib/cjs/InteractionBase.js.map +1 -0
  21. package/lib/cjs/InteractionsApi.js +217 -0
  22. package/lib/cjs/InteractionsApi.js.map +1 -0
  23. package/lib/cjs/ProjectsApi.js +48 -0
  24. package/lib/cjs/ProjectsApi.js.map +1 -0
  25. package/lib/cjs/PromptsApi.js +133 -0
  26. package/lib/cjs/PromptsApi.js.map +1 -0
  27. package/lib/cjs/RefsApi.js +14 -0
  28. package/lib/cjs/RefsApi.js.map +1 -0
  29. package/lib/cjs/RunsApi.js +110 -0
  30. package/lib/cjs/RunsApi.js.map +1 -0
  31. package/lib/cjs/StreamSource.js +17 -0
  32. package/lib/cjs/StreamSource.js.map +1 -0
  33. package/lib/cjs/TrainingApi.js +54 -0
  34. package/lib/cjs/TrainingApi.js.map +1 -0
  35. package/lib/cjs/UsersApi.js +13 -0
  36. package/lib/cjs/UsersApi.js.map +1 -0
  37. package/lib/cjs/client.js +336 -0
  38. package/lib/cjs/client.js.map +1 -0
  39. package/lib/cjs/execute.js +158 -0
  40. package/lib/cjs/execute.js.map +1 -0
  41. package/lib/cjs/index.js +21 -0
  42. package/lib/cjs/index.js.map +1 -0
  43. package/lib/cjs/nodejs/NodeStreamSource.js +45 -0
  44. package/lib/cjs/nodejs/NodeStreamSource.js.map +1 -0
  45. package/lib/cjs/nodejs/index.js +18 -0
  46. package/lib/cjs/nodejs/index.js.map +1 -0
  47. package/lib/cjs/package.json +3 -0
  48. package/lib/cjs/store/AgentsApi.js +16 -0
  49. package/lib/cjs/store/AgentsApi.js.map +1 -0
  50. package/lib/cjs/store/AnalyzeDocApi.js +56 -0
  51. package/lib/cjs/store/AnalyzeDocApi.js.map +1 -0
  52. package/lib/cjs/store/CollectionsApi.js +101 -0
  53. package/lib/cjs/store/CollectionsApi.js.map +1 -0
  54. package/lib/cjs/store/CommandsApi.js +17 -0
  55. package/lib/cjs/store/CommandsApi.js.map +1 -0
  56. package/lib/cjs/store/EmbeddingsApi.js +29 -0
  57. package/lib/cjs/store/EmbeddingsApi.js.map +1 -0
  58. package/lib/cjs/store/FilesApi.js +147 -0
  59. package/lib/cjs/store/FilesApi.js.map +1 -0
  60. package/lib/cjs/store/ObjectsApi.js +281 -0
  61. package/lib/cjs/store/ObjectsApi.js.map +1 -0
  62. package/lib/cjs/store/TypesApi.js +57 -0
  63. package/lib/cjs/store/TypesApi.js.map +1 -0
  64. package/lib/cjs/store/WorkflowsApi.js +412 -0
  65. package/lib/cjs/store/WorkflowsApi.js.map +1 -0
  66. package/lib/cjs/store/client.js +61 -0
  67. package/lib/cjs/store/client.js.map +1 -0
  68. package/lib/cjs/store/errors.js +11 -0
  69. package/lib/cjs/store/errors.js.map +1 -0
  70. package/lib/cjs/store/index.js +22 -0
  71. package/lib/cjs/store/index.js.map +1 -0
  72. package/lib/cjs/store/version.js +6 -0
  73. package/lib/cjs/store/version.js.map +1 -0
  74. package/lib/esm/AccountApi.js +82 -0
  75. package/lib/esm/AccountApi.js.map +1 -0
  76. package/lib/esm/AccountsApi.js +13 -0
  77. package/lib/esm/AccountsApi.js.map +1 -0
  78. package/lib/esm/AnalyticsApi.js +10 -0
  79. package/lib/esm/AnalyticsApi.js.map +1 -0
  80. package/lib/esm/ApiKeysApi.js +59 -0
  81. package/lib/esm/ApiKeysApi.js.map +1 -0
  82. package/lib/esm/AppsApi.js +116 -0
  83. package/lib/esm/AppsApi.js.map +1 -0
  84. package/lib/esm/CommandsApi.js +16 -0
  85. package/lib/esm/CommandsApi.js.map +1 -0
  86. package/lib/esm/EnvironmentsApi.js +55 -0
  87. package/lib/esm/EnvironmentsApi.js.map +1 -0
  88. package/lib/esm/GroupsApi.js +74 -0
  89. package/lib/esm/GroupsApi.js.map +1 -0
  90. package/lib/esm/IamApi.js +47 -0
  91. package/lib/esm/IamApi.js.map +1 -0
  92. package/lib/esm/InteractionBase.js +40 -0
  93. package/lib/esm/InteractionBase.js.map +1 -0
  94. package/lib/esm/InteractionsApi.js +214 -0
  95. package/lib/esm/InteractionsApi.js.map +1 -0
  96. package/lib/esm/ProjectsApi.js +45 -0
  97. package/lib/esm/ProjectsApi.js.map +1 -0
  98. package/lib/esm/PromptsApi.js +130 -0
  99. package/lib/esm/PromptsApi.js.map +1 -0
  100. package/lib/esm/RefsApi.js +10 -0
  101. package/lib/esm/RefsApi.js.map +1 -0
  102. package/lib/esm/RunsApi.js +106 -0
  103. package/lib/esm/RunsApi.js.map +1 -0
  104. package/lib/esm/StreamSource.js +13 -0
  105. package/lib/esm/StreamSource.js.map +1 -0
  106. package/lib/esm/TrainingApi.js +51 -0
  107. package/lib/esm/TrainingApi.js.map +1 -0
  108. package/lib/esm/UsersApi.js +10 -0
  109. package/lib/esm/UsersApi.js.map +1 -0
  110. package/lib/esm/client.js +327 -0
  111. package/lib/esm/client.js.map +1 -0
  112. package/lib/esm/execute.js +118 -0
  113. package/lib/esm/execute.js.map +1 -0
  114. package/lib/esm/index.js +5 -0
  115. package/lib/esm/index.js.map +1 -0
  116. package/lib/esm/nodejs/NodeStreamSource.js +41 -0
  117. package/lib/esm/nodejs/NodeStreamSource.js.map +1 -0
  118. package/lib/esm/nodejs/index.js +2 -0
  119. package/lib/esm/nodejs/index.js.map +1 -0
  120. package/lib/esm/store/AgentsApi.js +12 -0
  121. package/lib/esm/store/AgentsApi.js.map +1 -0
  122. package/lib/esm/store/AnalyzeDocApi.js +52 -0
  123. package/lib/esm/store/AnalyzeDocApi.js.map +1 -0
  124. package/lib/esm/store/CollectionsApi.js +97 -0
  125. package/lib/esm/store/CollectionsApi.js.map +1 -0
  126. package/lib/esm/store/CommandsApi.js +13 -0
  127. package/lib/esm/store/CommandsApi.js.map +1 -0
  128. package/lib/esm/store/EmbeddingsApi.js +25 -0
  129. package/lib/esm/store/EmbeddingsApi.js.map +1 -0
  130. package/lib/esm/store/FilesApi.js +142 -0
  131. package/lib/esm/store/FilesApi.js.map +1 -0
  132. package/lib/esm/store/ObjectsApi.js +277 -0
  133. package/lib/esm/store/ObjectsApi.js.map +1 -0
  134. package/lib/esm/store/TypesApi.js +53 -0
  135. package/lib/esm/store/TypesApi.js.map +1 -0
  136. package/lib/esm/store/WorkflowsApi.js +406 -0
  137. package/lib/esm/store/WorkflowsApi.js.map +1 -0
  138. package/lib/esm/store/client.js +57 -0
  139. package/lib/esm/store/client.js.map +1 -0
  140. package/lib/esm/store/errors.js +7 -0
  141. package/lib/esm/store/errors.js.map +1 -0
  142. package/lib/esm/store/index.js +6 -0
  143. package/lib/esm/store/index.js.map +1 -0
  144. package/lib/esm/store/version.js +3 -0
  145. package/lib/esm/store/version.js.map +1 -0
  146. package/lib/tsconfig.tsbuildinfo +1 -0
  147. package/lib/types/AccountApi.d.ts +59 -0
  148. package/lib/types/AccountApi.d.ts.map +1 -0
  149. package/lib/types/AccountsApi.d.ts +7 -0
  150. package/lib/types/AccountsApi.d.ts.map +1 -0
  151. package/lib/types/AnalyticsApi.d.ts +6 -0
  152. package/lib/types/AnalyticsApi.d.ts.map +1 -0
  153. package/lib/types/ApiKeysApi.d.ts +42 -0
  154. package/lib/types/ApiKeysApi.d.ts.map +1 -0
  155. package/lib/types/AppsApi.d.ts +65 -0
  156. package/lib/types/AppsApi.d.ts.map +1 -0
  157. package/lib/types/CommandsApi.d.ts +10 -0
  158. package/lib/types/CommandsApi.d.ts.map +1 -0
  159. package/lib/types/EnvironmentsApi.d.ts +30 -0
  160. package/lib/types/EnvironmentsApi.d.ts.map +1 -0
  161. package/lib/types/GroupsApi.d.ts +65 -0
  162. package/lib/types/GroupsApi.d.ts.map +1 -0
  163. package/lib/types/IamApi.d.ts +41 -0
  164. package/lib/types/IamApi.d.ts.map +1 -0
  165. package/lib/types/InteractionBase.d.ts +22 -0
  166. package/lib/types/InteractionBase.d.ts.map +1 -0
  167. package/lib/types/InteractionsApi.d.ts +157 -0
  168. package/lib/types/InteractionsApi.d.ts.map +1 -0
  169. package/lib/types/ProjectsApi.d.ts +17 -0
  170. package/lib/types/ProjectsApi.d.ts.map +1 -0
  171. package/lib/types/PromptsApi.d.ts +106 -0
  172. package/lib/types/PromptsApi.d.ts.map +1 -0
  173. package/lib/types/RefsApi.d.ts +6 -0
  174. package/lib/types/RefsApi.d.ts.map +1 -0
  175. package/lib/types/RunsApi.d.ts +78 -0
  176. package/lib/types/RunsApi.d.ts.map +1 -0
  177. package/lib/types/StreamSource.d.ts +7 -0
  178. package/lib/types/StreamSource.d.ts.map +1 -0
  179. package/lib/types/TrainingApi.d.ts +27 -0
  180. package/lib/types/TrainingApi.d.ts.map +1 -0
  181. package/lib/types/UsersApi.d.ts +6 -0
  182. package/lib/types/UsersApi.d.ts.map +1 -0
  183. package/lib/types/client.d.ts +122 -0
  184. package/lib/types/client.d.ts.map +1 -0
  185. package/lib/types/execute.d.ts +37 -0
  186. package/lib/types/execute.d.ts.map +1 -0
  187. package/lib/types/index.d.ts +8 -0
  188. package/lib/types/index.d.ts.map +1 -0
  189. package/lib/types/nodejs/NodeStreamSource.d.ts +9 -0
  190. package/lib/types/nodejs/NodeStreamSource.d.ts.map +1 -0
  191. package/lib/types/nodejs/index.d.ts +1 -0
  192. package/lib/types/nodejs/index.d.ts.map +1 -0
  193. package/lib/types/store/AgentsApi.d.ts +6 -0
  194. package/lib/types/store/AgentsApi.d.ts.map +1 -0
  195. package/lib/types/store/AnalyzeDocApi.d.ts +17 -0
  196. package/lib/types/store/AnalyzeDocApi.d.ts.map +1 -0
  197. package/lib/types/store/CollectionsApi.d.ts +66 -0
  198. package/lib/types/store/CollectionsApi.d.ts.map +1 -0
  199. package/lib/types/store/CommandsApi.d.ts +10 -0
  200. package/lib/types/store/CommandsApi.d.ts.map +1 -0
  201. package/lib/types/store/EmbeddingsApi.d.ts +12 -0
  202. package/lib/types/store/EmbeddingsApi.d.ts.map +1 -0
  203. package/lib/types/store/FilesApi.d.ts +47 -0
  204. package/lib/types/store/FilesApi.d.ts.map +1 -0
  205. package/lib/types/store/ObjectsApi.d.ts +122 -0
  206. package/lib/types/store/ObjectsApi.d.ts.map +1 -0
  207. package/lib/types/store/TypesApi.d.ts +23 -0
  208. package/lib/types/store/TypesApi.d.ts.map +1 -0
  209. package/lib/types/store/WorkflowsApi.d.ts +62 -0
  210. package/lib/types/store/WorkflowsApi.d.ts.map +1 -0
  211. package/lib/types/store/client.d.ts +34 -0
  212. package/lib/types/store/client.d.ts.map +1 -0
  213. package/lib/types/store/errors.d.ts +4 -0
  214. package/lib/types/store/errors.d.ts.map +1 -0
  215. package/lib/types/store/index.d.ts +5 -0
  216. package/lib/types/store/index.d.ts.map +1 -0
  217. package/lib/types/store/version.d.ts +3 -0
  218. package/lib/types/store/version.d.ts.map +1 -0
  219. package/lib/vertesia-client.js +2 -0
  220. package/lib/vertesia-client.js.map +1 -0
  221. package/package.json +59 -59
@@ -0,0 +1,157 @@
1
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
+ import { AsyncExecutionPayload, ComputeInteractionFacetPayload, ExecutionRun, GenerateInteractionPayload, GenerateTestDataPayload, ImprovePromptPayload, Interaction, InteractionCreatePayload, InteractionEndpoint, InteractionEndpointQuery, InteractionExecutionPayload, InteractionExecutionResult, InteractionForkPayload, InteractionPublishPayload, InteractionRef, InteractionRefWithSchema, InteractionSearchPayload, InteractionUpdatePayload, InteractionsExportPayload, RateLimitRequestPayload, RateLimitRequestResponse } from "@vertesia/common";
3
+ import { CompletionResult } from "@llumiverse/common";
4
+ export interface ComputeInteractionFacetsResponse {
5
+ tags?: {
6
+ _id: string;
7
+ count: number;
8
+ }[];
9
+ status?: {
10
+ _id: string;
11
+ count: number;
12
+ }[];
13
+ total?: {
14
+ count: number;
15
+ }[];
16
+ }
17
+ export interface AsyncExecutionResult {
18
+ runId: string;
19
+ workflowId: string;
20
+ }
21
+ export default class InteractionsApi extends ApiTopic {
22
+ constructor(parent: ClientBase);
23
+ /**
24
+ * Get the list of all interactions in the current project
25
+ * @returns InteractionRef[]
26
+ **/
27
+ list(payload?: InteractionSearchPayload): Promise<InteractionRef[]>;
28
+ /**
29
+ * Find interactions given a mongo match query.
30
+ * You can also specify if prompts schemas are included in the result
31
+ */
32
+ listEndpoints(payload: InteractionEndpointQuery): Promise<InteractionEndpoint[]>;
33
+ /**
34
+ * List all interaction versions in the project having the given endpoint name.
35
+ * This is useful to list orphaned versions
36
+ * @param name
37
+ */
38
+ listVersionsByName(name: string): Promise<InteractionRef[]>;
39
+ /**
40
+ * Get the list of all interactions facets
41
+ * @param payload query payload to filter facet search
42
+ * @returns ComputeInteractionFacetsResponse[]
43
+ **/
44
+ computeFacets(query: ComputeInteractionFacetPayload): Promise<ComputeInteractionFacetsResponse>;
45
+ /**
46
+ * List interaction names in the current project
47
+ * @returns
48
+ */
49
+ listNames(): Promise<{
50
+ id: string;
51
+ name: string;
52
+ }[]>;
53
+ /**
54
+ * Get the list of all interactions in the current project. Schemas will be returned too.
55
+ * @returns InteractionRefWithSchema[]
56
+ **/
57
+ export(payload: InteractionsExportPayload): Promise<InteractionRefWithSchema[]>;
58
+ /**
59
+ * Create a new interaction
60
+ * @param payload InteractionCreatePayload
61
+ * @returns Interaction
62
+ * @throws ApiError
63
+ * @throws 400 if payload is invalid
64
+ * @throws 500 if interaction creation fails
65
+ **/
66
+ create(payload: InteractionCreatePayload): Promise<Interaction>;
67
+ /**
68
+ * Retrieve an existing interaction definition
69
+ * @param id of the interaction to retrieve
70
+ * @returns Interaction
71
+ **/
72
+ retrieve(id: string): Promise<Interaction>;
73
+ /**
74
+ * Update an existing interaction definition
75
+ * @param id of the interaction to update
76
+ * @param payload InteractionUpdatePayload
77
+ * @returns Interaction
78
+ * @throws ApiError
79
+ * @throws 400 if payload is invalid
80
+ * @throws 500 if interaction update fails
81
+ * @throws 404 if interaction not found
82
+ **/
83
+ update(id: string, payload: InteractionUpdatePayload): Promise<Interaction>;
84
+ /**
85
+ * Execute an interaction and return a promise which will be resolved with the executed run when
86
+ * the run completes or fails.
87
+ * If the onChunk callback is passed then the streaming of the result is enabled.
88
+ * The onChunk callback with be called with the next chunk of the result as soon as it is available.
89
+ * When all chunks are received the function will return the resolved promise
90
+ * @param id of the interaction to execute
91
+ * @param payload InteractionExecutionPayload
92
+ * @param onChunk callback to be called when the next chunk of the response is available
93
+ * @returns Promise<ExecutionRun>
94
+ * @throws ApiError
95
+ * @throws 404 if interaction not found
96
+ * @throws 400 if payload is invalid
97
+ * @throws 500 if interaction execution fails
98
+ * @throws 500 if interaction execution times out
99
+ **/
100
+ execute<P = any>(id: string, payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<ExecutionRun<P>>;
101
+ /**
102
+ * Same as execute but uses the interaction name selector instead of the id.
103
+ *
104
+ * A name selector is the interaction endpoint name suffixed with an optional tag or version which is starting with a `@` character.
105
+ * The special `draft` tag is used to select the draft version of the interaction. If no tag or version is specified then the latest version is selected.
106
+ * Examples of selectors:
107
+ * - `ReviewContract` - select the latest version of the ReviewContract interaction
108
+ * - `ReviewContract@1` - select the version 1 of the ReviewContract interaction
109
+ * - `ReviewContract@draft` - select the draft version of the ReviewContract interaction
110
+ * - `ReviewContract@fixed` - select the ReviewContract interaction which is tagged with 'fixed' tag.
111
+ * @param nameWithTag
112
+ * @param payload
113
+ * @param onChunk
114
+ * @returns
115
+ */
116
+ executeByName<P = any>(nameWithTag: string, payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<InteractionExecutionResult<P>>;
117
+ /**
118
+ * Execute an interaction in an workflow
119
+ * @param payload
120
+ * @returns
121
+ */
122
+ executeAsync(payload: AsyncExecutionPayload): Promise<AsyncExecutionResult>;
123
+ publish(id: string, payload: InteractionPublishPayload): Promise<Interaction>;
124
+ fork(id: string, payload: InteractionForkPayload): Promise<Interaction>;
125
+ /**
126
+ * Generate Composable definition of an interaction
127
+ **/
128
+ generateInteraction(id: string, payload: GenerateInteractionPayload): Promise<any[]>;
129
+ /**
130
+ * Generate Test Data for an interaction
131
+ **/
132
+ generateTestData(id: string, payload: GenerateTestDataPayload): Promise<any[]>;
133
+ /**
134
+ * Suggest Improvement for a prompt
135
+ */
136
+ suggestImprovements(id: string, payload: ImprovePromptPayload): Promise<{
137
+ result: CompletionResult[];
138
+ }>;
139
+ /**
140
+ * List the versions of the interaction. Returns an empty array if no versions are found
141
+ * @param id
142
+ * @returns the versions list or an empty array if no versions are found
143
+ */
144
+ listVersions(id: string): Promise<InteractionRef[]>;
145
+ /**
146
+ * List the forks of the interaction. Returns an empty array if no forks are found
147
+ * @param id
148
+ * @returns the versions list or an empty array if no forks are found
149
+ */
150
+ listForks(id: string): Promise<InteractionRef[]>;
151
+ /**
152
+ * Request a time slot to execute an interaction with a given environment / model
153
+ * @param payload RateLimitRequestPayload
154
+ * @returns RateLimitRequestResponse with delay_ms
155
+ */
156
+ requestSlot(payload: RateLimitRequestPayload): Promise<RateLimitRequestResponse>;
157
+ }
@@ -0,0 +1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,EAAE,yBAAyB,GAAG,OAAO,CAAC,WAAW,CAAC;IAM7E,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC;IAMvE;;QAEI;IACJ,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAQpF;;QAEI;IACJ,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAO9E;;OAEG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;KAAE,CAAC;IAMxG;;;;OAIG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAInD;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAIhD;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAInF"}
@@ -0,0 +1,17 @@
1
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
+ import { AwsConfiguration, GithubConfiguration, GladiaConfiguration, ICreateProjectPayload, MagicPdfConfiguration, Project, ProjectIntegrationListEntry, ProjectRef, SupportedIntegrations } from "@vertesia/common";
3
+ export default class ProjectsApi extends ApiTopic {
4
+ constructor(parent: ClientBase);
5
+ list(account?: string[]): Promise<ProjectRef[]>;
6
+ retrieve(projectId: string): Promise<Project>;
7
+ create(payload: ICreateProjectPayload): Promise<Project>;
8
+ update(projectId: string, payload: Partial<Project>): Promise<Project>;
9
+ integrations: IntegrationsConfigurationApi;
10
+ }
11
+ declare class IntegrationsConfigurationApi extends ApiTopic {
12
+ constructor(parent: ClientBase);
13
+ list(projectId: string): Promise<ProjectIntegrationListEntry[]>;
14
+ retrieve(projectId: string, integrationId: SupportedIntegrations): Promise<GladiaConfiguration | GithubConfiguration | AwsConfiguration | MagicPdfConfiguration | undefined>;
15
+ update(projectId: string, integrationId: string, payload: any): Promise<GladiaConfiguration | GithubConfiguration>;
16
+ }
17
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectsApi.d.ts","sourceRoot":"","sources":["../../src/ProjectsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAErN,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;gBACjC,MAAM,EAAE,UAAU;IAI9B,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAI/C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7C,MAAM,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IAMxD,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAMtE,YAAY,EAAE,4BAA4B,CAA0C;CAEvF;AAED,cAAM,4BAA6B,SAAQ,QAAQ;gBAEnC,MAAM,EAAE,UAAU;IAI9B,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,EAAE,CAAC;IAI/D,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,GAAG,mBAAmB,GAAG,gBAAgB,GAAG,qBAAqB,GAAG,SAAS,CAAC;IAS5K,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;CAMrH"}
@@ -0,0 +1,106 @@
1
+ import { ComputePromptFacetPayload, PromptSearchPayload, PromptTemplate, PromptTemplateForkPayload, PromptTemplateCreatePayload, PromptTemplateRef, PromptTemplateUpdatePayload } from "@vertesia/common";
2
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
3
+ export interface ComputePromptFacetsResponse {
4
+ role?: {
5
+ _id: string;
6
+ count: number;
7
+ }[];
8
+ total?: {
9
+ count: number;
10
+ }[];
11
+ }
12
+ export default class PromptsApi extends ApiTopic {
13
+ constructor(parent: ClientBase);
14
+ /**
15
+ * Get the list of all prompt templates
16
+ * @param payload query payload to filter search
17
+ * @returns PromptTemplateRef[]
18
+ **/
19
+ list(payload?: PromptSearchPayload): Promise<PromptTemplateRef[]>;
20
+ /**
21
+ * Get the list of all prompt facets
22
+ * @param payload query payload to filter facet search
23
+ * @returns ComputePromptFacetsResponse[]
24
+ **/
25
+ computeFacets(query: ComputePromptFacetPayload): Promise<ComputePromptFacetsResponse>;
26
+ /**
27
+ * Create a new prompt template
28
+ * @param payload PromptTemplateCreatePayload
29
+ * @returns PromptTemplate
30
+ * @throws ApiError
31
+ * @throws 400 if payload is invalid
32
+ * @throws 500 if creation fails
33
+ **/
34
+ create(payload: PromptTemplateCreatePayload): Promise<PromptTemplate>;
35
+ /**
36
+ * Retrieve an existing prompt template
37
+ * @param id of the prompt template to retrieve
38
+ * @returns PromptTemplate
39
+ **/
40
+ retrieve(id: string): Promise<PromptTemplate>;
41
+ /**
42
+ * Update an existing prompt template
43
+ * @param id of the prompt template to update
44
+ * @param payload PromptTemplateCreatePayload
45
+ * @returns PromptTemplate
46
+ * @throws ApiError
47
+ * @throws 400 if payload is invalid
48
+ * @throws 500 if update fails
49
+ * @throws 404 if not found
50
+ **/
51
+ update(id: string, payload: PromptTemplateUpdatePayload): Promise<PromptTemplate>;
52
+ /**
53
+ * Delete an existing prompt template
54
+ * @param id of the prompt template to delete
55
+ * @returns void
56
+ */
57
+ delete(id: string): Promise<void>;
58
+ /**
59
+ * Fork an existing prompt template
60
+ * @param id of the prompt template to fork
61
+ * @param payload PromptTemplateForkPayload
62
+ * @returns Forked PromptTemplate
63
+ */
64
+ fork(id: string, payload: PromptTemplateForkPayload): Promise<PromptTemplate>;
65
+ /**
66
+ * Render a prompt template
67
+ * @param id of the prompt template to render
68
+ * @param payload that will be passed to the prompt template to generate the prompts
69
+ * @returns PromptTemplate
70
+ * @throws ApiError
71
+ * @throws 404 if not found
72
+ * @throws 400 if payload is invalid
73
+ * @throws 500 if render fails
74
+ **/
75
+ render(id: string, payload: {}): Promise<PromptTemplate>;
76
+ /**
77
+ * Get options for a field
78
+ * @param field name to get options for
79
+ * @returns string[]
80
+ */
81
+ options(field: string): Promise<string[]>;
82
+ /**
83
+ * List the versions of the prompt template. Returns an empty array if no versions are found
84
+ * @param id
85
+ * @returns the versions list or an empty array if no versions are found
86
+ */
87
+ listVersions(id: string): Promise<PromptTemplateRef[]>;
88
+ /**
89
+ * Retrieve list of interactions that use the prompt template
90
+ */
91
+ listInteractions(id: string): Promise<ListInteractionsResponse>;
92
+ /**
93
+ * List the forks of the prompt. Returns an empty array if no forks are found
94
+ * @param id of the prompt to search forks
95
+ * @returns the versions list or an empty array if no forks are found
96
+ */
97
+ listForks(id: string): Promise<PromptTemplateRef[]>;
98
+ }
99
+ export interface ListInteractionsResponse {
100
+ prompt: string;
101
+ interactions: {
102
+ id: string;
103
+ name: string;
104
+ versions: string[];
105
+ }[];
106
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PromptsApi.d.ts","sourceRoot":"","sources":["../../src/PromptsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yB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C;IAMxD;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIzC;;;;OAIG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAKtD;;OAEG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAI/D;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAItD;AAED,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAA;CACN"}
@@ -0,0 +1,6 @@
1
+ import { ResolvableRef, ResourceRef } from "@vertesia/common";
2
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
3
+ export declare class RefsApi extends ApiTopic {
4
+ constructor(parent: ClientBase);
5
+ resolve(refs: ResolvableRef[]): Promise<ResourceRef[]>;
6
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefsApi.d.ts","sourceRoot":"","sources":["../../src/RefsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAGjE,qBAAa,OAAQ,SAAQ,QAAQ;gBAErB,MAAM,EAAE,UAAU;IAK9B,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAMzD"}
@@ -0,0 +1,78 @@
1
+ import type { ExecutionResponse } from "@llumiverse/common";
2
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
3
+ import { CheckpointConversationPayload, ComputeRunFacetPayload, ExecutionRun, ExecutionRunRef, FindPayload, PopulatedExecutionRun, RunCreatePayload, RunListingFilters, RunListingQueryOptions, RunSearchPayload, ToolResultsPayload, UserMessagePayload } from "@vertesia/common";
4
+ export interface FilterOption {
5
+ id: string;
6
+ name: string;
7
+ count: number;
8
+ }
9
+ export interface ComputeRunFacetsResponse {
10
+ environments?: {
11
+ _id: string;
12
+ count: number;
13
+ }[];
14
+ interactions?: {
15
+ _id: string;
16
+ count: number;
17
+ }[];
18
+ models?: {
19
+ _id: string;
20
+ count: number;
21
+ }[];
22
+ tags?: {
23
+ _id: string;
24
+ count: number;
25
+ }[];
26
+ status?: {
27
+ _id: string;
28
+ count: number;
29
+ }[];
30
+ total?: {
31
+ count: number;
32
+ }[];
33
+ }
34
+ export declare class RunsApi extends ApiTopic {
35
+ constructor(parent: ClientBase);
36
+ /**
37
+ * Get the list of all runs
38
+ * @param project optional project id to filter by
39
+ * @param interaction optional interaction id to filter by
40
+ * @returns InteractionResult[]
41
+ **/
42
+ list({ limit, offset, filters }: RunListingQueryOptions): Promise<ExecutionRunRef[]>;
43
+ find(payload: FindPayload): Promise<ExecutionRun[]>;
44
+ /**
45
+ * Get a run by id
46
+ *
47
+ * @param id
48
+ * @returns InteractionResult
49
+ **/
50
+ retrieve<P = any>(id: string): Promise<ExecutionRun<P>>;
51
+ retrievePopulated<P = any>(id: string): Promise<PopulatedExecutionRun<P>>;
52
+ /**
53
+ * Get filter options for a field
54
+ * return FilterOption[]
55
+ */
56
+ filterOptions(field: string, filters: RunListingFilters): Promise<FilterOption[]>;
57
+ create(payload: RunCreatePayload): Promise<ExecutionRun>;
58
+ /**
59
+ * Send tool results and continues the conversation
60
+ * @param payload
61
+ * @returns
62
+ */
63
+ sendToolResults(payload: ToolResultsPayload): Promise<ExecutionResponse>;
64
+ /**
65
+ *
66
+ * @param payload
67
+ * @returns
68
+ */
69
+ sendUserMessage(payload: UserMessagePayload): Promise<ExecutionResponse>;
70
+ createCheckpoint(payload: CheckpointConversationPayload): Promise<ExecutionResponse>;
71
+ /**
72
+ * Get the list of all runs facets
73
+ * @param payload query payload to filter facet search
74
+ * @returns ComputeRunFacetsResponse[]
75
+ **/
76
+ computeFacets(query: ComputeRunFacetPayload): Promise<ComputeRunFacetsResponse>;
77
+ search(payload: RunSearchPayload): Promise<ExecutionRunRef[]>;
78
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RunsApi.d.ts","sourceRoot":"","sources":["../../src/RunsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,6BAA6B,EAC7B,sBAAsB,EACtB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACrB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACrC,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxC,MAAM,CAAC,E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AAO,CAAC,eAAe,EAAE,CAAC;CAKhE"}
@@ -0,0 +1,7 @@
1
+ export declare class StreamSource {
2
+ stream: ReadableStream;
3
+ name: string;
4
+ type?: string | undefined;
5
+ id?: string | undefined;
6
+ constructor(stream: ReadableStream, name: string, type?: string | undefined, id?: string | undefined);
7
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StreamSource.d.ts","sourceRoot":"","sources":["../../src/StreamSource.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACF,MAAM,EAAE,cAAc;IAAS,IAAI,EAAE,MAAM;IAAS,IAAI,CAAC,EAAE,MAAM;IAAS,EAAE,CAAC,EAAE,MAAM;gBAArF,MAAM,EAAE,cAAc,EAAS,IAAI,EAAE,MAAM,EAAS,IAAI,CAAC,EAAE,MAAM,YAAA,EAAS,EAAE,CAAC,EAAE,MAAM,YAAA;CAC3G"}
@@ -0,0 +1,27 @@
1
+ import type { TrainingJob } from "@llumiverse/common";
2
+ import { ExecutionRunRef, ListTrainingSessionsQuery, TrainingSession, TrainingSessionCreatePayload, TrainingSessionRef } from "@vertesia/common";
3
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
4
+ export default class TrainingApi extends ApiTopic {
5
+ constructor(parent: ClientBase);
6
+ listSessions(query?: ListTrainingSessionsQuery): Promise<TrainingSessionRef[]>;
7
+ listSessionNames(query?: ListTrainingSessionsQuery): Promise<{
8
+ id: string;
9
+ name: string;
10
+ }[]>;
11
+ createSession(payload: TrainingSessionCreatePayload): Promise<TrainingSession>;
12
+ getSession(sessionId: string): Promise<TrainingSession>;
13
+ addToSession(sessionId: string, runs: string[]): Promise<any>;
14
+ listSessionRuns(sessionId: string, limit?: number, offset?: number): Promise<ExecutionRunRef[]>;
15
+ buildSession(sessionId: string): Promise<any>;
16
+ getDataUrl(sessionId: string): Promise<{
17
+ url: string;
18
+ }>;
19
+ getDataUploadUrl(sessionId: string, isResumable?: boolean): Promise<{
20
+ url: string;
21
+ }>;
22
+ startTraining(sessionId: string): Promise<TrainingJob>;
23
+ cancelTraining(sessionId: string): Promise<TrainingJob>;
24
+ getTrainingJob(jobId: string): Promise<TrainingJob>;
25
+ getAndSyncTrainingJob(jobId: string): Promise<TrainingJob>;
26
+ setDataset(sessionId: string, name?: string): Promise<any>;
27
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrainingApi.d.ts","sourceRoot":"","sources":["../../src/TrainingApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,eAAe,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACjJ,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;gBAEjC,MAAM,EAAE,UAAU;IAI9B,YAAY,CAAC,KAAK,GAAE,yBAA8B,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAIlF,gBAAgB,CAAC,KAAK,GAAE,yBAA8B,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAIhG,aAAa,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,eAAe,CAAC;IAI9E,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAIvD,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAI7D,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,SAAM,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIvF,YAAY,CAAC,SAAS,EAAE,MAAM;IAI9B,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAIvD,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,UAAQ,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAKlF,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAItD,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAIvD,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAInD,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM1D,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;CAIxE"}
@@ -0,0 +1,6 @@
1
+ import { User } from "@vertesia/common";
2
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
3
+ export default class UsersApi extends ApiTopic {
4
+ constructor(parent: ClientBase);
5
+ retrieve(userId: string): Promise<User>;
6
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UsersApi.d.ts","sourceRoot":"","sources":["../../src/UsersApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAKlE,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,QAAQ;gBAE9B,MAAM,EAAE,UAAU;IAI9B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAK1C"}
@@ -0,0 +1,122 @@
1
+ import { AbstractFetchClient } from "@vertesia/api-fetch-client";
2
+ import { AuthTokenPayload, AuthTokenResponse } from "@vertesia/common";
3
+ import AccountApi from "./AccountApi.js";
4
+ import AccountsApi from "./AccountsApi.js";
5
+ import AnalyticsApi from "./AnalyticsApi.js";
6
+ import { ApiKeysApi } from "./ApiKeysApi.js";
7
+ import AppsApi from "./AppsApi.js";
8
+ import CommandsApi from "./CommandsApi.js";
9
+ import EnvironmentsApi from "./EnvironmentsApi.js";
10
+ import { IamApi } from "./IamApi.js";
11
+ import InteractionsApi from "./InteractionsApi.js";
12
+ import ProjectsApi from "./ProjectsApi.js";
13
+ import PromptsApi from "./PromptsApi.js";
14
+ import { RefsApi } from "./RefsApi.js";
15
+ import { RunsApi } from "./RunsApi.js";
16
+ import { ZenoClient } from "./store/client.js";
17
+ import TrainingApi from "./TrainingApi.js";
18
+ import UsersApi from "./UsersApi.js";
19
+ export type VertesiaClientProps = {
20
+ /**
21
+ * The site name of Vertesia.
22
+ *
23
+ * This is used to determine the API backend. It should not include the protocol. For more
24
+ * advanced configurations, use `serverUrl` and `storeUrl` instead.
25
+ *
26
+ * @example api.vertesia.io
27
+ * @example api-preview.vertesia.io
28
+ * @example api-staging.vertesia.io
29
+ * @default api.vertesia.io
30
+ * @since 0.52.0
31
+ */
32
+ site?: "api.vertesia.io" | "api-preview.vertesia.io" | "api-staging.vertesia.io";
33
+ serverUrl?: string;
34
+ storeUrl?: string;
35
+ tokenServerUrl?: string;
36
+ apikey?: string;
37
+ projectId?: string;
38
+ sessionTags?: string | string[];
39
+ onRequest?: (request: Request) => void;
40
+ onResponse?: (response: Response) => void;
41
+ };
42
+ export declare class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
43
+ /**
44
+ * The JWT token linked to the API KEY (sk or pk)
45
+ */
46
+ _jwt: string | null;
47
+ /**
48
+ * The store client
49
+ */
50
+ store: ZenoClient;
51
+ /**
52
+ * The session name will be sent when executing an interaction as a tag
53
+ */
54
+ sessionTags?: string | string[];
55
+ /**
56
+ * tokenServerUrl
57
+ */
58
+ tokenServerUrl: string;
59
+ /**
60
+ * Create a client from the given token.
61
+ * If you already have the decoded token you can pass it as the second argument to avoid decodinf it again.
62
+ *
63
+ * @param token the raw JWT token
64
+ * @param payload the decoded JWT token as an AuthTokenPayload - optional
65
+ */
66
+ static fromAuthToken(token: string, payload?: AuthTokenPayload): Promise<VertesiaClient>;
67
+ static decodeEndpoints(): void;
68
+ constructor(opts?: VertesiaClientProps);
69
+ /**
70
+ * Overwrite to keep store and composable clients synchronized on the auth callback
71
+ * @param authCb
72
+ * @returns
73
+ */
74
+ withAuthCallback(authCb?: (() => Promise<string>) | null): this;
75
+ withApiKey(apiKey: string | null): Promise<this>;
76
+ getRawJWT(): Promise<string | null>;
77
+ getDecodedJWT(): Promise<AuthTokenPayload | null>;
78
+ getProject(): Promise<import("@vertesia/common").ProjectRef | null>;
79
+ getAccount(): Promise<import("@vertesia/common").AccountRef | null>;
80
+ /**
81
+ * Alias for store.workflows
82
+ */
83
+ get workflows(): import("./index.js").WorkflowsApi;
84
+ /**
85
+ * Alias for store.objects
86
+ */
87
+ get objects(): import("./index.js").ObjectsApi;
88
+ get files(): import("./store/FilesApi.js").FilesApi;
89
+ /**
90
+ * Alias for store.types
91
+ */
92
+ get types(): import("./index.js").TypesApi;
93
+ get storeUrl(): string;
94
+ /**
95
+ *
96
+ * Generate a token for use with other Vertesia's services
97
+ *
98
+ * @returns AuthTokenResponse
99
+ */
100
+ getAuthToken(token?: string): Promise<AuthTokenResponse>;
101
+ get initialHeaders(): {
102
+ 'X-Api-Version': string;
103
+ accept: string;
104
+ };
105
+ projects: ProjectsApi;
106
+ environments: EnvironmentsApi;
107
+ interactions: InteractionsApi;
108
+ prompts: PromptsApi;
109
+ runs: RunsApi;
110
+ account: AccountApi;
111
+ accounts: AccountsApi;
112
+ apikeys: ApiKeysApi;
113
+ analytics: AnalyticsApi;
114
+ training: TrainingApi;
115
+ users: UsersApi;
116
+ iam: IamApi;
117
+ refs: RefsApi;
118
+ commands: CommandsApi;
119
+ apps: AppsApi;
120
+ }
121
+ export declare function decodeJWT(jwt: string): AuthTokenPayload;
122
+ export declare function decodeEndpoints(endpoints: string | Record<string, string> | undefined): Record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IACjC,OAAO,aAAwB;IAC/B,SAAS,eAA0B;IACnC,QAAQ,cAAyB;IACjC,KAAK,WAAsB;IAC3B,GAAG,SAAoB;IACvB,IAAI,UAAqB;IACzB,QAAQ,cAAyB;IACjC,IAAI,UAAqB;CAC5B;AAiBD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAIvD;AA2BD,wBAAgB,eAAe,CAC3B,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACvD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASxB"}
@@ -0,0 +1,37 @@
1
+ import { AsyncExecutionPayload, InteractionExecutionPayload, InteractionExecutionResult, RateLimitRequestPayload, RateLimitRequestResponse } from '@vertesia/common';
2
+ import { VertesiaClient } from './client.js';
3
+ export declare function EventSourceProvider(): Promise<typeof EventSource>;
4
+ /**
5
+ *
6
+ * Execute an interaction and return a promise which will be resolved with the executed run when
7
+ * the run completes or fails.
8
+ * If the onChunk callback is passed then the streaming of the result is enabled.
9
+ * The onChunk callback with be called with the next chunk of the result as soon as it is available.
10
+ * When all chunks are received the function will return the resolved promise
11
+ * @param id of the interaction to execute
12
+ * @param payload InteractionExecutionPayload
13
+ * @param onChunk callback to be called when the next chunk of the response is available
14
+ */
15
+ export declare function executeInteraction<P = any>(client: VertesiaClient, interactionId: string, payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<InteractionExecutionResult<P>>;
16
+ /**
17
+ * Same as executeInteraction but uses the interaction name selector instead of the id.
18
+ * A name selector is the interaction endpoint name suffixed with an optional tag or version which is starting with a `@` character.
19
+ * The special `draft` tag is used to select the draft version of the interaction. If no tag or version is specified then the latest version is selected.
20
+ * Examples of selectors:
21
+ * - `ReviewContract` - select the latest version of the ReviewContract interaction
22
+ * - `ReviewContract@1` - select the version 1 of the ReviewContract interaction
23
+ * - `ReviewContract@draft` - select the draft version of the ReviewContract interaction
24
+ * - `ReviewContract@fixed` - select the ReviewContract interaction which is tagged with 'fixed' tag.
25
+ *
26
+ * @param client
27
+ * @param interaction
28
+ * @param payload
29
+ * @param onChunk
30
+ * @returns
31
+ */
32
+ export declare function executeInteractionByName<P = any>(client: VertesiaClient, interaction: string, payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<InteractionExecutionResult<P>>;
33
+ export declare function executeInteractionAsync(client: VertesiaClient, payload: AsyncExecutionPayload): Promise<{
34
+ runId: string;
35
+ workflowId: string;
36
+ }>;
37
+ export declare function checkRateLimit(client: VertesiaClient, payload: RateLimitRequestPayload): Promise<RateLimitRequestResponse>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAsB,2BAA2B,EAAE,0BAA0B,EAAoC,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC3N,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,WAAW,CAAC,CAMvE;AACD;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,cAAc,EACpE,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,2BAAgC,EACzC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAY7E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wBAAwB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,cAAc,EAC1E,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,2BAAgC,EACzC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAgB7E;AA0CD,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAIpJ;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAIhI"}
@@ -0,0 +1,8 @@
1
+ export * from './client.js';
2
+ export * from './InteractionBase.js';
3
+ export type { AsyncExecutionResult, ComputeInteractionFacetsResponse } from './InteractionsApi.js';
4
+ export type { ComputePromptFacetsResponse, ListInteractionsResponse } from './PromptsApi.js';
5
+ export type { ComputeRunFacetsResponse, FilterOption } from './RunsApi.js';
6
+ export type { GroupsQueryOptions } from './GroupsApi.js';
7
+ export * from "./store/index.js";
8
+ export * from "./StreamSource.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,YAAY,EAAE,oBAAoB,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AACnG,YAAY,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,YAAY,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Readable } from "node:stream";
2
+ import { StreamSource } from "../StreamSource.js";
3
+ /**
4
+ * A stream source that wraps a Node.js Readable stream.
5
+ * This class is only works in Node.js environments.
6
+ */
7
+ export declare class NodeStreamSource extends StreamSource {
8
+ constructor(stream: Readable, name: string, type?: string, id?: string);
9
+ }