langwatch 0.2.0 → 0.3.0-prerelease.2

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 (229) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +268 -1
  3. package/dist/chunk-4BZATFKJ.mjs +181 -0
  4. package/dist/chunk-4BZATFKJ.mjs.map +1 -0
  5. package/dist/chunk-CSC3CMIT.mjs +118 -0
  6. package/dist/chunk-CSC3CMIT.mjs.map +1 -0
  7. package/dist/chunk-F63YKTXA.mjs +47 -0
  8. package/dist/chunk-F63YKTXA.mjs.map +1 -0
  9. package/dist/chunk-G3AUABT7.js +4 -0
  10. package/dist/chunk-G3AUABT7.js.map +1 -0
  11. package/dist/chunk-HPC6Z7J4.js +118 -0
  12. package/dist/chunk-HPC6Z7J4.js.map +1 -0
  13. package/dist/chunk-KGDAENGD.js +50 -0
  14. package/dist/chunk-KGDAENGD.js.map +1 -0
  15. package/dist/chunk-LD74LVRU.js +47 -0
  16. package/dist/chunk-LD74LVRU.js.map +1 -0
  17. package/dist/chunk-OM7VY3XT.mjs +4 -0
  18. package/dist/chunk-PCQVQ7SB.js +45 -0
  19. package/dist/chunk-PCQVQ7SB.js.map +1 -0
  20. package/dist/chunk-PMBEK6YE.mjs +424 -0
  21. package/dist/chunk-PMBEK6YE.mjs.map +1 -0
  22. package/dist/chunk-PR3JDWC3.mjs +50 -0
  23. package/dist/chunk-PR3JDWC3.mjs.map +1 -0
  24. package/dist/chunk-PTJ6AAI7.js +360 -0
  25. package/dist/chunk-PTJ6AAI7.js.map +1 -0
  26. package/dist/chunk-QEWDG5QE.mjs +45 -0
  27. package/dist/chunk-QEWDG5QE.mjs.map +1 -0
  28. package/dist/chunk-REUCVT7A.mjs +39 -0
  29. package/dist/chunk-REUCVT7A.mjs.map +1 -0
  30. package/dist/chunk-SVJ7SCGB.js +424 -0
  31. package/dist/chunk-SVJ7SCGB.js.map +1 -0
  32. package/dist/chunk-VJSOCNPA.js +181 -0
  33. package/dist/chunk-VJSOCNPA.js.map +1 -0
  34. package/dist/chunk-WM2GRSRW.js +39 -0
  35. package/dist/chunk-WM2GRSRW.js.map +1 -0
  36. package/dist/chunk-Z5J5UI5E.mjs +360 -0
  37. package/dist/chunk-Z5J5UI5E.mjs.map +1 -0
  38. package/dist/client-B2HqIKg6.d.ts +51 -0
  39. package/dist/client-XyCqclCi.d.mts +51 -0
  40. package/dist/client-browser.d.mts +8 -0
  41. package/dist/client-browser.d.ts +8 -0
  42. package/dist/client-browser.js +83 -0
  43. package/dist/client-browser.js.map +1 -0
  44. package/dist/client-browser.mjs +83 -0
  45. package/dist/client-browser.mjs.map +1 -0
  46. package/dist/client-node.d.mts +8 -0
  47. package/dist/client-node.d.ts +8 -0
  48. package/dist/client-node.js +90 -0
  49. package/dist/client-node.js.map +1 -0
  50. package/dist/client-node.mjs +90 -0
  51. package/dist/client-node.mjs.map +1 -0
  52. package/dist/evaluation/index.d.mts +897 -0
  53. package/dist/evaluation/index.d.ts +897 -0
  54. package/dist/evaluation/index.js +13 -0
  55. package/dist/evaluation/index.js.map +1 -0
  56. package/dist/evaluation/index.mjs +13 -0
  57. package/dist/evaluation/index.mjs.map +1 -0
  58. package/dist/filterable-batch-span-processor-zO5kcjBY.d.mts +64 -0
  59. package/dist/filterable-batch-span-processor-zO5kcjBY.d.ts +64 -0
  60. package/dist/index.d.mts +45 -1027
  61. package/dist/index.d.ts +45 -1027
  62. package/dist/index.js +11 -27291
  63. package/dist/index.js.map +1 -1
  64. package/dist/index.mjs +23 -956
  65. package/dist/index.mjs.map +1 -1
  66. package/dist/observability/index.d.mts +260 -0
  67. package/dist/observability/index.d.ts +260 -0
  68. package/dist/observability/index.js +20 -0
  69. package/dist/observability/index.js.map +1 -0
  70. package/dist/observability/index.mjs +20 -0
  71. package/dist/observability/index.mjs.map +1 -0
  72. package/dist/observability/instrumentation/langchain/index.d.mts +40 -0
  73. package/dist/observability/instrumentation/langchain/index.d.ts +40 -0
  74. package/dist/observability/instrumentation/langchain/index.js +666 -0
  75. package/dist/observability/instrumentation/langchain/index.js.map +1 -0
  76. package/dist/observability/instrumentation/langchain/index.mjs +666 -0
  77. package/dist/observability/instrumentation/langchain/index.mjs.map +1 -0
  78. package/dist/prompt/index.d.mts +10 -0
  79. package/dist/prompt/index.d.ts +10 -0
  80. package/dist/prompt/index.js +18 -0
  81. package/dist/prompt/index.js.map +1 -0
  82. package/dist/prompt/index.mjs +18 -0
  83. package/dist/prompt/index.mjs.map +1 -0
  84. package/dist/prompt-BXJWdbQp.d.mts +1967 -0
  85. package/dist/prompt-BXJWdbQp.d.ts +1967 -0
  86. package/dist/record-evaluation-CmxMXa-3.d.mts +25 -0
  87. package/dist/record-evaluation-CmxMXa-3.d.ts +25 -0
  88. package/dist/trace-D-bZOuqb.d.mts +622 -0
  89. package/dist/trace-G2312klE.d.ts +622 -0
  90. package/package.json +86 -37
  91. package/.eslintrc.cjs +0 -37
  92. package/copy-types.sh +0 -17
  93. package/dist/chunk-LKD2K67J.mjs +0 -717
  94. package/dist/chunk-LKD2K67J.mjs.map +0 -1
  95. package/dist/utils-Cv-rUjJ1.d.mts +0 -313
  96. package/dist/utils-Cv-rUjJ1.d.ts +0 -313
  97. package/dist/utils.d.mts +0 -2
  98. package/dist/utils.d.ts +0 -2
  99. package/dist/utils.js +0 -709
  100. package/dist/utils.js.map +0 -1
  101. package/dist/utils.mjs +0 -11
  102. package/example/.env.example +0 -12
  103. package/example/.eslintrc.json +0 -26
  104. package/example/LICENSE +0 -13
  105. package/example/README.md +0 -12
  106. package/example/app/(chat)/chat/[id]/page.tsx +0 -60
  107. package/example/app/(chat)/layout.tsx +0 -14
  108. package/example/app/(chat)/page.tsx +0 -27
  109. package/example/app/actions.ts +0 -156
  110. package/example/app/globals.css +0 -76
  111. package/example/app/guardrails/page.tsx +0 -26
  112. package/example/app/langchain/page.tsx +0 -27
  113. package/example/app/langchain-rag/page.tsx +0 -28
  114. package/example/app/late-update/page.tsx +0 -27
  115. package/example/app/layout.tsx +0 -64
  116. package/example/app/login/actions.ts +0 -71
  117. package/example/app/login/page.tsx +0 -18
  118. package/example/app/manual/page.tsx +0 -27
  119. package/example/app/new/page.tsx +0 -5
  120. package/example/app/opengraph-image.png +0 -0
  121. package/example/app/share/[id]/page.tsx +0 -58
  122. package/example/app/signup/actions.ts +0 -111
  123. package/example/app/signup/page.tsx +0 -18
  124. package/example/app/twitter-image.png +0 -0
  125. package/example/auth.config.ts +0 -42
  126. package/example/auth.ts +0 -45
  127. package/example/components/button-scroll-to-bottom.tsx +0 -36
  128. package/example/components/chat-history.tsx +0 -49
  129. package/example/components/chat-list.tsx +0 -52
  130. package/example/components/chat-message-actions.tsx +0 -40
  131. package/example/components/chat-message.tsx +0 -80
  132. package/example/components/chat-panel.tsx +0 -139
  133. package/example/components/chat-share-dialog.tsx +0 -95
  134. package/example/components/chat.tsx +0 -84
  135. package/example/components/clear-history.tsx +0 -75
  136. package/example/components/empty-screen.tsx +0 -38
  137. package/example/components/external-link.tsx +0 -29
  138. package/example/components/footer.tsx +0 -19
  139. package/example/components/header.tsx +0 -114
  140. package/example/components/login-button.tsx +0 -42
  141. package/example/components/login-form.tsx +0 -97
  142. package/example/components/markdown.tsx +0 -9
  143. package/example/components/prompt-form.tsx +0 -115
  144. package/example/components/providers.tsx +0 -17
  145. package/example/components/sidebar-actions.tsx +0 -125
  146. package/example/components/sidebar-desktop.tsx +0 -19
  147. package/example/components/sidebar-footer.tsx +0 -16
  148. package/example/components/sidebar-item.tsx +0 -124
  149. package/example/components/sidebar-items.tsx +0 -42
  150. package/example/components/sidebar-list.tsx +0 -38
  151. package/example/components/sidebar-mobile.tsx +0 -31
  152. package/example/components/sidebar-toggle.tsx +0 -24
  153. package/example/components/sidebar.tsx +0 -21
  154. package/example/components/signup-form.tsx +0 -95
  155. package/example/components/stocks/events-skeleton.tsx +0 -31
  156. package/example/components/stocks/events.tsx +0 -30
  157. package/example/components/stocks/index.tsx +0 -36
  158. package/example/components/stocks/message.tsx +0 -134
  159. package/example/components/stocks/spinner.tsx +0 -16
  160. package/example/components/stocks/stock-purchase.tsx +0 -146
  161. package/example/components/stocks/stock-skeleton.tsx +0 -22
  162. package/example/components/stocks/stock.tsx +0 -210
  163. package/example/components/stocks/stocks-skeleton.tsx +0 -9
  164. package/example/components/stocks/stocks.tsx +0 -67
  165. package/example/components/tailwind-indicator.tsx +0 -14
  166. package/example/components/theme-toggle.tsx +0 -31
  167. package/example/components/ui/alert-dialog.tsx +0 -141
  168. package/example/components/ui/badge.tsx +0 -36
  169. package/example/components/ui/button.tsx +0 -57
  170. package/example/components/ui/codeblock.tsx +0 -148
  171. package/example/components/ui/dialog.tsx +0 -122
  172. package/example/components/ui/dropdown-menu.tsx +0 -205
  173. package/example/components/ui/icons.tsx +0 -507
  174. package/example/components/ui/input.tsx +0 -25
  175. package/example/components/ui/label.tsx +0 -26
  176. package/example/components/ui/select.tsx +0 -164
  177. package/example/components/ui/separator.tsx +0 -31
  178. package/example/components/ui/sheet.tsx +0 -140
  179. package/example/components/ui/sonner.tsx +0 -31
  180. package/example/components/ui/switch.tsx +0 -29
  181. package/example/components/ui/textarea.tsx +0 -24
  182. package/example/components/ui/tooltip.tsx +0 -30
  183. package/example/components/user-menu.tsx +0 -53
  184. package/example/components.json +0 -17
  185. package/example/instrumentation.ts +0 -11
  186. package/example/lib/chat/guardrails.tsx +0 -181
  187. package/example/lib/chat/langchain-rag.tsx +0 -191
  188. package/example/lib/chat/langchain.tsx +0 -112
  189. package/example/lib/chat/late-update.tsx +0 -208
  190. package/example/lib/chat/manual.tsx +0 -605
  191. package/example/lib/chat/vercel-ai.tsx +0 -576
  192. package/example/lib/hooks/use-copy-to-clipboard.tsx +0 -33
  193. package/example/lib/hooks/use-enter-submit.tsx +0 -23
  194. package/example/lib/hooks/use-local-storage.ts +0 -24
  195. package/example/lib/hooks/use-scroll-anchor.tsx +0 -86
  196. package/example/lib/hooks/use-sidebar.tsx +0 -60
  197. package/example/lib/hooks/use-streamable-text.ts +0 -25
  198. package/example/lib/types.ts +0 -41
  199. package/example/lib/utils.ts +0 -89
  200. package/example/middleware.ts +0 -8
  201. package/example/next-env.d.ts +0 -5
  202. package/example/next.config.js +0 -16
  203. package/example/package-lock.json +0 -10917
  204. package/example/package.json +0 -84
  205. package/example/pnpm-lock.yaml +0 -5712
  206. package/example/postcss.config.js +0 -6
  207. package/example/prettier.config.cjs +0 -34
  208. package/example/public/apple-touch-icon.png +0 -0
  209. package/example/public/favicon-16x16.png +0 -0
  210. package/example/public/favicon.ico +0 -0
  211. package/example/public/next.svg +0 -1
  212. package/example/public/thirteen.svg +0 -1
  213. package/example/public/vercel.svg +0 -1
  214. package/example/tailwind.config.ts +0 -81
  215. package/example/tsconfig.json +0 -35
  216. package/src/LangWatchExporter.ts +0 -96
  217. package/src/evaluations.ts +0 -219
  218. package/src/index.test.ts +0 -402
  219. package/src/index.ts +0 -596
  220. package/src/langchain.ts +0 -557
  221. package/src/server/types/.gitkeep +0 -0
  222. package/src/typeUtils.ts +0 -89
  223. package/src/types.ts +0 -82
  224. package/src/utils.ts +0 -205
  225. package/ts-to-zod.config.js +0 -24
  226. package/tsconfig.json +0 -32
  227. package/tsup.config.ts +0 -10
  228. package/vitest.config.ts +0 -8
  229. /package/dist/{utils.mjs.map → chunk-OM7VY3XT.mjs.map} +0 -0
