@vertesia/client 0.80.1 → 0.81.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 (246) 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/InteractionCatalogApi.js +64 -0
  22. package/lib/cjs/InteractionCatalogApi.js.map +1 -0
  23. package/lib/cjs/InteractionOutput.js +300 -0
  24. package/lib/cjs/InteractionOutput.js.map +1 -0
  25. package/lib/cjs/InteractionResult.example.js +57 -0
  26. package/lib/cjs/InteractionResult.example.js.map +1 -0
  27. package/lib/cjs/InteractionsApi.js +243 -0
  28. package/lib/cjs/InteractionsApi.js.map +1 -0
  29. package/lib/cjs/ProjectsApi.js +53 -0
  30. package/lib/cjs/ProjectsApi.js.map +1 -0
  31. package/lib/cjs/PromptsApi.js +133 -0
  32. package/lib/cjs/PromptsApi.js.map +1 -0
  33. package/lib/cjs/RefsApi.js +14 -0
  34. package/lib/cjs/RefsApi.js.map +1 -0
  35. package/lib/cjs/RunsApi.js +113 -0
  36. package/lib/cjs/RunsApi.js.map +1 -0
  37. package/lib/cjs/SkillsApi.js +39 -0
  38. package/lib/cjs/SkillsApi.js.map +1 -0
  39. package/lib/cjs/StreamSource.js +17 -0
  40. package/lib/cjs/StreamSource.js.map +1 -0
  41. package/lib/cjs/TrainingApi.js +54 -0
  42. package/lib/cjs/TrainingApi.js.map +1 -0
  43. package/lib/cjs/UsersApi.js +13 -0
  44. package/lib/cjs/UsersApi.js.map +1 -0
  45. package/lib/cjs/client.js +351 -0
  46. package/lib/cjs/client.js.map +1 -0
  47. package/lib/cjs/execute.js +158 -0
  48. package/lib/cjs/execute.js.map +1 -0
  49. package/lib/cjs/index.js +22 -0
  50. package/lib/cjs/index.js.map +1 -0
  51. package/lib/cjs/nodejs/NodeStreamSource.js +45 -0
  52. package/lib/cjs/nodejs/NodeStreamSource.js.map +1 -0
  53. package/lib/cjs/nodejs/index.js +18 -0
  54. package/lib/cjs/nodejs/index.js.map +1 -0
  55. package/lib/cjs/package.json +3 -0
  56. package/lib/cjs/store/AnalyzeDocApi.js +56 -0
  57. package/lib/cjs/store/AnalyzeDocApi.js.map +1 -0
  58. package/lib/cjs/store/CollectionsApi.js +131 -0
  59. package/lib/cjs/store/CollectionsApi.js.map +1 -0
  60. package/lib/cjs/store/CommandsApi.js +17 -0
  61. package/lib/cjs/store/CommandsApi.js.map +1 -0
  62. package/lib/cjs/store/EmbeddingsApi.js +29 -0
  63. package/lib/cjs/store/EmbeddingsApi.js.map +1 -0
  64. package/lib/cjs/store/FilesApi.js +225 -0
  65. package/lib/cjs/store/FilesApi.js.map +1 -0
  66. package/lib/cjs/store/ObjectsApi.js +283 -0
  67. package/lib/cjs/store/ObjectsApi.js.map +1 -0
  68. package/lib/cjs/store/TypesApi.js +57 -0
  69. package/lib/cjs/store/TypesApi.js.map +1 -0
  70. package/lib/cjs/store/WorkersApi.js +16 -0
  71. package/lib/cjs/store/WorkersApi.js.map +1 -0
  72. package/lib/cjs/store/WorkflowsApi.js +425 -0
  73. package/lib/cjs/store/WorkflowsApi.js.map +1 -0
  74. package/lib/cjs/store/client.js +71 -0
  75. package/lib/cjs/store/client.js.map +1 -0
  76. package/lib/cjs/store/errors.js +11 -0
  77. package/lib/cjs/store/errors.js.map +1 -0
  78. package/lib/cjs/store/index.js +23 -0
  79. package/lib/cjs/store/index.js.map +1 -0
  80. package/lib/cjs/store/version.js +6 -0
  81. package/lib/cjs/store/version.js.map +1 -0
  82. package/lib/esm/AccountApi.js +82 -0
  83. package/lib/esm/AccountApi.js.map +1 -0
  84. package/lib/esm/AccountsApi.js +13 -0
  85. package/lib/esm/AccountsApi.js.map +1 -0
  86. package/lib/esm/AnalyticsApi.js +10 -0
  87. package/lib/esm/AnalyticsApi.js.map +1 -0
  88. package/lib/esm/ApiKeysApi.js +59 -0
  89. package/lib/esm/ApiKeysApi.js.map +1 -0
  90. package/lib/esm/AppsApi.js +116 -0
  91. package/lib/esm/AppsApi.js.map +1 -0
  92. package/lib/esm/CommandsApi.js +16 -0
  93. package/lib/esm/CommandsApi.js.map +1 -0
  94. package/lib/esm/EnvironmentsApi.js +55 -0
  95. package/lib/esm/EnvironmentsApi.js.map +1 -0
  96. package/lib/esm/GroupsApi.js +74 -0
  97. package/lib/esm/GroupsApi.js.map +1 -0
  98. package/lib/esm/IamApi.js +47 -0
  99. package/lib/esm/IamApi.js.map +1 -0
  100. package/lib/esm/InteractionBase.js +40 -0
  101. package/lib/esm/InteractionBase.js.map +1 -0
  102. package/lib/esm/InteractionCatalogApi.js +60 -0
  103. package/lib/esm/InteractionCatalogApi.js.map +1 -0
  104. package/lib/esm/InteractionOutput.js +293 -0
  105. package/lib/esm/InteractionOutput.js.map +1 -0
  106. package/lib/esm/InteractionResult.example.js +55 -0
  107. package/lib/esm/InteractionResult.example.js.map +1 -0
  108. package/lib/esm/InteractionsApi.js +240 -0
  109. package/lib/esm/InteractionsApi.js.map +1 -0
  110. package/lib/esm/ProjectsApi.js +50 -0
  111. package/lib/esm/ProjectsApi.js.map +1 -0
  112. package/lib/esm/PromptsApi.js +130 -0
  113. package/lib/esm/PromptsApi.js.map +1 -0
  114. package/lib/esm/RefsApi.js +10 -0
  115. package/lib/esm/RefsApi.js.map +1 -0
  116. package/lib/esm/RunsApi.js +109 -0
  117. package/lib/esm/RunsApi.js.map +1 -0
  118. package/lib/esm/SkillsApi.js +36 -0
  119. package/lib/esm/SkillsApi.js.map +1 -0
  120. package/lib/esm/StreamSource.js +13 -0
  121. package/lib/esm/StreamSource.js.map +1 -0
  122. package/lib/esm/TrainingApi.js +51 -0
  123. package/lib/esm/TrainingApi.js.map +1 -0
  124. package/lib/esm/UsersApi.js +10 -0
  125. package/lib/esm/UsersApi.js.map +1 -0
  126. package/lib/esm/client.js +342 -0
  127. package/lib/esm/client.js.map +1 -0
  128. package/lib/esm/execute.js +118 -0
  129. package/lib/esm/execute.js.map +1 -0
  130. package/lib/esm/index.js +6 -0
  131. package/lib/esm/index.js.map +1 -0
  132. package/lib/esm/nodejs/NodeStreamSource.js +41 -0
  133. package/lib/esm/nodejs/NodeStreamSource.js.map +1 -0
  134. package/lib/esm/nodejs/index.js +2 -0
  135. package/lib/esm/nodejs/index.js.map +1 -0
  136. package/lib/esm/store/AnalyzeDocApi.js +52 -0
  137. package/lib/esm/store/AnalyzeDocApi.js.map +1 -0
  138. package/lib/esm/store/CollectionsApi.js +127 -0
  139. package/lib/esm/store/CollectionsApi.js.map +1 -0
  140. package/lib/esm/store/CommandsApi.js +13 -0
  141. package/lib/esm/store/CommandsApi.js.map +1 -0
  142. package/lib/esm/store/EmbeddingsApi.js +25 -0
  143. package/lib/esm/store/EmbeddingsApi.js.map +1 -0
  144. package/lib/esm/store/FilesApi.js +219 -0
  145. package/lib/esm/store/FilesApi.js.map +1 -0
  146. package/lib/esm/store/ObjectsApi.js +279 -0
  147. package/lib/esm/store/ObjectsApi.js.map +1 -0
  148. package/lib/esm/store/TypesApi.js +53 -0
  149. package/lib/esm/store/TypesApi.js.map +1 -0
  150. package/lib/esm/store/WorkersApi.js +12 -0
  151. package/lib/esm/store/WorkersApi.js.map +1 -0
  152. package/lib/esm/store/WorkflowsApi.js +419 -0
  153. package/lib/esm/store/WorkflowsApi.js.map +1 -0
  154. package/lib/esm/store/client.js +67 -0
  155. package/lib/esm/store/client.js.map +1 -0
  156. package/lib/esm/store/errors.js +7 -0
  157. package/lib/esm/store/errors.js.map +1 -0
  158. package/lib/esm/store/index.js +7 -0
  159. package/lib/esm/store/index.js.map +1 -0
  160. package/lib/esm/store/version.js +3 -0
  161. package/lib/esm/store/version.js.map +1 -0
  162. package/lib/tsconfig.tsbuildinfo +1 -0
  163. package/lib/types/AccountApi.d.ts +59 -0
  164. package/lib/types/AccountApi.d.ts.map +1 -0
  165. package/lib/types/AccountsApi.d.ts +7 -0
  166. package/lib/types/AccountsApi.d.ts.map +1 -0
  167. package/lib/types/AnalyticsApi.d.ts +6 -0
  168. package/lib/types/AnalyticsApi.d.ts.map +1 -0
  169. package/lib/types/ApiKeysApi.d.ts +42 -0
  170. package/lib/types/ApiKeysApi.d.ts.map +1 -0
  171. package/lib/types/AppsApi.d.ts +65 -0
  172. package/lib/types/AppsApi.d.ts.map +1 -0
  173. package/lib/types/CommandsApi.d.ts +10 -0
  174. package/lib/types/CommandsApi.d.ts.map +1 -0
  175. package/lib/types/EnvironmentsApi.d.ts +30 -0
  176. package/lib/types/EnvironmentsApi.d.ts.map +1 -0
  177. package/lib/types/GroupsApi.d.ts +65 -0
  178. package/lib/types/GroupsApi.d.ts.map +1 -0
  179. package/lib/types/IamApi.d.ts +41 -0
  180. package/lib/types/IamApi.d.ts.map +1 -0
  181. package/lib/types/InteractionBase.d.ts +22 -0
  182. package/lib/types/InteractionBase.d.ts.map +1 -0
  183. package/lib/types/InteractionCatalogApi.d.ts +36 -0
  184. package/lib/types/InteractionCatalogApi.d.ts.map +1 -0
  185. package/lib/types/InteractionOutput.d.ts +174 -0
  186. package/lib/types/InteractionOutput.d.ts.map +1 -0
  187. package/lib/types/InteractionResult.example.d.ts +6 -0
  188. package/lib/types/InteractionResult.example.d.ts.map +1 -0
  189. package/lib/types/InteractionsApi.d.ts +165 -0
  190. package/lib/types/InteractionsApi.d.ts.map +1 -0
  191. package/lib/types/ProjectsApi.d.ts +18 -0
  192. package/lib/types/ProjectsApi.d.ts.map +1 -0
  193. package/lib/types/PromptsApi.d.ts +106 -0
  194. package/lib/types/PromptsApi.d.ts.map +1 -0
  195. package/lib/types/RefsApi.d.ts +6 -0
  196. package/lib/types/RefsApi.d.ts.map +1 -0
  197. package/lib/types/RunsApi.d.ts +79 -0
  198. package/lib/types/RunsApi.d.ts.map +1 -0
  199. package/lib/types/SkillsApi.d.ts +26 -0
  200. package/lib/types/SkillsApi.d.ts.map +1 -0
  201. package/lib/types/StreamSource.d.ts +7 -0
  202. package/lib/types/StreamSource.d.ts.map +1 -0
  203. package/lib/types/TrainingApi.d.ts +27 -0
  204. package/lib/types/TrainingApi.d.ts.map +1 -0
  205. package/lib/types/UsersApi.d.ts +6 -0
  206. package/lib/types/UsersApi.d.ts.map +1 -0
  207. package/lib/types/client.d.ts +125 -0
  208. package/lib/types/client.d.ts.map +1 -0
  209. package/lib/types/execute.d.ts +37 -0
  210. package/lib/types/execute.d.ts.map +1 -0
  211. package/lib/types/index.d.ts +10 -0
  212. package/lib/types/index.d.ts.map +1 -0
  213. package/lib/types/nodejs/NodeStreamSource.d.ts +9 -0
  214. package/lib/types/nodejs/NodeStreamSource.d.ts.map +1 -0
  215. package/lib/types/nodejs/index.d.ts +1 -0
  216. package/lib/types/nodejs/index.d.ts.map +1 -0
  217. package/lib/types/store/AnalyzeDocApi.d.ts +17 -0
  218. package/lib/types/store/AnalyzeDocApi.d.ts.map +1 -0
  219. package/lib/types/store/CollectionsApi.d.ts +82 -0
  220. package/lib/types/store/CollectionsApi.d.ts.map +1 -0
  221. package/lib/types/store/CommandsApi.d.ts +10 -0
  222. package/lib/types/store/CommandsApi.d.ts.map +1 -0
  223. package/lib/types/store/EmbeddingsApi.d.ts +12 -0
  224. package/lib/types/store/EmbeddingsApi.d.ts.map +1 -0
  225. package/lib/types/store/FilesApi.d.ts +103 -0
  226. package/lib/types/store/FilesApi.d.ts.map +1 -0
  227. package/lib/types/store/ObjectsApi.d.ts +117 -0
  228. package/lib/types/store/ObjectsApi.d.ts.map +1 -0
  229. package/lib/types/store/TypesApi.d.ts +23 -0
  230. package/lib/types/store/TypesApi.d.ts.map +1 -0
  231. package/lib/types/store/WorkersApi.d.ts +6 -0
  232. package/lib/types/store/WorkersApi.d.ts.map +1 -0
  233. package/lib/types/store/WorkflowsApi.d.ts +71 -0
  234. package/lib/types/store/WorkflowsApi.d.ts.map +1 -0
  235. package/lib/types/store/client.d.ts +35 -0
  236. package/lib/types/store/client.d.ts.map +1 -0
  237. package/lib/types/store/errors.d.ts +4 -0
  238. package/lib/types/store/errors.d.ts.map +1 -0
  239. package/lib/types/store/index.d.ts +6 -0
  240. package/lib/types/store/index.d.ts.map +1 -0
  241. package/lib/types/store/version.d.ts +2 -0
  242. package/lib/types/store/version.d.ts.map +1 -0
  243. package/lib/vertesia-client.js +2 -0
  244. package/lib/vertesia-client.js.map +1 -0
  245. package/package.json +4 -4
  246. package/src/store/WorkflowsApi.ts +12 -0
@@ -0,0 +1,36 @@
1
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
+ import { CatalogInteractionRef, InCodeInteraction, InteractionStatus } from "@vertesia/common";
3
+ export declare class InteractionCatalogApi extends ApiTopic {
4
+ constructor(parent: ClientBase);
5
+ /**
6
+ * List all project interactions
7
+ */
8
+ list(query?: {
9
+ status?: InteractionStatus;
10
+ tag?: string;
11
+ }): Promise<CatalogInteractionRef[]>;
12
+ /**
13
+ * List all stored interactions
14
+ */
15
+ listStoredInteractions(query?: {
16
+ status?: InteractionStatus;
17
+ tag?: string;
18
+ }): Promise<CatalogInteractionRef[]>;
19
+ /**
20
+ * List sys interactions
21
+ */
22
+ listSysInteractions(tag?: string): Promise<CatalogInteractionRef[]>;
23
+ /**
24
+ * List sys interactions
25
+ */
26
+ listAppInteractions(appName: string, tag?: string): Promise<CatalogInteractionRef[]>;
27
+ /**
28
+ * List all app interactions
29
+ */
30
+ listAllAppInteractions(tag?: string): Promise<CatalogInteractionRef[]>;
31
+ /**
32
+ * Resolve an interaction given its id to a InCodeInteraction
33
+ * @param id Interaction id
34
+ */
35
+ resolve(id: string): Promise<InCodeInteraction>;
36
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionCatalogApi.d.ts","sourceRoot":"","sources":["../../src/InteractionCatalogApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACpB,MAAM,kBAAkB,CAAC;AAG1B,qBAAa,qBAAsB,SAAQ,QAAQ;gBACnC,MAAM,EAAE,UAAU;IAI9B;;OAEG;IACH,IAAI,CAAC,KAAK,GAAE;QAAE,MAAM,CAAC,EAAE,iBAAiB,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAMhG;;OAEG;IACH,sBAAsB,CAAC,KAAK,GAAE;QAAE,MAAM,CAAC,EAAE,iBAAiB,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAMlH;;OAEG;IACH,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAQnE;;OAEG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAQpF;;OAEG;IACH,sBAAsB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAQtE;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAGlD"}
@@ -0,0 +1,174 @@
1
+ import { CompletionResult } from '@llumiverse/common';
2
+ import { ExecutionRun, InteractionExecutionResult } from '@vertesia/common';
3
+ /**
4
+ * Symbol used to mark InteractionOutputArray instances.
5
+ * This allows us to detect if a CompletionResult[] has already been wrapped.
6
+ */
7
+ export declare const IS_INTERACTION_OUTPUT: unique symbol;
8
+ export declare function enhanceInteractionExecutionResult<ResultT = any, ParamsT = any>(r: InteractionExecutionResult<ParamsT>): EnhancedInteractionExecutionResult<ResultT, ParamsT>;
9
+ export declare function enhanceExecutionRun<ResultT = any, ParamsT = any>(r: ExecutionRun<ParamsT>): EnhancedExecutionRun<ResultT, ParamsT>;
10
+ /**
11
+ * A convenient wrapper around CompletionResult[] that provides ergonomic accessors
12
+ * for different result types (text, JSON/objects, images) from interaction executions.
13
+ *
14
+ * Use the static from() method to create a proxied array that acts as both
15
+ * an array and has these convenience methods.
16
+ *
17
+ * @template T - The expected type of JSON/object results. Defaults to any.
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * // Recommended: Using the static from() method
22
+ * const output = InteractionOutput.from<MyResponse>(run.result);
23
+ * output[0]; // CompletionResult (array access)
24
+ * output.length; // number (array property)
25
+ * const obj = output.object(); // MyResponse (custom method)
26
+ * const text = output.text(); // string (custom getter)
27
+ *
28
+ * // Alternative: Using the class directly (less common)
29
+ * const output = new InteractionOutput<MyResponse>(run.result);
30
+ * const obj = output.object(); // Returns MyResponse
31
+ * const objs = output.objects(); // Returns MyResponse[]
32
+ *
33
+ * // Override type for specific objects
34
+ * interface OtherType { title: string; }
35
+ * ```
36
+ */
37
+ export declare class InteractionOutput<T = any> {
38
+ readonly results: CompletionResult[];
39
+ /**
40
+ * The raw completion results array.
41
+ * Access this when you need to work with the underlying CompletionResult[] directly.
42
+ */
43
+ constructor(results: CompletionResult[]);
44
+ /**
45
+ * Create an interaction output that acts as both an array and has convenience methods.
46
+ * This is the recommended way to work with interaction execution results.
47
+ *
48
+ * @template T - The expected type of JSON/object results. Defaults to any.
49
+ * @param results - The raw CompletionResult array from an interaction execution
50
+ * @returns A proxied array with convenience methods
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * interface MyResponse { name: string; age: number; }
55
+ * const output = InteractionOutput.from<MyResponse>(run.result);
56
+ *
57
+ * // Array access
58
+ * output[0]; // CompletionResult
59
+ * output.length; // number
60
+ *
61
+ * // Convenience methods
62
+ * const obj = output.object(); // MyResponse
63
+ * const text = output.text(); // string
64
+ * ```
65
+ */
66
+ static from<T = any>(results: CompletionResult[] | InteractionOutputArray<T> | Record<string, any> | string | null | undefined): InteractionOutputArray<T>;
67
+ static isInteractionOutputArray(obj: any): boolean;
68
+ get isEmpty(): boolean;
69
+ hasObject(): boolean;
70
+ hasText(): boolean;
71
+ hasImage(): boolean;
72
+ /**
73
+ * Get the concatenated text from all text results.
74
+ * Returns an empty string if no text results exist.
75
+ */
76
+ text(delimiter?: string): string;
77
+ /**
78
+ * Get an array of all text values from text results.
79
+ */
80
+ texts(): string[];
81
+ /**
82
+ * Get the first JSON result as a parsed object.
83
+ * If no JSON result exists, attempts to parse the concatenated text as JSON.
84
+ * @returns The first JSON result typed as T (the class generic type)
85
+ * @throws Error if no JSON result found and text cannot be parsed as JSON
86
+ */
87
+ object(): T;
88
+ /**
89
+ * Get all JSON results as parsed objects.
90
+ * @returns An array of all JSON results typed as T[] (the class generic type)
91
+ */
92
+ objects(): T[];
93
+ /**
94
+ * Get a specific JSON result by index as a parsed object.
95
+ * @template U - The type of the object at this index. Defaults to T (the class generic).
96
+ * @param index - The zero-based index of the JSON result
97
+ * @returns The JSON result at the specified index typed as U
98
+ * @throws Error if the index is out of bounds
99
+ */
100
+ objectAt<U = T>(index: number): U;
101
+ /**
102
+ * Get the first image result (base64 data URL or URL).
103
+ * @throws Error if no image result exists
104
+ */
105
+ image(): string;
106
+ /**
107
+ * Get an array of all image values (base64 data URLs or URLs).
108
+ */
109
+ images(): string[];
110
+ /**
111
+ * Convert all results to a string representation.
112
+ * Text and image results are used as-is, JSON results are stringified with the specified indent.
113
+ * All parts are joined using the specified separator.
114
+ *
115
+ * @param separator - The separator to use between parts (default: '\n')
116
+ * @param indent - The indentation to use for JSON.stringify (default: 0 = no formatting)
117
+ * @returns A string representation of all results
118
+ *
119
+ * @example
120
+ * ```typescript
121
+ * const output = InteractionOutput.from(results);
122
+ * output.stringify(); // Each part on a new line, compact JSON
123
+ * output.stringify('\n\n', 2); // Double newlines between parts, formatted JSON
124
+ * output.stringify(' '); // Space-separated, compact JSON
125
+ * ```
126
+ */
127
+ stringify(separator?: string, indent?: number): string;
128
+ /**
129
+ * Convert to string representation (concatenated text).
130
+ * Useful for template literals or string coercion.
131
+ */
132
+ toString(): string;
133
+ /**
134
+ * Convert to JSON representation.
135
+ * Attempts to return the first JSON object, falls back to concatenated text.
136
+ */
137
+ toJSON(): CompletionResult[];
138
+ }
139
+ /**
140
+ * Type representing a CompletionResult array enhanced with InteractionOutput methods.
141
+ * This is the return type of InteractionOutput.from() - it acts as both an array and has convenience methods.
142
+ */
143
+ export type InteractionOutputArray<T = any> = CompletionResult[] & InteractionOutput<T>;
144
+ export interface EnhancedInteractionExecutionResult<ResultT = any, ParamsT = any> extends InteractionExecutionResult<ParamsT> {
145
+ result: InteractionOutputArray<ResultT>;
146
+ }
147
+ export interface EnhancedExecutionRun<ResultT = any, ParamsT = any> extends ExecutionRun<ParamsT> {
148
+ result: InteractionOutputArray<ResultT>;
149
+ }
150
+ /**
151
+ * Creates a proxied array that acts as both a CompletionResult[] and has InteractionOutput convenience methods.
152
+ * Note: It's recommended to use InteractionOutput.from() instead of calling this function directly.
153
+ *
154
+ * @template T - The expected type of JSON/object results. Defaults to any.
155
+ * @param results - The raw CompletionResult array from the interaction execution
156
+ * @returns A proxy that behaves as both an array and has convenience methods
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * interface MyResponse { name: string; age: number; }
161
+ * const output = createInteractionOutput<MyResponse>(run.result);
162
+ *
163
+ * // Array access
164
+ * output[0]; // CompletionResult
165
+ * output.length; // number
166
+ * output.map(r => r.type) // string[]
167
+ *
168
+ * // Convenience methods
169
+ * const obj = output.object(); // MyResponse
170
+ * const text = output.text(); // string
171
+ * const img = output.image(); // string
172
+ * ```
173
+ */
174
+ export declare function createInteractionOutput<T = any>(results: CompletionResult[]): InteractionOutputArray<T>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionOutput.d.ts","sourceRoot":"","sources":["../../src/InteractionOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,qBAAqB,eAA8B,CAAC;AAEjE,wBAAgB,iCAAiC,CAAC,OAAO,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAAE,CAAC,EAAE,0BAA0B,CAAC,OAAO,CAAC,GAAG,kCAAkC,CAAC,OAAO,EAAE,OAAO,CAAC,CAG5K;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAAE,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,CAGlI;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,iBAAiB,CAAC,CAAC,GAAG,GAAG;aAKN,OAAO,EAAE,gBAAgB,EAAE;IAJvD;;;OAGG;gBACyB,OAAO,EAAE,gBAAgB,EAAE;IAEvD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,sBAAsB,CAAC,CAA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,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAwBvG"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Example usage of InteractionOutput
3
+ * This file demonstrates the Proxy-based approach where the result acts as both
4
+ * an array and has convenience methods.
5
+ */
6
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionResult.example.d.ts","sourceRoot":"","sources":["../../src/InteractionResult.example.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,165 @@
1
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
+ import { AsyncExecutionPayload, ComputeInteractionFacetPayload, GenerateInteractionPayload, GenerateTestDataPayload, ImprovePromptPayload, ImprovePromptPayloadConfig, Interaction, InteractionCreatePayload, InteractionEndpoint, InteractionEndpointQuery, InteractionExecutionPayload, InteractionForkPayload, InteractionPublishPayload, InteractionRef, InteractionRefWithSchema, InteractionSearchPayload, InteractionSearchQuery, InteractionsExportPayload, InteractionTags, InteractionUpdatePayload, RateLimitRequestPayload, RateLimitRequestResponse } from "@vertesia/common";
3
+ import { InteractionCatalogApi } from "./InteractionCatalogApi.js";
4
+ import { EnhancedExecutionRun, EnhancedInteractionExecutionResult } from "./InteractionOutput.js";
5
+ export interface ComputeInteractionFacetsResponse {
6
+ tags?: {
7
+ _id: string;
8
+ count: number;
9
+ }[];
10
+ status?: {
11
+ _id: string;
12
+ count: number;
13
+ }[];
14
+ total?: {
15
+ count: number;
16
+ }[];
17
+ }
18
+ export interface AsyncExecutionResult {
19
+ runId: string;
20
+ workflowId: string;
21
+ }
22
+ export default class InteractionsApi extends ApiTopic {
23
+ catalog: InteractionCatalogApi;
24
+ constructor(parent: ClientBase);
25
+ /**
26
+ * Get the list of all interactions in the current project
27
+ * @returns InteractionRef[]
28
+ **/
29
+ list(payload?: InteractionSearchPayload): Promise<InteractionRef[]>;
30
+ /**
31
+ * Find interactions given a mongo match query.
32
+ * You can also specify if prompts schemas are included in the result
33
+ */
34
+ listEndpoints(payload: InteractionEndpointQuery): Promise<InteractionEndpoint[]>;
35
+ /**
36
+ * List all interaction versions in the project having the given endpoint name.
37
+ * This is useful to list orphaned versions
38
+ * @param name
39
+ */
40
+ listVersionsByName(name: string): Promise<InteractionRef[]>;
41
+ /**
42
+ * Get the list of all interaction tags in the current project
43
+ * @param query optional query parameters to filter the tags
44
+ * @returns InteractionTags[]
45
+ **/
46
+ listTags(query?: InteractionSearchQuery): Promise<InteractionTags[]>;
47
+ /**
48
+ * Get the list of all interactions facets
49
+ * @param payload query payload to filter facet search
50
+ * @returns ComputeInteractionFacetsResponse[]
51
+ **/
52
+ computeFacets(query: ComputeInteractionFacetPayload): Promise<ComputeInteractionFacetsResponse>;
53
+ /**
54
+ * List interaction names in the current project
55
+ * @returns
56
+ */
57
+ listNames(): Promise<{
58
+ id: string;
59
+ name: string;
60
+ }[]>;
61
+ /**
62
+ * Get the list of all interactions in the current project. Schemas will be returned too.
63
+ * @returns InteractionRefWithSchema[]
64
+ **/
65
+ export(payload: InteractionsExportPayload): Promise<InteractionRefWithSchema[]>;
66
+ /**
67
+ * Create a new interaction
68
+ * @param payload InteractionCreatePayload
69
+ * @returns Interaction
70
+ * @throws ApiError
71
+ * @throws 400 if payload is invalid
72
+ * @throws 500 if interaction creation fails
73
+ **/
74
+ create(payload: InteractionCreatePayload): Promise<Interaction>;
75
+ /**
76
+ * Retrieve an existing interaction definition
77
+ * @param id of the interaction to retrieve
78
+ * @returns Interaction
79
+ **/
80
+ retrieve(id: string): Promise<Interaction>;
81
+ /**
82
+ * Update an existing interaction definition
83
+ * @param id of the interaction to update
84
+ * @param payload InteractionUpdatePayload
85
+ * @returns Interaction
86
+ * @throws ApiError
87
+ * @throws 400 if payload is invalid
88
+ * @throws 500 if interaction update fails
89
+ * @throws 404 if interaction not found
90
+ **/
91
+ update(id: string, payload: InteractionUpdatePayload): Promise<Interaction>;
92
+ /**
93
+ * Execute an interaction and return a promise which will be resolved with the executed run when
94
+ * the run completes or fails.
95
+ * If the onChunk callback is passed then the streaming of the result is enabled.
96
+ * The onChunk callback with be called with the next chunk of the result as soon as it is available.
97
+ * When all chunks are received the function will return the resolved promise
98
+ * @param id of the interaction to execute
99
+ * @param payload InteractionExecutionPayload
100
+ * @param onChunk callback to be called when the next chunk of the response is available
101
+ * @returns Promise<ExecutionRun>
102
+ * @throws ApiError
103
+ * @throws 404 if interaction not found
104
+ * @throws 400 if payload is invalid
105
+ * @throws 500 if interaction execution fails
106
+ * @throws 500 if interaction execution times out
107
+ **/
108
+ execute<ResultT = any, ParamsT = any>(id: string, payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<EnhancedInteractionExecutionResult<ResultT, ParamsT>>;
109
+ /**
110
+ * Same as execute but uses the interaction name selector instead of the id.
111
+ *
112
+ * A name selector is the interaction endpoint name suffixed with an optional tag or version which is starting with a `@` character.
113
+ * 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.
114
+ * Examples of selectors:
115
+ * - `ReviewContract` - select the latest version of the ReviewContract interaction
116
+ * - `ReviewContract@1` - select the version 1 of the ReviewContract interaction
117
+ * - `ReviewContract@draft` - select the draft version of the ReviewContract interaction
118
+ * - `ReviewContract@fixed` - select the ReviewContract interaction which is tagged with 'fixed' tag.
119
+ * @param nameWithTag
120
+ * @param payload
121
+ * @param onChunk
122
+ * @returns
123
+ */
124
+ executeByName<ResultT = any, ParamsT = any>(nameWithTag: string, payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<EnhancedInteractionExecutionResult<ResultT, ParamsT>>;
125
+ /**
126
+ * Execute an interaction in an workflow
127
+ * @param payload
128
+ * @returns
129
+ */
130
+ executeAsync(payload: AsyncExecutionPayload): Promise<AsyncExecutionResult>;
131
+ publish(id: string, payload: InteractionPublishPayload): Promise<Interaction>;
132
+ fork(id: string, payload: InteractionForkPayload): Promise<Interaction>;
133
+ /**
134
+ * Generate Composable definition of an interaction
135
+ **/
136
+ generateInteraction(id: string, payload: GenerateInteractionPayload): Promise<any[]>;
137
+ /**
138
+ * Generate Test Data for an interaction
139
+ **/
140
+ generateTestData(id: string, payload: GenerateTestDataPayload): Promise<any[]>;
141
+ /**
142
+ * Suggest Improvement for a prompt
143
+ * @deprecated use suggestPromptImprovements instead
144
+ */
145
+ suggestImprovements<ResultT = any, ParamsT = any>(id: string, payload: ImprovePromptPayloadConfig): Promise<EnhancedExecutionRun<ResultT, ParamsT>>;
146
+ suggestPromptImprovements<ResultT = any, ParamsT = any>(payload: ImprovePromptPayload): Promise<EnhancedInteractionExecutionResult<ResultT, ParamsT>>;
147
+ /**
148
+ * List the versions of the interaction. Returns an empty array if no versions are found
149
+ * @param id
150
+ * @returns the versions list or an empty array if no versions are found
151
+ */
152
+ listVersions(id: string): Promise<InteractionRef[]>;
153
+ /**
154
+ * List the forks of the interaction. Returns an empty array if no forks are found
155
+ * @param id
156
+ * @returns the versions list or an empty array if no forks are found
157
+ */
158
+ listForks(id: string): Promise<InteractionRef[]>;
159
+ /**
160
+ * Request a time slot to execute an interaction with a given environment / model
161
+ * @param payload RateLimitRequestPayload
162
+ * @returns RateLimitRequestResponse with delay_ms
163
+ */
164
+ requestSlot(payload: RateLimitRequestPayload): Promise<RateLimitRequestResponse>;
165
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionsApi.d.ts","sourceRoot":"","sources":["../../src/InteractionsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAe,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EACH,qBAAqB,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,oBAAoB,EAChI,0BAA0B,EAC1B,WAAW,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,wBAAwB,EACpF,2BAA2B,EAAE,sBAA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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;;;OAGG;IACG,mBAAmB,CAAC,OAAO,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAOnJ,yBAAyB,CAAC,OAAO,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,kCAAkC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAQ3J;;;;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,18 @@
1
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
+ import { AwsConfiguration, GithubConfiguration, GladiaConfiguration, ICreateProjectPayload, MagicPdfConfiguration, Project, ProjectConfiguration, 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
+ updateConfiguration(projectId: string, payload: Partial<ProjectConfiguration>): Promise<ProjectConfiguration>;
10
+ integrations: IntegrationsConfigurationApi;
11
+ }
12
+ declare class IntegrationsConfigurationApi extends ApiTopic {
13
+ constructor(parent: ClientBase);
14
+ list(projectId: string): Promise<ProjectIntegrationListEntry[]>;
15
+ retrieve(projectId: string, integrationId: SupportedIntegrations): Promise<GladiaConfiguration | GithubConfiguration | AwsConfiguration | MagicPdfConfiguration | undefined>;
16
+ update(projectId: string, integrationId: string, payload: any): Promise<GladiaConfiguration | GithubConfiguration>;
17
+ }
18
+ 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,oBAAoB,EAAE,2BAA2B,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE3O,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,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAM7G,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,yBAAyB,EAAE,mBAAmB,EAAqB,cAAc,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC7N,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,WAAW,2BAA2B;IACxC,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxC,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,QAAQ;gBAChC,MAAM,EAAE,UAAU;IAI9B;;;;QAII;IACJ,IAAI,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAUrE;;;;QAII;IACJ,aAAa,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAMrF;;;;;;;QAOI;IACJ,MAAM,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC;IAMrE;;;;QAII;IACJ,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAI7C;;;;;;;;;QASI;IACJ,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC;IAMjF;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC;IAM7E;;;;;;;;;QASI;IACJ,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;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,79 @@
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
+ import { EnhancedExecutionRun } from "./InteractionOutput.js";
5
+ export interface FilterOption {
6
+ id: string;
7
+ name: string;
8
+ count: number;
9
+ }
10
+ export interface ComputeRunFacetsResponse {
11
+ environments?: {
12
+ _id: string;
13
+ count: number;
14
+ }[];
15
+ interactions?: {
16
+ _id: string;
17
+ count: number;
18
+ }[];
19
+ models?: {
20
+ _id: string;
21
+ count: number;
22
+ }[];
23
+ tags?: {
24
+ _id: string;
25
+ count: number;
26
+ }[];
27
+ status?: {
28
+ _id: string;
29
+ count: number;
30
+ }[];
31
+ total?: {
32
+ count: number;
33
+ }[];
34
+ }
35
+ export declare class RunsApi extends ApiTopic {
36
+ constructor(parent: ClientBase);
37
+ /**
38
+ * Get the list of all runs
39
+ * @param project optional project id to filter by
40
+ * @param interaction optional interaction id to filter by
41
+ * @returns InteractionResult[]
42
+ **/
43
+ list({ limit, offset, filters }: RunListingQueryOptions): Promise<ExecutionRunRef[]>;
44
+ find(payload: FindPayload): Promise<ExecutionRun[]>;
45
+ /**
46
+ * Get a run by id
47
+ *
48
+ * @param id
49
+ * @returns InteractionResult
50
+ **/
51
+ retrieve<ResultT = any, ParamsT = any>(id: string): Promise<EnhancedExecutionRun<ResultT, ParamsT>>;
52
+ retrievePopulated<P = any>(id: string): Promise<PopulatedExecutionRun<P>>;
53
+ /**
54
+ * Get filter options for a field
55
+ * return FilterOption[]
56
+ */
57
+ filterOptions(field: string, filters: RunListingFilters): Promise<FilterOption[]>;
58
+ create<ResultT = any, ParamsT = any>(payload: RunCreatePayload): Promise<EnhancedExecutionRun<ResultT, ParamsT>>;
59
+ /**
60
+ * Send tool results and continues the conversation
61
+ * @param payload
62
+ * @returns
63
+ */
64
+ sendToolResults(payload: ToolResultsPayload): Promise<ExecutionResponse>;
65
+ /**
66
+ *
67
+ * @param payload
68
+ * @returns
69
+ */
70
+ sendUserMessage(payload: UserMessagePayload): Promise<ExecutionResponse>;
71
+ createCheckpoint(payload: CheckpointConversationPayload): Promise<ExecutionResponse>;
72
+ /**
73
+ * Get the list of all runs facets
74
+ * @param payload query payload to filter facet search
75
+ * @returns ComputeRunFacetsResponse[]
76
+ **/
77
+ computeFacets(query: ComputeRunFacetPayload): Promise<ComputeRunFacetsResponse>;
78
+ search(payload: RunSearchPayload): Promise<ExecutionRunRef[]>;
79
+ }
@@ -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;AAE1B,OAAO,EAAE,oBAAoB,EAAuB,MAAM,wBAAwB,CAAC;AAEnF,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAA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