@@ -0,0 +1,1967 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ interface paths {
6
+ "/api/annotations": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ /** @description Returns all annotations for project */
14
+ get: {
15
+ parameters: {
16
+ query?: never;
17
+ header?: never;
18
+ path?: never;
19
+ cookie?: never;
20
+ };
21
+ requestBody?: never;
22
+ responses: {
23
+ /** @description Annotation response */
24
+ 200: {
25
+ headers: {
26
+ [name: string]: unknown;
27
+ };
28
+ content: {
29
+ "application/json": components["schemas"]["Annotation"][];
30
+ };
31
+ };
32
+ /** @description Unexpected error */
33
+ 400: {
34
+ headers: {
35
+ [name: string]: unknown;
36
+ };
37
+ content: {
38
+ "application/json": components["schemas"]["Error"];
39
+ };
40
+ };
41
+ };
42
+ };
43
+ put?: never;
44
+ post?: never;
45
+ delete?: never;
46
+ options?: never;
47
+ head?: never;
48
+ patch?: never;
49
+ trace?: never;
50
+ };
51
+ "/api/annotations/trace/{id}": {
52
+ parameters: {
53
+ query?: never;
54
+ header?: never;
55
+ path?: never;
56
+ cookie?: never;
57
+ };
58
+ /** @description Returns all annotations for single trace */
59
+ get: {
60
+ parameters: {
61
+ query?: never;
62
+ header?: never;
63
+ path: {
64
+ /** @description ID of trace to fetch */
65
+ id: string;
66
+ };
67
+ cookie?: never;
68
+ };
69
+ requestBody?: never;
70
+ responses: {
71
+ /** @description Annotation response */
72
+ 200: {
73
+ headers: {
74
+ [name: string]: unknown;
75
+ };
76
+ content: {
77
+ "application/json": components["schemas"]["Annotation"][];
78
+ };
79
+ };
80
+ /** @description Unexpected error */
81
+ 400: {
82
+ headers: {
83
+ [name: string]: unknown;
84
+ };
85
+ content: {
86
+ "application/json": components["schemas"]["Error"];
87
+ };
88
+ };
89
+ };
90
+ };
91
+ put?: never;
92
+ /** @description Create an annotation for a single trace */
93
+ post: {
94
+ parameters: {
95
+ query?: never;
96
+ header?: never;
97
+ path: {
98
+ /** @description ID of the trace to annotate */
99
+ id: string;
100
+ };
101
+ cookie?: never;
102
+ };
103
+ /** @description Annotation data */
104
+ requestBody: {
105
+ content: {
106
+ "application/json": {
107
+ comment?: string;
108
+ isThumbsUp?: boolean;
109
+ email?: string;
110
+ };
111
+ };
112
+ };
113
+ responses: {
114
+ /** @description Annotation created */
115
+ 200: {
116
+ headers: {
117
+ [name: string]: unknown;
118
+ };
119
+ content: {
120
+ "application/json": components["schemas"]["Annotation"];
121
+ };
122
+ };
123
+ /** @description Invalid input */
124
+ 400: {
125
+ headers: {
126
+ [name: string]: unknown;
127
+ };
128
+ content: {
129
+ "application/json": components["schemas"]["Error"];
130
+ };
131
+ };
132
+ };
133
+ };
134
+ delete?: never;
135
+ options?: never;
136
+ head?: never;
137
+ patch?: never;
138
+ trace?: never;
139
+ };
140
+ "/api/annotations/{id}": {
141
+ parameters: {
142
+ query?: never;
143
+ header?: never;
144
+ path?: never;
145
+ cookie?: never;
146
+ };
147
+ /** @description Returns a single annotation based on the ID supplied */
148
+ get: {
149
+ parameters: {
150
+ query?: never;
151
+ header?: never;
152
+ path: {
153
+ /** @description ID of annotation to fetch */
154
+ id: string;
155
+ };
156
+ cookie?: never;
157
+ };
158
+ requestBody?: never;
159
+ responses: {
160
+ /** @description Annotation response */
161
+ 200: {
162
+ headers: {
163
+ [name: string]: unknown;
164
+ };
165
+ content: {
166
+ "application/json": components["schemas"]["Annotation"];
167
+ };
168
+ };
169
+ /** @description Unexpected error */
170
+ 400: {
171
+ headers: {
172
+ [name: string]: unknown;
173
+ };
174
+ content: {
175
+ "application/json": components["schemas"]["Error"];
176
+ };
177
+ };
178
+ };
179
+ };
180
+ put?: never;
181
+ post?: never;
182
+ /** @description Deletes a single annotation based on the ID supplied */
183
+ delete: {
184
+ parameters: {
185
+ query?: never;
186
+ header?: never;
187
+ path: {
188
+ /** @description ID of annotation to delete */
189
+ id: string;
190
+ };
191
+ cookie?: never;
192
+ };
193
+ requestBody?: never;
194
+ responses: {
195
+ /** @description Annotation response */
196
+ 200: {
197
+ headers: {
198
+ [name: string]: unknown;
199
+ };
200
+ content: {
201
+ "application/json": {
202
+ status?: string;
203
+ message?: string;
204
+ };
205
+ };
206
+ };
207
+ /** @description Unexpected error */
208
+ 400: {
209
+ headers: {
210
+ [name: string]: unknown;
211
+ };
212
+ content: {
213
+ "application/json": components["schemas"]["Error"];
214
+ };
215
+ };
216
+ };
217
+ };
218
+ options?: never;
219
+ head?: never;
220
+ /** @description Updates a single annotation based on the ID supplied */
221
+ patch: {
222
+ parameters: {
223
+ query?: never;
224
+ header?: never;
225
+ path: {
226
+ /** @description ID of annotation to delete */
227
+ id: string;
228
+ };
229
+ cookie?: never;
230
+ };
231
+ requestBody: {
232
+ content: {
233
+ "application/json": {
234
+ comment?: string;
235
+ isThumbsUp?: boolean;
236
+ email?: string;
237
+ };
238
+ };
239
+ };
240
+ responses: {
241
+ /** @description Annotation response */
242
+ 200: {
243
+ headers: {
244
+ [name: string]: unknown;
245
+ };
246
+ content: {
247
+ "application/json": {
248
+ status?: string;
249
+ message?: string;
250
+ };
251
+ };
252
+ };
253
+ /** @description Unexpected error */
254
+ 400: {
255
+ headers: {
256
+ [name: string]: unknown;
257
+ };
258
+ content: {
259
+ "application/json": components["schemas"]["Error"];
260
+ };
261
+ };
262
+ };
263
+ };
264
+ trace?: never;
265
+ };
266
+ "/api/trace/{id}": {
267
+ parameters: {
268
+ query?: never;
269
+ header?: never;
270
+ path?: never;
271
+ cookie?: never;
272
+ };
273
+ /** @description Returns single trace details based on the ID supplied */
274
+ get: {
275
+ parameters: {
276
+ query?: never;
277
+ header?: never;
278
+ path: {
279
+ /** @description ID of trace to share */
280
+ id: string;
281
+ };
282
+ cookie?: never;
283
+ };
284
+ requestBody?: never;
285
+ responses: {
286
+ /** @description Trace details with spans and evaluations */
287
+ 200: {
288
+ headers: {
289
+ [name: string]: unknown;
290
+ };
291
+ content: {
292
+ "application/json": {
293
+ /** @example trace_BKZL_X0TKSD4oa1aBJTc_ */
294
+ trace_id?: string;
295
+ /** @example KAXYxPR8MUgTcP8CF193y */
296
+ project_id?: string;
297
+ metadata?: {
298
+ /** @example 0.1.11 */
299
+ sdk_version?: string;
300
+ /** @example python */
301
+ sdk_language?: string;
302
+ };
303
+ timestamps?: {
304
+ /** @example 1721382486868 */
305
+ started_at?: number;
306
+ /** @example 1721382492894 */
307
+ inserted_at?: number;
308
+ /** @example 1721382492894 */
309
+ updated_at?: number;
310
+ };
311
+ input?: {
312
+ /** @example hi */
313
+ value?: string;
314
+ };
315
+ output?: {
316
+ /** @example Hey there! 👋😊 */
317
+ value?: string;
318
+ };
319
+ metrics?: {
320
+ /** @example 1449 */
321
+ first_token_ms?: number;
322
+ /** @example 1543 */
323
+ total_time_ms?: number;
324
+ /** @example 20 */
325
+ prompt_tokens?: number;
326
+ /** @example 7 */
327
+ completion_tokens?: number;
328
+ /** @example true */
329
+ tokens_estimated?: boolean;
330
+ };
331
+ /** @example null */
332
+ error?: {
333
+ stacktrace?: string[];
334
+ message?: string;
335
+ has_error?: boolean;
336
+ } | null;
337
+ /** @example [
338
+ * "cccd21e0b70c706034dfd9f7772816a3"
339
+ * ] */
340
+ indexing_md5s?: string[];
341
+ spans?: {
342
+ /** @example trace_BKZL_X0TKSD4oa1aBJTc_ */
343
+ trace_id?: string;
344
+ /** @example span_h1xUkcUJilhudDrLeQbR_ */
345
+ span_id?: string;
346
+ timestamps?: {
347
+ /** @example 1721382488392 */
348
+ finished_at?: number;
349
+ /** @example 1721382492027 */
350
+ updated_at?: number;
351
+ /** @example 1721382486895 */
352
+ started_at?: number;
353
+ /** @example 1721382488317 */
354
+ first_token_at?: number;
355
+ /** @example 1721382492027 */
356
+ inserted_at?: number;
357
+ };
358
+ /** @example llm */
359
+ type?: string;
360
+ /** @example null */
361
+ error?: {
362
+ stacktrace?: string[];
363
+ message?: string;
364
+ has_error?: boolean;
365
+ } | null;
366
+ params?: {
367
+ /** @example true */
368
+ stream?: boolean;
369
+ /** @example 1 */
370
+ temperature?: number;
371
+ };
372
+ /** @example KAXYxPR8MUgTcP8CF193y */
373
+ project_id?: string;
374
+ /** @example span_ijZNjUMTz3ys0Z0YKwF_T */
375
+ parent_id?: string | null;
376
+ /** @example null */
377
+ name?: string | null;
378
+ /** @example openai/gpt-4o */
379
+ model?: string;
380
+ metrics?: {
381
+ /** @example true */
382
+ tokens_estimated?: boolean;
383
+ /** @example 7 */
384
+ completion_tokens?: number;
385
+ /** @example 20 */
386
+ prompt_tokens?: number;
387
+ };
388
+ input?: {
389
+ /** @example chat_messages */
390
+ type?: string;
391
+ /** @example [
392
+ * {
393
+ * "role": "system",
394
+ * "content": "You are a helpful assistant that only reply in short tweet-like responses, using lots of emojis."
395
+ * },
396
+ * {
397
+ * "role": "user",
398
+ * "content": "hi"
399
+ * }
400
+ * ] */
401
+ value?: {
402
+ /** @example system */
403
+ role?: string;
404
+ /** @example You are a helpful assistant that only reply in short tweet-like responses, using lots of emojis. */
405
+ content?: string;
406
+ }[];
407
+ };
408
+ output?: {
409
+ /** @example chat_messages */
410
+ type?: string;
411
+ /** @example [
412
+ * {
413
+ * "role": "assistant",
414
+ * "content": "Hey there! 👋😊"
415
+ * }
416
+ * ] */
417
+ value?: {
418
+ /** @example assistant */
419
+ role?: string;
420
+ /** @example Hey there! 👋😊 */
421
+ content?: string;
422
+ }[];
423
+ };
424
+ }[];
425
+ evaluations?: {
426
+ /** @example check_VCagriZHNWICSOM09dXjM */
427
+ evaluation_id?: string;
428
+ /** @example Ragas Answer Relevancy */
429
+ name?: string;
430
+ /** @example ragas/answer_relevancy */
431
+ type?: string;
432
+ /** @example trace_BKZL_X0TKSD4oa1aBJTc_ */
433
+ trace_id?: string;
434
+ /** @example KAXYxPR8MUgTcP8CF193y */
435
+ project_id?: string;
436
+ /** @example error */
437
+ status?: string;
438
+ timestamps?: {
439
+ /** @example 1721383657788 */
440
+ updated_at?: number;
441
+ /** @example 1721382493358 */
442
+ inserted_at?: number;
443
+ };
444
+ error?: {
445
+ /** @example [
446
+ * "TypeError: fetch failed"
447
+ * ] */
448
+ stacktrace?: string[];
449
+ /** @example fetch failed */
450
+ message?: string;
451
+ /** @example true */
452
+ has_error?: boolean;
453
+ };
454
+ }[];
455
+ };
456
+ };
457
+ };
458
+ /** @description Unexpected error */
459
+ 400: {
460
+ headers: {
461
+ [name: string]: unknown;
462
+ };
463
+ content: {
464
+ "application/json": components["schemas"]["Error"];
465
+ };
466
+ };
467
+ };
468
+ };
469
+ put?: never;
470
+ post?: never;
471
+ delete?: never;
472
+ options?: never;
473
+ head?: never;
474
+ patch?: never;
475
+ trace?: never;
476
+ };
477
+ "/api/trace/search": {
478
+ parameters: {
479
+ query?: never;
480
+ header?: never;
481
+ path?: never;
482
+ cookie?: never;
483
+ };
484
+ get?: never;
485
+ put?: never;
486
+ /**
487
+ * Search traces
488
+ * @description Search for traces based on given criteria
489
+ */
490
+ post: {
491
+ parameters: {
492
+ query?: never;
493
+ header?: never;
494
+ path?: never;
495
+ cookie?: never;
496
+ };
497
+ requestBody: {
498
+ content: {
499
+ "application/json": components["schemas"]["SearchRequest"];
500
+ };
501
+ };
502
+ responses: {
503
+ /** @description Successful response */
504
+ 200: {
505
+ headers: {
506
+ [name: string]: unknown;
507
+ };
508
+ content: {
509
+ "application/json": components["schemas"]["SearchResponse"];
510
+ };
511
+ };
512
+ };
513
+ };
514
+ delete?: never;
515
+ options?: never;
516
+ head?: never;
517
+ patch?: never;
518
+ trace?: never;
519
+ };
520
+ "/api/trace/{id}/share": {
521
+ parameters: {
522
+ query?: never;
523
+ header?: never;
524
+ path?: never;
525
+ cookie?: never;
526
+ };
527
+ get?: never;
528
+ put?: never;
529
+ /** @description Returns a public path for a trace */
530
+ post: {
531
+ parameters: {
532
+ query?: never;
533
+ header?: never;
534
+ path: {
535
+ /** @description ID of trace to share */
536
+ id: string;
537
+ };
538
+ cookie?: never;
539
+ };
540
+ requestBody?: never;
541
+ responses: {
542
+ /** @description Public path created */
543
+ 200: {
544
+ headers: {
545
+ [name: string]: unknown;
546
+ };
547
+ content: {
548
+ "application/json": {
549
+ path?: string;
550
+ };
551
+ };
552
+ };
553
+ /** @description Unexpected error */
554
+ 400: {
555
+ headers: {
556
+ [name: string]: unknown;
557
+ };
558
+ content: {
559
+ "application/json": components["schemas"]["Error"];
560
+ };
561
+ };
562
+ };
563
+ };
564
+ delete?: never;
565
+ options?: never;
566
+ head?: never;
567
+ patch?: never;
568
+ trace?: never;
569
+ };
570
+ "/api/trace/{id}/unshare": {
571
+ parameters: {
572
+ query?: never;
573
+ header?: never;
574
+ path?: never;
575
+ cookie?: never;
576
+ };
577
+ get?: never;
578
+ put?: never;
579
+ /** @description Deletes a public path for a trace */
580
+ post: {
581
+ parameters: {
582
+ query?: never;
583
+ header?: never;
584
+ path: {
585
+ /** @description ID of trace to unshare */
586
+ id: string;
587
+ };
588
+ cookie?: never;
589
+ };
590
+ requestBody?: never;
591
+ responses: {
592
+ /** @description Public path deleted */
593
+ 200: {
594
+ headers: {
595
+ [name: string]: unknown;
596
+ };
597
+ content: {
598
+ "application/json": {
599
+ message?: string;
600
+ };
601
+ };
602
+ };
603
+ /** @description Unexpected error */
604
+ 400: {
605
+ headers: {
606
+ [name: string]: unknown;
607
+ };
608
+ content: {
609
+ "application/json": components["schemas"]["Error"];
610
+ };
611
+ };
612
+ };
613
+ };
614
+ delete?: never;
615
+ options?: never;
616
+ head?: never;
617
+ patch?: never;
618
+ trace?: never;
619
+ };
620
+ "/api/dataset/{slug}/entries": {
621
+ parameters: {
622
+ query?: never;
623
+ header?: never;
624
+ path?: never;
625
+ cookie?: never;
626
+ };
627
+ get?: never;
628
+ put?: never;
629
+ /** @description Add entries to a dataset */
630
+ post: operations["postApiDatasetBySlugEntries"];
631
+ delete?: never;
632
+ options?: never;
633
+ head?: never;
634
+ patch?: never;
635
+ trace?: never;
636
+ };
637
+ "/api/prompts": {
638
+ parameters: {
639
+ query?: never;
640
+ header?: never;
641
+ path?: never;
642
+ cookie?: never;
643
+ };
644
+ /** @description Get all prompts for a project */
645
+ get: operations["getApiPrompts"];
646
+ put?: never;
647
+ /** @description Create a new prompt with default initial version */
648
+ post: operations["postApiPrompts"];
649
+ delete?: never;
650
+ options?: never;
651
+ head?: never;
652
+ patch?: never;
653
+ trace?: never;
654
+ };
655
+ "/api/prompts/{id}": {
656
+ parameters: {
657
+ query?: never;
658
+ header?: never;
659
+ path?: never;
660
+ cookie?: never;
661
+ };
662
+ /** @description Get a specific prompt */
663
+ get: operations["getApiPromptsById"];
664
+ /** @description Update a prompt */
665
+ put: operations["putApiPromptsById"];
666
+ post?: never;
667
+ /** @description Delete a prompt */
668
+ delete: operations["deleteApiPromptsById"];
669
+ options?: never;
670
+ head?: never;
671
+ patch?: never;
672
+ trace?: never;
673
+ };
674
+ "/api/prompts/{id}/versions": {
675
+ parameters: {
676
+ query?: never;
677
+ header?: never;
678
+ path?: never;
679
+ cookie?: never;
680
+ };
681
+ /** @description Get all versions for a prompt */
682
+ get: operations["getApiPromptsByIdVersions"];
683
+ put?: never;
684
+ /** @description Create a new version for a prompt */
685
+ post: operations["postApiPromptsByIdVersions"];
686
+ delete?: never;
687
+ options?: never;
688
+ head?: never;
689
+ patch?: never;
690
+ trace?: never;
691
+ };
692
+ "/api/dataset/{slugOrId}": {
693
+ parameters: {
694
+ query?: never;
695
+ header?: never;
696
+ path?: never;
697
+ cookie?: never;
698
+ };
699
+ /** @description Get a dataset by its slug or id. */
700
+ get: operations["getApiDatasetBySlugOrId"];
701
+ put?: never;
702
+ post?: never;
703
+ delete?: never;
704
+ options?: never;
705
+ head?: never;
706
+ patch?: never;
707
+ trace?: never;
708
+ };
709
+ "/api/scenario-events": {
710
+ parameters: {
711
+ query?: never;
712
+ header?: never;
713
+ path?: never;
714
+ cookie?: never;
715
+ };
716
+ get?: never;
717
+ put?: never;
718
+ /** @description Create a new scenario event */
719
+ post: operations["postApiScenario-events"];
720
+ /** @description Delete all events */
721
+ delete: operations["deleteApiScenario-events"];
722
+ options?: never;
723
+ head?: never;
724
+ patch?: never;
725
+ trace?: never;
726
+ };
727
+ }
728
+ interface components {
729
+ schemas: {
730
+ Annotation: {
731
+ /** @description The ID of the annotation */
732
+ id?: string;
733
+ /** @description The ID of the project */
734
+ projectId?: string;
735
+ /** @description The ID of the trace */
736
+ traceId?: string;
737
+ /** @description The comment of the annotation */
738
+ comment?: string;
739
+ /** @description The thumbs up status of the annotation */
740
+ isThumbsUp?: boolean;
741
+ /** @description The ID of the user */
742
+ userId?: string;
743
+ /** @description The created at of the annotation */
744
+ createdAt?: string;
745
+ /** @description The updated at of the annotation */
746
+ updatedAt?: string;
747
+ /** @description The email of the user */
748
+ email?: string;
749
+ };
750
+ Error: {
751
+ /** Format: int32 */
752
+ error: number;
753
+ message: string;
754
+ };
755
+ SearchRequest: {
756
+ query?: string;
757
+ /** Format: date-time */
758
+ startDate?: string;
759
+ /** Format: date-time */
760
+ endDate?: string;
761
+ /** @example 1000 */
762
+ pageSize?: number;
763
+ /** @example 123 */
764
+ scrollId?: string;
765
+ filters?: {
766
+ [key: string]: string[];
767
+ };
768
+ };
769
+ SearchResponse: {
770
+ traces?: components["schemas"]["Trace"][];
771
+ pagination?: components["schemas"]["Pagination"];
772
+ };
773
+ Trace: {
774
+ trace_id?: string;
775
+ project_id?: string;
776
+ timestamps?: components["schemas"]["Timestamps"];
777
+ input?: components["schemas"]["Input"];
778
+ output?: components["schemas"]["Output"];
779
+ metadata?: components["schemas"]["Metadata"];
780
+ metrics?: components["schemas"]["Metrics"];
781
+ indexing_md5s?: string[];
782
+ error?: string | null;
783
+ evaluations?: components["schemas"]["Evaluation"][];
784
+ contexts?: unknown[];
785
+ };
786
+ Timestamps: {
787
+ inserted_at?: number;
788
+ started_at?: number;
789
+ updated_at?: number;
790
+ };
791
+ Input: {
792
+ value?: string;
793
+ satisfaction_score?: number;
794
+ };
795
+ Output: {
796
+ value?: string;
797
+ };
798
+ Metadata: {
799
+ sdk_language?: string;
800
+ sdk_version?: string;
801
+ };
802
+ Metrics: {
803
+ tokens_estimated?: boolean;
804
+ completion_tokens?: number;
805
+ prompt_tokens?: number;
806
+ total_cost?: number;
807
+ total_time_ms?: number;
808
+ first_token_ms?: number | null;
809
+ };
810
+ Evaluation: {
811
+ evaluation_id?: string;
812
+ score?: number;
813
+ timestamps?: components["schemas"]["EvaluationTimestamps"];
814
+ evaluator_id?: string;
815
+ name?: string;
816
+ details?: string;
817
+ passed?: boolean;
818
+ label?: string | null;
819
+ type?: string;
820
+ status?: string;
821
+ };
822
+ EvaluationTimestamps: {
823
+ finished_at?: number;
824
+ updated_at?: number;
825
+ };
826
+ Pagination: {
827
+ /** @example 123 */
828
+ scrollId?: string;
829
+ /** @example 1254 */
830
+ totalHits?: number;
831
+ };
832
+ DatasetPostEntries: {
833
+ /** @example [
834
+ * {
835
+ * "input": "hi",
836
+ * "output": "Hello, how can I help you today?"
837
+ * }
838
+ * ] */
839
+ entries: {
840
+ [key: string]: unknown;
841
+ }[];
842
+ };
843
+ };
844
+ responses: never;
845
+ parameters: never;
846
+ requestBodies: never;
847
+ headers: never;
848
+ pathItems: never;
849
+ }
850
+ interface operations {
851
+ postApiDatasetBySlugEntries: {
852
+ parameters: {
853
+ query?: never;
854
+ header?: never;
855
+ path: {
856
+ slug: string;
857
+ };
858
+ cookie?: never;
859
+ };
860
+ requestBody?: {
861
+ content: {
862
+ "application/json": components["schemas"]["DatasetPostEntries"];
863
+ };
864
+ };
865
+ responses: never;
866
+ };
867
+ getApiPrompts: {
868
+ parameters: {
869
+ query?: never;
870
+ header?: never;
871
+ path?: never;
872
+ cookie?: never;
873
+ };
874
+ requestBody?: never;
875
+ responses: {
876
+ /** @description Success */
877
+ 200: {
878
+ headers: {
879
+ [name: string]: unknown;
880
+ };
881
+ content: {
882
+ "application/json": {
883
+ id: string;
884
+ name: string;
885
+ updatedAt: string;
886
+ version: number;
887
+ versionId: string;
888
+ versionCreatedAt: string;
889
+ model: string;
890
+ prompt: string;
891
+ messages: ({
892
+ /** @enum {string} */
893
+ role: "user" | "assistant" | "system";
894
+ content: string;
895
+ } & {
896
+ [key: string]: unknown;
897
+ })[];
898
+ response_format: {
899
+ /** @enum {string} */
900
+ type: "json_schema";
901
+ json_schema: {
902
+ name: string;
903
+ schema: Record<string, never>;
904
+ };
905
+ } | null;
906
+ }[];
907
+ };
908
+ };
909
+ /** @description Bad Request */
910
+ 400: {
911
+ headers: {
912
+ [name: string]: unknown;
913
+ };
914
+ content: {
915
+ "application/json": {
916
+ /** @enum {string} */
917
+ error: "Bad Request";
918
+ };
919
+ };
920
+ };
921
+ /** @description Unauthorized */
922
+ 401: {
923
+ headers: {
924
+ [name: string]: unknown;
925
+ };
926
+ content: {
927
+ "application/json": {
928
+ /** @enum {string} */
929
+ error: "Unauthorized";
930
+ };
931
+ };
932
+ };
933
+ /** @description Internal Server Error */
934
+ 500: {
935
+ headers: {
936
+ [name: string]: unknown;
937
+ };
938
+ content: {
939
+ "application/json": {
940
+ error: string;
941
+ };
942
+ };
943
+ };
944
+ };
945
+ };
946
+ postApiPrompts: {
947
+ parameters: {
948
+ query?: never;
949
+ header?: never;
950
+ path?: never;
951
+ cookie?: never;
952
+ };
953
+ requestBody?: {
954
+ content: {
955
+ "application/json": {
956
+ name: string;
957
+ };
958
+ };
959
+ };
960
+ responses: {
961
+ /** @description Success */
962
+ 200: {
963
+ headers: {
964
+ [name: string]: unknown;
965
+ };
966
+ content: {
967
+ "application/json": {
968
+ id: string;
969
+ name: string;
970
+ updatedAt: string;
971
+ version: number;
972
+ versionId: string;
973
+ versionCreatedAt: string;
974
+ model: string;
975
+ prompt: string;
976
+ messages: ({
977
+ /** @enum {string} */
978
+ role: "user" | "assistant" | "system";
979
+ content: string;
980
+ } & {
981
+ [key: string]: unknown;
982
+ })[];
983
+ response_format: {
984
+ /** @enum {string} */
985
+ type: "json_schema";
986
+ json_schema: {
987
+ name: string;
988
+ schema: Record<string, never>;
989
+ };
990
+ } | null;
991
+ };
992
+ };
993
+ };
994
+ /** @description Bad Request */
995
+ 400: {
996
+ headers: {
997
+ [name: string]: unknown;
998
+ };
999
+ content: {
1000
+ "application/json": {
1001
+ /** @enum {string} */
1002
+ error: "Bad Request";
1003
+ };
1004
+ };
1005
+ };
1006
+ /** @description Unauthorized */
1007
+ 401: {
1008
+ headers: {
1009
+ [name: string]: unknown;
1010
+ };
1011
+ content: {
1012
+ "application/json": {
1013
+ /** @enum {string} */
1014
+ error: "Unauthorized";
1015
+ };
1016
+ };
1017
+ };
1018
+ /** @description Internal Server Error */
1019
+ 500: {
1020
+ headers: {
1021
+ [name: string]: unknown;
1022
+ };
1023
+ content: {
1024
+ "application/json": {
1025
+ error: string;
1026
+ };
1027
+ };
1028
+ };
1029
+ };
1030
+ };
1031
+ getApiPromptsById: {
1032
+ parameters: {
1033
+ query?: never;
1034
+ header?: never;
1035
+ path: {
1036
+ id: string;
1037
+ };
1038
+ cookie?: never;
1039
+ };
1040
+ requestBody?: never;
1041
+ responses: {
1042
+ /** @description Success */
1043
+ 200: {
1044
+ headers: {
1045
+ [name: string]: unknown;
1046
+ };
1047
+ content: {
1048
+ "application/json": {
1049
+ id: string;
1050
+ name: string;
1051
+ updatedAt: string;
1052
+ version: number;
1053
+ versionId: string;
1054
+ versionCreatedAt: string;
1055
+ model: string;
1056
+ prompt: string;
1057
+ messages: ({
1058
+ /** @enum {string} */
1059
+ role: "user" | "assistant" | "system";
1060
+ content: string;
1061
+ } & {
1062
+ [key: string]: unknown;
1063
+ })[];
1064
+ response_format: {
1065
+ /** @enum {string} */
1066
+ type: "json_schema";
1067
+ json_schema: {
1068
+ name: string;
1069
+ schema: Record<string, never>;
1070
+ };
1071
+ } | null;
1072
+ };
1073
+ };
1074
+ };
1075
+ /** @description Bad Request */
1076
+ 400: {
1077
+ headers: {
1078
+ [name: string]: unknown;
1079
+ };
1080
+ content: {
1081
+ "application/json": {
1082
+ /** @enum {string} */
1083
+ error: "Bad Request";
1084
+ };
1085
+ };
1086
+ };
1087
+ /** @description Unauthorized */
1088
+ 401: {
1089
+ headers: {
1090
+ [name: string]: unknown;
1091
+ };
1092
+ content: {
1093
+ "application/json": {
1094
+ /** @enum {string} */
1095
+ error: "Unauthorized";
1096
+ };
1097
+ };
1098
+ };
1099
+ /** @description Prompt not found */
1100
+ 404: {
1101
+ headers: {
1102
+ [name: string]: unknown;
1103
+ };
1104
+ content: {
1105
+ "application/json": {
1106
+ error: string;
1107
+ };
1108
+ };
1109
+ };
1110
+ /** @description Internal Server Error */
1111
+ 500: {
1112
+ headers: {
1113
+ [name: string]: unknown;
1114
+ };
1115
+ content: {
1116
+ "application/json": {
1117
+ error: string;
1118
+ };
1119
+ };
1120
+ };
1121
+ };
1122
+ };
1123
+ putApiPromptsById: {
1124
+ parameters: {
1125
+ query?: never;
1126
+ header?: never;
1127
+ path: {
1128
+ id: string;
1129
+ };
1130
+ cookie?: never;
1131
+ };
1132
+ requestBody?: {
1133
+ content: {
1134
+ "application/json": {
1135
+ name: string;
1136
+ };
1137
+ };
1138
+ };
1139
+ responses: {
1140
+ /** @description Success */
1141
+ 200: {
1142
+ headers: {
1143
+ [name: string]: unknown;
1144
+ };
1145
+ content: {
1146
+ "application/json": {
1147
+ id: string;
1148
+ name: string;
1149
+ updatedAt: string;
1150
+ };
1151
+ };
1152
+ };
1153
+ /** @description Bad Request */
1154
+ 400: {
1155
+ headers: {
1156
+ [name: string]: unknown;
1157
+ };
1158
+ content: {
1159
+ "application/json": {
1160
+ /** @enum {string} */
1161
+ error: "Bad Request";
1162
+ };
1163
+ };
1164
+ };
1165
+ /** @description Unauthorized */
1166
+ 401: {
1167
+ headers: {
1168
+ [name: string]: unknown;
1169
+ };
1170
+ content: {
1171
+ "application/json": {
1172
+ /** @enum {string} */
1173
+ error: "Unauthorized";
1174
+ };
1175
+ };
1176
+ };
1177
+ /** @description Prompt not found */
1178
+ 404: {
1179
+ headers: {
1180
+ [name: string]: unknown;
1181
+ };
1182
+ content: {
1183
+ "application/json": {
1184
+ error: string;
1185
+ };
1186
+ };
1187
+ };
1188
+ /** @description Internal Server Error */
1189
+ 500: {
1190
+ headers: {
1191
+ [name: string]: unknown;
1192
+ };
1193
+ content: {
1194
+ "application/json": {
1195
+ error: string;
1196
+ };
1197
+ };
1198
+ };
1199
+ };
1200
+ };
1201
+ deleteApiPromptsById: {
1202
+ parameters: {
1203
+ query?: never;
1204
+ header?: never;
1205
+ path: {
1206
+ id: string;
1207
+ };
1208
+ cookie?: never;
1209
+ };
1210
+ requestBody?: never;
1211
+ responses: {
1212
+ /** @description Success */
1213
+ 200: {
1214
+ headers: {
1215
+ [name: string]: unknown;
1216
+ };
1217
+ content: {
1218
+ "application/json": {
1219
+ success: boolean;
1220
+ };
1221
+ };
1222
+ };
1223
+ /** @description Bad Request */
1224
+ 400: {
1225
+ headers: {
1226
+ [name: string]: unknown;
1227
+ };
1228
+ content: {
1229
+ "application/json": {
1230
+ /** @enum {string} */
1231
+ error: "Bad Request";
1232
+ };
1233
+ };
1234
+ };
1235
+ /** @description Unauthorized */
1236
+ 401: {
1237
+ headers: {
1238
+ [name: string]: unknown;
1239
+ };
1240
+ content: {
1241
+ "application/json": {
1242
+ /** @enum {string} */
1243
+ error: "Unauthorized";
1244
+ };
1245
+ };
1246
+ };
1247
+ /** @description Prompt not found */
1248
+ 404: {
1249
+ headers: {
1250
+ [name: string]: unknown;
1251
+ };
1252
+ content: {
1253
+ "application/json": {
1254
+ error: string;
1255
+ };
1256
+ };
1257
+ };
1258
+ /** @description Internal Server Error */
1259
+ 500: {
1260
+ headers: {
1261
+ [name: string]: unknown;
1262
+ };
1263
+ content: {
1264
+ "application/json": {
1265
+ error: string;
1266
+ };
1267
+ };
1268
+ };
1269
+ };
1270
+ };
1271
+ getApiPromptsByIdVersions: {
1272
+ parameters: {
1273
+ query?: never;
1274
+ header?: never;
1275
+ path: {
1276
+ id: string;
1277
+ };
1278
+ cookie?: never;
1279
+ };
1280
+ requestBody?: never;
1281
+ responses: {
1282
+ /** @description Success */
1283
+ 200: {
1284
+ headers: {
1285
+ [name: string]: unknown;
1286
+ };
1287
+ content: {
1288
+ "application/json": {
1289
+ id: string;
1290
+ authorId: string | null;
1291
+ projectId: string;
1292
+ configId: string;
1293
+ /** @constant */
1294
+ schemaVersion: "1.0";
1295
+ commitMessage?: string | null;
1296
+ version: number;
1297
+ createdAt: string;
1298
+ configData: {
1299
+ version?: number;
1300
+ prompt: string;
1301
+ /** @default [] */
1302
+ messages: ({
1303
+ /** @enum {string} */
1304
+ role: "user" | "assistant" | "system";
1305
+ content: string;
1306
+ } & {
1307
+ [key: string]: unknown;
1308
+ })[];
1309
+ inputs: {
1310
+ identifier: string;
1311
+ /** @enum {string} */
1312
+ type: "str" | "float" | "bool" | "image" | "list[str]" | "list[float]" | "list[int]" | "list[bool]" | "dict";
1313
+ }[];
1314
+ outputs: {
1315
+ identifier: string;
1316
+ /** @enum {string} */
1317
+ type: "str" | "float" | "bool" | "json_schema";
1318
+ json_schema?: {
1319
+ type: string;
1320
+ } & {
1321
+ [key: string]: unknown;
1322
+ };
1323
+ }[];
1324
+ model: string;
1325
+ temperature?: number;
1326
+ max_tokens?: number;
1327
+ demonstrations?: {
1328
+ columns: {
1329
+ id: string;
1330
+ name: string;
1331
+ /** @enum {string} */
1332
+ type: "string" | "boolean" | "number" | "date" | "list" | "json" | "spans" | "rag_contexts" | "chat_messages" | "annotations" | "evaluations";
1333
+ }[];
1334
+ /** @default [] */
1335
+ rows: ({
1336
+ id: string;
1337
+ } & {
1338
+ [key: string]: unknown;
1339
+ })[];
1340
+ id?: string;
1341
+ name?: string;
1342
+ inline?: {
1343
+ records: {
1344
+ [key: string]: string[];
1345
+ };
1346
+ columnTypes: {
1347
+ name: string;
1348
+ type: "string" | "boolean" | "number" | "date" | "list" | "json" | "spans" | "rag_contexts" | "chat_messages" | "annotations" | "evaluations";
1349
+ }[];
1350
+ };
1351
+ };
1352
+ prompting_technique?: {
1353
+ ref?: string;
1354
+ };
1355
+ };
1356
+ };
1357
+ };
1358
+ };
1359
+ /** @description Bad Request */
1360
+ 400: {
1361
+ headers: {
1362
+ [name: string]: unknown;
1363
+ };
1364
+ content: {
1365
+ "application/json": {
1366
+ /** @enum {string} */
1367
+ error: "Bad Request";
1368
+ };
1369
+ };
1370
+ };
1371
+ /** @description Unauthorized */
1372
+ 401: {
1373
+ headers: {
1374
+ [name: string]: unknown;
1375
+ };
1376
+ content: {
1377
+ "application/json": {
1378
+ /** @enum {string} */
1379
+ error: "Unauthorized";
1380
+ };
1381
+ };
1382
+ };
1383
+ /** @description Prompt not found */
1384
+ 404: {
1385
+ headers: {
1386
+ [name: string]: unknown;
1387
+ };
1388
+ content: {
1389
+ "application/json": {
1390
+ error: string;
1391
+ };
1392
+ };
1393
+ };
1394
+ /** @description Internal Server Error */
1395
+ 500: {
1396
+ headers: {
1397
+ [name: string]: unknown;
1398
+ };
1399
+ content: {
1400
+ "application/json": {
1401
+ error: string;
1402
+ };
1403
+ };
1404
+ };
1405
+ };
1406
+ };
1407
+ postApiPromptsByIdVersions: {
1408
+ parameters: {
1409
+ query?: never;
1410
+ header?: never;
1411
+ path: {
1412
+ id: string;
1413
+ };
1414
+ cookie?: never;
1415
+ };
1416
+ requestBody?: {
1417
+ content: {
1418
+ "application/json": {
1419
+ id?: string;
1420
+ authorId?: string | null;
1421
+ projectId: string;
1422
+ configId: string;
1423
+ /** @constant */
1424
+ schemaVersion: "1.0";
1425
+ commitMessage: string;
1426
+ version: number;
1427
+ createdAt?: string;
1428
+ configData: {
1429
+ version?: number;
1430
+ prompt: string;
1431
+ /** @default [] */
1432
+ messages?: ({
1433
+ /** @enum {string} */
1434
+ role: "user" | "assistant" | "system";
1435
+ content: string;
1436
+ } & {
1437
+ [key: string]: unknown;
1438
+ })[];
1439
+ inputs: {
1440
+ identifier: string;
1441
+ /** @enum {string} */
1442
+ type: "str" | "float" | "bool" | "image" | "list[str]" | "list[float]" | "list[int]" | "list[bool]" | "dict";
1443
+ }[];
1444
+ outputs: {
1445
+ identifier: string;
1446
+ /** @enum {string} */
1447
+ type: "str" | "float" | "bool" | "json_schema";
1448
+ json_schema?: {
1449
+ type: string;
1450
+ } & {
1451
+ [key: string]: unknown;
1452
+ };
1453
+ }[];
1454
+ model: string;
1455
+ temperature?: number;
1456
+ max_tokens?: number;
1457
+ demonstrations?: {
1458
+ columns: {
1459
+ id: string;
1460
+ name: string;
1461
+ /** @enum {string} */
1462
+ type: "string" | "boolean" | "number" | "date" | "list" | "json" | "spans" | "rag_contexts" | "chat_messages" | "annotations" | "evaluations";
1463
+ }[];
1464
+ /** @default [] */
1465
+ rows?: ({
1466
+ id: string;
1467
+ } & {
1468
+ [key: string]: unknown;
1469
+ })[];
1470
+ id?: string;
1471
+ name?: string;
1472
+ inline?: {
1473
+ records: {
1474
+ [key: string]: string[];
1475
+ };
1476
+ columnTypes: {
1477
+ name: string;
1478
+ type: "string" | "boolean" | "number" | "date" | "list" | "json" | "spans" | "rag_contexts" | "chat_messages" | "annotations" | "evaluations";
1479
+ }[];
1480
+ };
1481
+ };
1482
+ prompting_technique?: {
1483
+ ref?: string;
1484
+ };
1485
+ };
1486
+ };
1487
+ };
1488
+ };
1489
+ responses: {
1490
+ /** @description Success */
1491
+ 200: {
1492
+ headers: {
1493
+ [name: string]: unknown;
1494
+ };
1495
+ content: {
1496
+ "application/json": {
1497
+ id: string;
1498
+ authorId: string | null;
1499
+ projectId: string;
1500
+ configId: string;
1501
+ /** @constant */
1502
+ schemaVersion: "1.0";
1503
+ commitMessage?: string | null;
1504
+ version: number;
1505
+ createdAt: string;
1506
+ configData: {
1507
+ version?: number;
1508
+ prompt: string;
1509
+ /** @default [] */
1510
+ messages: ({
1511
+ /** @enum {string} */
1512
+ role: "user" | "assistant" | "system";
1513
+ content: string;
1514
+ } & {
1515
+ [key: string]: unknown;
1516
+ })[];
1517
+ inputs: {
1518
+ identifier: string;
1519
+ /** @enum {string} */
1520
+ type: "str" | "float" | "bool" | "image" | "list[str]" | "list[float]" | "list[int]" | "list[bool]" | "dict";
1521
+ }[];
1522
+ outputs: {
1523
+ identifier: string;
1524
+ /** @enum {string} */
1525
+ type: "str" | "float" | "bool" | "json_schema";
1526
+ json_schema?: {
1527
+ type: string;
1528
+ } & {
1529
+ [key: string]: unknown;
1530
+ };
1531
+ }[];
1532
+ model: string;
1533
+ temperature?: number;
1534
+ max_tokens?: number;
1535
+ demonstrations?: {
1536
+ columns: {
1537
+ id: string;
1538
+ name: string;
1539
+ /** @enum {string} */
1540
+ type: "string" | "boolean" | "number" | "date" | "list" | "json" | "spans" | "rag_contexts" | "chat_messages" | "annotations" | "evaluations";
1541
+ }[];
1542
+ /** @default [] */
1543
+ rows: ({
1544
+ id: string;
1545
+ } & {
1546
+ [key: string]: unknown;
1547
+ })[];
1548
+ id?: string;
1549
+ name?: string;
1550
+ inline?: {
1551
+ records: {
1552
+ [key: string]: string[];
1553
+ };
1554
+ columnTypes: {
1555
+ name: string;
1556
+ type: "string" | "boolean" | "number" | "date" | "list" | "json" | "spans" | "rag_contexts" | "chat_messages" | "annotations" | "evaluations";
1557
+ }[];
1558
+ };
1559
+ };
1560
+ prompting_technique?: {
1561
+ ref?: string;
1562
+ };
1563
+ };
1564
+ };
1565
+ };
1566
+ };
1567
+ /** @description Bad Request */
1568
+ 400: {
1569
+ headers: {
1570
+ [name: string]: unknown;
1571
+ };
1572
+ content: {
1573
+ "application/json": {
1574
+ /** @enum {string} */
1575
+ error: "Bad Request";
1576
+ };
1577
+ };
1578
+ };
1579
+ /** @description Unauthorized */
1580
+ 401: {
1581
+ headers: {
1582
+ [name: string]: unknown;
1583
+ };
1584
+ content: {
1585
+ "application/json": {
1586
+ /** @enum {string} */
1587
+ error: "Unauthorized";
1588
+ };
1589
+ };
1590
+ };
1591
+ /** @description Prompt not found */
1592
+ 404: {
1593
+ headers: {
1594
+ [name: string]: unknown;
1595
+ };
1596
+ content: {
1597
+ "application/json": {
1598
+ error: string;
1599
+ };
1600
+ };
1601
+ };
1602
+ /** @description Internal Server Error */
1603
+ 500: {
1604
+ headers: {
1605
+ [name: string]: unknown;
1606
+ };
1607
+ content: {
1608
+ "application/json": {
1609
+ error: string;
1610
+ };
1611
+ };
1612
+ };
1613
+ };
1614
+ };
1615
+ getApiDatasetBySlugOrId: {
1616
+ parameters: {
1617
+ query?: never;
1618
+ header?: never;
1619
+ path: {
1620
+ slugOrId: string;
1621
+ };
1622
+ cookie?: never;
1623
+ };
1624
+ requestBody?: never;
1625
+ responses: {
1626
+ /** @description Success */
1627
+ 200: {
1628
+ headers: {
1629
+ [name: string]: unknown;
1630
+ };
1631
+ content: {
1632
+ "application/json": {
1633
+ data: {
1634
+ id: string;
1635
+ datasetId: string;
1636
+ projectId: string;
1637
+ entry: {
1638
+ [key: string]: unknown;
1639
+ };
1640
+ createdAt: string;
1641
+ updatedAt: string;
1642
+ }[];
1643
+ };
1644
+ };
1645
+ };
1646
+ /** @description Bad Request */
1647
+ 400: {
1648
+ headers: {
1649
+ [name: string]: unknown;
1650
+ };
1651
+ content: {
1652
+ "application/json": {
1653
+ error?: string;
1654
+ /** @default error */
1655
+ status: string;
1656
+ message: string;
1657
+ };
1658
+ };
1659
+ };
1660
+ /** @description Unauthorized */
1661
+ 401: {
1662
+ headers: {
1663
+ [name: string]: unknown;
1664
+ };
1665
+ content: {
1666
+ "application/json": {
1667
+ error?: string;
1668
+ /** @default error */
1669
+ status: string;
1670
+ message: string;
1671
+ };
1672
+ };
1673
+ };
1674
+ /** @description Dataset not found */
1675
+ 404: {
1676
+ headers: {
1677
+ [name: string]: unknown;
1678
+ };
1679
+ content: {
1680
+ "application/json": {
1681
+ error?: string;
1682
+ /** @default error */
1683
+ status: string;
1684
+ message: string;
1685
+ };
1686
+ };
1687
+ };
1688
+ /** @description Unprocessable Entity */
1689
+ 422: {
1690
+ headers: {
1691
+ [name: string]: unknown;
1692
+ };
1693
+ content: {
1694
+ "application/json": {
1695
+ /** @default error */
1696
+ status: string;
1697
+ message: string;
1698
+ };
1699
+ };
1700
+ };
1701
+ /** @description Internal Server Error */
1702
+ 500: {
1703
+ headers: {
1704
+ [name: string]: unknown;
1705
+ };
1706
+ content: {
1707
+ "application/json": {
1708
+ error?: string;
1709
+ /** @default error */
1710
+ status: string;
1711
+ message: string;
1712
+ };
1713
+ };
1714
+ };
1715
+ };
1716
+ };
1717
+ "postApiScenario-events": {
1718
+ parameters: {
1719
+ query?: never;
1720
+ header?: never;
1721
+ path?: never;
1722
+ cookie?: never;
1723
+ };
1724
+ requestBody?: {
1725
+ content: {
1726
+ "application/json": {
1727
+ /** @constant */
1728
+ type: "SCENARIO_RUN_STARTED";
1729
+ timestamp: number;
1730
+ rawEvent?: unknown;
1731
+ batchRunId: string;
1732
+ scenarioId: string;
1733
+ scenarioRunId: string;
1734
+ /** @default default */
1735
+ scenarioSetId?: string;
1736
+ metadata: {
1737
+ name?: string;
1738
+ description?: string;
1739
+ };
1740
+ } | {
1741
+ /** @constant */
1742
+ type: "SCENARIO_RUN_FINISHED";
1743
+ timestamp: number;
1744
+ rawEvent?: unknown;
1745
+ batchRunId: string;
1746
+ scenarioId: string;
1747
+ scenarioRunId: string;
1748
+ /** @default default */
1749
+ scenarioSetId?: string;
1750
+ /** @enum {string} */
1751
+ status: "SUCCESS" | "ERROR" | "CANCELLED" | "IN_PROGRESS" | "PENDING" | "FAILED";
1752
+ results?: {
1753
+ /** @enum {string} */
1754
+ verdict: "success" | "failure" | "inconclusive";
1755
+ reasoning?: string;
1756
+ metCriteria: string[];
1757
+ unmetCriteria: string[];
1758
+ error?: string;
1759
+ } | null;
1760
+ } | {
1761
+ /** @constant */
1762
+ type: "SCENARIO_MESSAGE_SNAPSHOT";
1763
+ timestamp: number;
1764
+ rawEvent?: unknown;
1765
+ messages: ({
1766
+ id: string;
1767
+ /** @constant */
1768
+ role: "developer";
1769
+ content: string;
1770
+ name?: string;
1771
+ } | {
1772
+ id: string;
1773
+ /** @constant */
1774
+ role: "system";
1775
+ content: string;
1776
+ name?: string;
1777
+ } | {
1778
+ id: string;
1779
+ /** @constant */
1780
+ role: "assistant";
1781
+ content?: string;
1782
+ name?: string;
1783
+ toolCalls?: {
1784
+ id: string;
1785
+ /** @constant */
1786
+ type: "function";
1787
+ function: {
1788
+ name: string;
1789
+ arguments: string;
1790
+ };
1791
+ }[];
1792
+ } | {
1793
+ id: string;
1794
+ /** @constant */
1795
+ role: "user";
1796
+ content: string;
1797
+ name?: string;
1798
+ } | {
1799
+ id: string;
1800
+ content: string;
1801
+ /** @constant */
1802
+ role: "tool";
1803
+ toolCallId: string;
1804
+ })[];
1805
+ batchRunId: string;
1806
+ scenarioId: string;
1807
+ scenarioRunId: string;
1808
+ /** @default default */
1809
+ scenarioSetId?: string;
1810
+ };
1811
+ };
1812
+ };
1813
+ responses: {
1814
+ /** @description Event created successfully */
1815
+ 201: {
1816
+ headers: {
1817
+ [name: string]: unknown;
1818
+ };
1819
+ content: {
1820
+ "application/json": {
1821
+ success: boolean;
1822
+ url?: string | null;
1823
+ };
1824
+ };
1825
+ };
1826
+ /** @description Invalid event data */
1827
+ 400: {
1828
+ headers: {
1829
+ [name: string]: unknown;
1830
+ };
1831
+ content: {
1832
+ "application/json": {
1833
+ error: string;
1834
+ };
1835
+ };
1836
+ };
1837
+ /** @description Unauthorized */
1838
+ 401: {
1839
+ headers: {
1840
+ [name: string]: unknown;
1841
+ };
1842
+ content: {
1843
+ "application/json": {
1844
+ error: string;
1845
+ };
1846
+ };
1847
+ };
1848
+ /** @description Internal Server Error */
1849
+ 500: {
1850
+ headers: {
1851
+ [name: string]: unknown;
1852
+ };
1853
+ content: {
1854
+ "application/json": {
1855
+ error: string;
1856
+ };
1857
+ };
1858
+ };
1859
+ };
1860
+ };
1861
+ "deleteApiScenario-events": {
1862
+ parameters: {
1863
+ query?: never;
1864
+ header?: never;
1865
+ path?: never;
1866
+ cookie?: never;
1867
+ };
1868
+ requestBody?: never;
1869
+ responses: {
1870
+ /** @description Events deleted successfully */
1871
+ 200: {
1872
+ headers: {
1873
+ [name: string]: unknown;
1874
+ };
1875
+ content: {
1876
+ "application/json": {
1877
+ success: boolean;
1878
+ url?: string | null;
1879
+ };
1880
+ };
1881
+ };
1882
+ /** @description Bad Request */
1883
+ 400: {
1884
+ headers: {
1885
+ [name: string]: unknown;
1886
+ };
1887
+ content: {
1888
+ "application/json": {
1889
+ error: string;
1890
+ };
1891
+ };
1892
+ };
1893
+ /** @description Unauthorized */
1894
+ 401: {
1895
+ headers: {
1896
+ [name: string]: unknown;
1897
+ };
1898
+ content: {
1899
+ "application/json": {
1900
+ error: string;
1901
+ };
1902
+ };
1903
+ };
1904
+ /** @description Internal Server Error */
1905
+ 500: {
1906
+ headers: {
1907
+ [name: string]: unknown;
1908
+ };
1909
+ content: {
1910
+ "application/json": {
1911
+ error: string;
1912
+ };
1913
+ };
1914
+ };
1915
+ };
1916
+ };
1917
+ }
1918
+
1919
+ type PromptResponse = NonNullable<paths["/api/prompts/{id}"]["get"]["responses"]["200"]["content"]["application/json"]>;
1920
+ type TemplateVariables = Record<string, string | number | boolean | object | null>;
1921
+ /**
1922
+ * Error class for template compilation issues
1923
+ */
1924
+ declare class PromptCompilationError extends Error {
1925
+ readonly template: string;
1926
+ readonly originalError?: any | undefined;
1927
+ constructor(message: string, template: string, originalError?: any | undefined);
1928
+ }
1929
+ declare class Prompt implements PromptResponse {
1930
+ readonly id: string;
1931
+ readonly name: string;
1932
+ readonly updatedAt: string;
1933
+ readonly version: number;
1934
+ readonly versionId: string;
1935
+ readonly versionCreatedAt: string;
1936
+ readonly model: string;
1937
+ readonly prompt: string;
1938
+ readonly messages: PromptResponse["messages"];
1939
+ readonly response_format: PromptResponse["response_format"];
1940
+ constructor(promptData: PromptResponse);
1941
+ /**
1942
+ * Get the raw prompt data from the API
1943
+ */
1944
+ get raw(): PromptResponse;
1945
+ /**
1946
+ * Compile the prompt template with provided variables (lenient - missing variables become empty)
1947
+ * @param variables - Object containing variable values for template compilation
1948
+ * @returns CompiledPrompt instance with compiled content
1949
+ */
1950
+ private _compile;
1951
+ compile(variables?: TemplateVariables): CompiledPrompt;
1952
+ /**
1953
+ * Compile with validation - throws error if required variables are missing
1954
+ * @param variables - Template variables
1955
+ * @returns CompiledPrompt instance with compiled content
1956
+ */
1957
+ compileStrict(variables: TemplateVariables): CompiledPrompt;
1958
+ }
1959
+ /**
1960
+ * Represents a compiled prompt that extends Prompt with reference to the original template
1961
+ */
1962
+ declare class CompiledPrompt extends Prompt {
1963
+ readonly original: Prompt;
1964
+ constructor(compiledData: PromptResponse, original: Prompt);
1965
+ }
1966
+
1967
+ export { CompiledPrompt as C, Prompt as P, type TemplateVariables as T, PromptCompilationError as a };