@convex-dev/agent 0.0.16 → 0.0.17-alpha.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 (108) hide show
  1. package/README.md +159 -98
  2. package/dist/commonjs/client/index.d.ts +806 -189
  3. package/dist/commonjs/client/index.d.ts.map +1 -1
  4. package/dist/commonjs/client/index.js +178 -28
  5. package/dist/commonjs/client/index.js.map +1 -1
  6. package/dist/commonjs/client/playground.d.ts +609 -0
  7. package/dist/commonjs/client/playground.d.ts.map +1 -0
  8. package/dist/commonjs/client/playground.js +200 -0
  9. package/dist/commonjs/client/playground.js.map +1 -0
  10. package/dist/commonjs/component/apiKeys.d.ts +11 -0
  11. package/dist/commonjs/component/apiKeys.d.ts.map +1 -0
  12. package/dist/commonjs/component/apiKeys.js +69 -0
  13. package/dist/commonjs/component/apiKeys.js.map +1 -0
  14. package/dist/commonjs/component/files.d.ts +31 -0
  15. package/dist/commonjs/component/files.d.ts.map +1 -0
  16. package/dist/commonjs/component/files.js +61 -0
  17. package/dist/commonjs/component/files.js.map +1 -0
  18. package/dist/commonjs/component/messages.d.ts +720 -676
  19. package/dist/commonjs/component/messages.d.ts.map +1 -1
  20. package/dist/commonjs/component/messages.js +99 -287
  21. package/dist/commonjs/component/messages.js.map +1 -1
  22. package/dist/commonjs/component/schema.d.ts +1124 -1324
  23. package/dist/commonjs/component/schema.d.ts.map +1 -1
  24. package/dist/commonjs/component/schema.js +26 -14
  25. package/dist/commonjs/component/schema.js.map +1 -1
  26. package/dist/commonjs/component/threads.d.ts +95 -0
  27. package/dist/commonjs/component/threads.d.ts.map +1 -0
  28. package/dist/commonjs/component/threads.js +151 -0
  29. package/dist/commonjs/component/threads.js.map +1 -0
  30. package/dist/commonjs/component/users.d.ts +37 -0
  31. package/dist/commonjs/component/users.d.ts.map +1 -0
  32. package/dist/commonjs/component/users.js +118 -0
  33. package/dist/commonjs/component/users.js.map +1 -0
  34. package/dist/commonjs/component/vector/index.d.ts.map +1 -1
  35. package/dist/commonjs/component/vector/index.js +4 -6
  36. package/dist/commonjs/component/vector/index.js.map +1 -1
  37. package/dist/commonjs/component/vector/tables.d.ts +10 -10
  38. package/dist/commonjs/component/vector/tables.d.ts.map +1 -1
  39. package/dist/commonjs/component/vector/tables.js.map +1 -1
  40. package/dist/commonjs/mapping.d.ts +7 -1
  41. package/dist/commonjs/mapping.d.ts.map +1 -1
  42. package/dist/commonjs/mapping.js +39 -18
  43. package/dist/commonjs/mapping.js.map +1 -1
  44. package/dist/commonjs/validators.d.ts +1669 -2340
  45. package/dist/commonjs/validators.d.ts.map +1 -1
  46. package/dist/commonjs/validators.js +35 -26
  47. package/dist/commonjs/validators.js.map +1 -1
  48. package/dist/esm/client/index.d.ts +806 -189
  49. package/dist/esm/client/index.d.ts.map +1 -1
  50. package/dist/esm/client/index.js +178 -28
  51. package/dist/esm/client/index.js.map +1 -1
  52. package/dist/esm/client/playground.d.ts +609 -0
  53. package/dist/esm/client/playground.d.ts.map +1 -0
  54. package/dist/esm/client/playground.js +200 -0
  55. package/dist/esm/client/playground.js.map +1 -0
  56. package/dist/esm/component/apiKeys.d.ts +11 -0
  57. package/dist/esm/component/apiKeys.d.ts.map +1 -0
  58. package/dist/esm/component/apiKeys.js +69 -0
  59. package/dist/esm/component/apiKeys.js.map +1 -0
  60. package/dist/esm/component/files.d.ts +31 -0
  61. package/dist/esm/component/files.d.ts.map +1 -0
  62. package/dist/esm/component/files.js +61 -0
  63. package/dist/esm/component/files.js.map +1 -0
  64. package/dist/esm/component/messages.d.ts +720 -676
  65. package/dist/esm/component/messages.d.ts.map +1 -1
  66. package/dist/esm/component/messages.js +99 -287
  67. package/dist/esm/component/messages.js.map +1 -1
  68. package/dist/esm/component/schema.d.ts +1124 -1324
  69. package/dist/esm/component/schema.d.ts.map +1 -1
  70. package/dist/esm/component/schema.js +26 -14
  71. package/dist/esm/component/schema.js.map +1 -1
  72. package/dist/esm/component/threads.d.ts +95 -0
  73. package/dist/esm/component/threads.d.ts.map +1 -0
  74. package/dist/esm/component/threads.js +151 -0
  75. package/dist/esm/component/threads.js.map +1 -0
  76. package/dist/esm/component/users.d.ts +37 -0
  77. package/dist/esm/component/users.d.ts.map +1 -0
  78. package/dist/esm/component/users.js +118 -0
  79. package/dist/esm/component/users.js.map +1 -0
  80. package/dist/esm/component/vector/index.d.ts.map +1 -1
  81. package/dist/esm/component/vector/index.js +4 -6
  82. package/dist/esm/component/vector/index.js.map +1 -1
  83. package/dist/esm/component/vector/tables.d.ts +10 -10
  84. package/dist/esm/component/vector/tables.d.ts.map +1 -1
  85. package/dist/esm/component/vector/tables.js.map +1 -1
  86. package/dist/esm/mapping.d.ts +7 -1
  87. package/dist/esm/mapping.d.ts.map +1 -1
  88. package/dist/esm/mapping.js +39 -18
  89. package/dist/esm/mapping.js.map +1 -1
  90. package/dist/esm/validators.d.ts +1669 -2340
  91. package/dist/esm/validators.d.ts.map +1 -1
  92. package/dist/esm/validators.js +35 -26
  93. package/dist/esm/validators.js.map +1 -1
  94. package/package.json +8 -1
  95. package/src/client/index.ts +220 -59
  96. package/src/client/playground.ts +257 -0
  97. package/src/component/_generated/api.d.ts +601 -400
  98. package/src/component/apiKeys.ts +74 -0
  99. package/src/component/files.ts +72 -0
  100. package/src/component/messages.test.ts +23 -0
  101. package/src/component/messages.ts +127 -341
  102. package/src/component/schema.ts +32 -13
  103. package/src/component/threads.ts +184 -0
  104. package/src/component/users.ts +145 -0
  105. package/src/component/vector/index.ts +5 -6
  106. package/src/component/vector/tables.ts +15 -15
  107. package/src/mapping.ts +65 -32
  108. package/src/validators.ts +47 -28
@@ -0,0 +1,609 @@
1
+ import { GenericDataModel, GenericQueryCtx, ApiFromModules } from "convex/server";
2
+ import { type AgentComponent, type Agent } from "./index";
3
+ import type { ToolSet } from "ai";
4
+ export type PlaygroundAPI = ApiFromModules<{
5
+ playground: ReturnType<typeof definePlaygroundAPI>;
6
+ }>["playground"];
7
+ export declare function definePlaygroundAPI(component: AgentComponent, { agents, userNameLookup, }: {
8
+ agents: Agent<ToolSet>[];
9
+ userNameLookup?: <DataModel extends GenericDataModel>(ctx: GenericQueryCtx<DataModel>, userId: string) => string | Promise<string>;
10
+ }): {
11
+ isApiKeyValid: import("convex/server").RegisteredQuery<"public", {
12
+ apiKey: string;
13
+ }, Promise<boolean>>;
14
+ listUsers: import("convex/server").RegisteredQuery<"public", {
15
+ apiKey: string;
16
+ paginationOpts: {
17
+ id?: number | undefined;
18
+ endCursor?: string | null | undefined;
19
+ maximumRowsRead?: number | undefined;
20
+ maximumBytesRead?: number | undefined;
21
+ numItems: number;
22
+ cursor: string | null;
23
+ };
24
+ }, Promise<{
25
+ page: {
26
+ _id: string;
27
+ name: string;
28
+ }[];
29
+ continueCursor: string;
30
+ isDone: boolean;
31
+ pageStatus?: "SplitRecommended" | "SplitRequired" | null | undefined;
32
+ splitCursor?: string | null | undefined;
33
+ }>>;
34
+ listThreads: import("convex/server").RegisteredQuery<"public", {
35
+ userId: string;
36
+ apiKey: string;
37
+ paginationOpts: {
38
+ id?: number | undefined;
39
+ endCursor?: string | null | undefined;
40
+ maximumRowsRead?: number | undefined;
41
+ maximumBytesRead?: number | undefined;
42
+ numItems: number;
43
+ cursor: string | null;
44
+ };
45
+ }, Promise<{
46
+ page: {
47
+ latestMessage: string | undefined;
48
+ lastMessageAt: number;
49
+ _creationTime: number;
50
+ _id: string;
51
+ status: "active" | "archived";
52
+ summary?: string | undefined;
53
+ title?: string | undefined;
54
+ userId?: string | undefined;
55
+ }[];
56
+ continueCursor: string;
57
+ isDone: boolean;
58
+ pageStatus?: "SplitRecommended" | "SplitRequired" | null | undefined;
59
+ splitCursor?: string | null | undefined;
60
+ }>>;
61
+ listMessages: import("convex/server").RegisteredQuery<"public", {
62
+ threadId: string;
63
+ apiKey: string;
64
+ paginationOpts: {
65
+ id?: number | undefined;
66
+ endCursor?: string | null | undefined;
67
+ maximumRowsRead?: number | undefined;
68
+ maximumBytesRead?: number | undefined;
69
+ numItems: number;
70
+ cursor: string | null;
71
+ };
72
+ }, Promise<{
73
+ continueCursor: string;
74
+ isDone: boolean;
75
+ page: {
76
+ _creationTime: number;
77
+ _id: string;
78
+ agentName?: string | undefined;
79
+ embeddingId?: string | string | string | string | string | string | string | string | string | undefined;
80
+ error?: string | undefined;
81
+ files?: {
82
+ data?: (ArrayBuffer | string) | undefined;
83
+ fileId?: string | undefined;
84
+ mimeType: string;
85
+ url?: string | undefined;
86
+ }[] | undefined;
87
+ finishReason?: "stop" | "length" | "content-filter" | "tool-calls" | "error" | "other" | "unknown" | undefined;
88
+ id?: string | undefined;
89
+ message?: {
90
+ content: string | ({
91
+ providerOptions?: {
92
+ [x: string]: {
93
+ [x: string]: any;
94
+ };
95
+ } | undefined;
96
+ text: string;
97
+ type: "text";
98
+ } | {
99
+ image: string | ArrayBuffer;
100
+ mimeType?: string | undefined;
101
+ providerOptions?: {
102
+ [x: string]: {
103
+ [x: string]: any;
104
+ };
105
+ } | undefined;
106
+ type: "image";
107
+ } | {
108
+ data: string | ArrayBuffer;
109
+ mimeType: string;
110
+ providerOptions?: {
111
+ [x: string]: {
112
+ [x: string]: any;
113
+ };
114
+ } | undefined;
115
+ type: "file";
116
+ })[];
117
+ providerOptions?: {
118
+ [x: string]: {
119
+ [x: string]: any;
120
+ };
121
+ } | undefined;
122
+ role: "user";
123
+ } | {
124
+ content: string | ({
125
+ providerOptions?: {
126
+ [x: string]: {
127
+ [x: string]: any;
128
+ };
129
+ } | undefined;
130
+ text: string;
131
+ type: "text";
132
+ } | {
133
+ data: string | ArrayBuffer;
134
+ mimeType: string;
135
+ providerOptions?: {
136
+ [x: string]: {
137
+ [x: string]: any;
138
+ };
139
+ } | undefined;
140
+ type: "file";
141
+ } | {
142
+ providerOptions?: {
143
+ [x: string]: {
144
+ [x: string]: any;
145
+ };
146
+ } | undefined;
147
+ signature?: string | undefined;
148
+ text: string;
149
+ type: "reasoning";
150
+ } | {
151
+ data: string;
152
+ providerOptions?: {
153
+ [x: string]: {
154
+ [x: string]: any;
155
+ };
156
+ } | undefined;
157
+ type: "redacted-reasoning";
158
+ } | {
159
+ args: any;
160
+ providerOptions?: {
161
+ [x: string]: {
162
+ [x: string]: any;
163
+ };
164
+ } | undefined;
165
+ toolCallId: string;
166
+ toolName: string;
167
+ type: "tool-call";
168
+ })[];
169
+ providerOptions?: {
170
+ [x: string]: {
171
+ [x: string]: any;
172
+ };
173
+ } | undefined;
174
+ role: "assistant";
175
+ } | {
176
+ content: {
177
+ args?: any;
178
+ experimental_content?: ({
179
+ text: string;
180
+ type: "text";
181
+ } | {
182
+ data: string;
183
+ mimeType?: string | undefined;
184
+ type: "image";
185
+ })[] | undefined;
186
+ isError?: boolean | undefined;
187
+ providerOptions?: {
188
+ [x: string]: {
189
+ [x: string]: any;
190
+ };
191
+ } | undefined;
192
+ result: any;
193
+ toolCallId: string;
194
+ toolName: string;
195
+ type: "tool-result";
196
+ }[];
197
+ providerOptions?: {
198
+ [x: string]: {
199
+ [x: string]: any;
200
+ };
201
+ } | undefined;
202
+ role: "tool";
203
+ } | {
204
+ content: string;
205
+ providerOptions?: {
206
+ [x: string]: {
207
+ [x: string]: any;
208
+ };
209
+ } | undefined;
210
+ role: "system";
211
+ } | undefined;
212
+ model?: string | undefined;
213
+ order: number;
214
+ parentMessageId?: string | undefined;
215
+ provider?: string | undefined;
216
+ providerMetadata?: {
217
+ [x: string]: {
218
+ [x: string]: any;
219
+ };
220
+ } | undefined;
221
+ providerOptions?: {
222
+ [x: string]: {
223
+ [x: string]: any;
224
+ };
225
+ } | undefined;
226
+ reasoning?: string | undefined;
227
+ reasoningDetails?: ({
228
+ signature?: string | undefined;
229
+ text: string;
230
+ type: "text";
231
+ } | {
232
+ data: string;
233
+ type: "redacted";
234
+ })[] | undefined;
235
+ sources?: {
236
+ id: string;
237
+ providerOptions?: {
238
+ [x: string]: {
239
+ [x: string]: any;
240
+ };
241
+ } | undefined;
242
+ sourceType: "url";
243
+ title?: string | undefined;
244
+ url: string;
245
+ }[] | undefined;
246
+ status: "pending" | "success" | "failed";
247
+ stepId?: string | undefined;
248
+ stepOrder: number;
249
+ text?: string | undefined;
250
+ threadId: string;
251
+ tool: boolean;
252
+ usage?: {
253
+ completionTokens: number;
254
+ promptTokens: number;
255
+ totalTokens: number;
256
+ } | undefined;
257
+ userId?: string | undefined;
258
+ warnings?: ({
259
+ details?: string | undefined;
260
+ setting: string;
261
+ type: "unsupported-setting";
262
+ } | {
263
+ details?: string | undefined;
264
+ tool: any;
265
+ type: "unsupported-tool";
266
+ } | {
267
+ message: string;
268
+ type: "other";
269
+ })[] | undefined;
270
+ }[];
271
+ pageStatus?: "SplitRecommended" | "SplitRequired" | null | undefined;
272
+ splitCursor?: string | null | undefined;
273
+ }>>;
274
+ listAgents: import("convex/server").RegisteredQuery<"public", {
275
+ apiKey: string;
276
+ }, Promise<string[]>>;
277
+ createThread: import("convex/server").RegisteredMutation<"public", {
278
+ title?: string | undefined;
279
+ summary?: string | undefined;
280
+ userId: string;
281
+ agentName: string;
282
+ apiKey: string;
283
+ }, Promise<{
284
+ threadId: string;
285
+ }>>;
286
+ generateText: import("convex/server").RegisteredAction<"public", {
287
+ messages?: ({
288
+ providerOptions?: Record<string, Record<string, any>> | undefined;
289
+ role: "user";
290
+ content: string | ({
291
+ providerOptions?: Record<string, Record<string, any>> | undefined;
292
+ type: "text";
293
+ text: string;
294
+ } | {
295
+ providerOptions?: Record<string, Record<string, any>> | undefined;
296
+ mimeType?: string | undefined;
297
+ type: "image";
298
+ image: string | ArrayBuffer;
299
+ } | {
300
+ providerOptions?: Record<string, Record<string, any>> | undefined;
301
+ type: "file";
302
+ mimeType: string;
303
+ data: string | ArrayBuffer;
304
+ })[];
305
+ } | {
306
+ providerOptions?: Record<string, Record<string, any>> | undefined;
307
+ role: "assistant";
308
+ content: string | ({
309
+ providerOptions?: Record<string, Record<string, any>> | undefined;
310
+ type: "text";
311
+ text: string;
312
+ } | {
313
+ providerOptions?: Record<string, Record<string, any>> | undefined;
314
+ type: "file";
315
+ mimeType: string;
316
+ data: string | ArrayBuffer;
317
+ } | {
318
+ providerOptions?: Record<string, Record<string, any>> | undefined;
319
+ signature?: string | undefined;
320
+ type: "reasoning";
321
+ text: string;
322
+ } | {
323
+ providerOptions?: Record<string, Record<string, any>> | undefined;
324
+ type: "redacted-reasoning";
325
+ data: string;
326
+ } | {
327
+ providerOptions?: Record<string, Record<string, any>> | undefined;
328
+ type: "tool-call";
329
+ toolCallId: string;
330
+ toolName: string;
331
+ args: any;
332
+ })[];
333
+ } | {
334
+ providerOptions?: Record<string, Record<string, any>> | undefined;
335
+ role: "tool";
336
+ content: {
337
+ providerOptions?: Record<string, Record<string, any>> | undefined;
338
+ args?: any;
339
+ experimental_content?: ({
340
+ type: "text";
341
+ text: string;
342
+ } | {
343
+ mimeType?: string | undefined;
344
+ type: "image";
345
+ data: string;
346
+ })[] | undefined;
347
+ isError?: boolean | undefined;
348
+ type: "tool-result";
349
+ toolCallId: string;
350
+ toolName: string;
351
+ result: any;
352
+ }[];
353
+ } | {
354
+ providerOptions?: Record<string, Record<string, any>> | undefined;
355
+ role: "system";
356
+ content: string;
357
+ })[] | undefined;
358
+ prompt?: string | undefined;
359
+ contextOptions?: {
360
+ excludeToolMessages?: boolean | undefined;
361
+ recentMessages?: number | undefined;
362
+ searchOptions?: {
363
+ messageRange?: {
364
+ before: number;
365
+ after: number;
366
+ } | undefined;
367
+ textSearch?: boolean | undefined;
368
+ vectorSearch?: boolean | undefined;
369
+ limit: number;
370
+ } | undefined;
371
+ searchOtherThreads?: boolean | undefined;
372
+ } | undefined;
373
+ storageOptions?: {
374
+ saveAllInputMessages?: boolean | undefined;
375
+ saveAnyInputMessages?: boolean | undefined;
376
+ saveOutputMessages?: boolean | undefined;
377
+ } | undefined;
378
+ userId: string;
379
+ threadId: string;
380
+ agentName: string;
381
+ apiKey: string;
382
+ }, Promise<import("ai").GenerateTextResult<ToolSet, never> & import("./index").GenerationOutputMetadata & {
383
+ messageId: string;
384
+ }>>;
385
+ fetchPromptContext: import("convex/server").RegisteredAction<"public", {
386
+ userId?: string | undefined;
387
+ threadId?: string | undefined;
388
+ beforeMessageId?: string | undefined;
389
+ messages: ({
390
+ providerOptions?: Record<string, Record<string, any>> | undefined;
391
+ role: "user";
392
+ content: string | ({
393
+ providerOptions?: Record<string, Record<string, any>> | undefined;
394
+ type: "text";
395
+ text: string;
396
+ } | {
397
+ providerOptions?: Record<string, Record<string, any>> | undefined;
398
+ mimeType?: string | undefined;
399
+ type: "image";
400
+ image: string | ArrayBuffer;
401
+ } | {
402
+ providerOptions?: Record<string, Record<string, any>> | undefined;
403
+ type: "file";
404
+ mimeType: string;
405
+ data: string | ArrayBuffer;
406
+ })[];
407
+ } | {
408
+ providerOptions?: Record<string, Record<string, any>> | undefined;
409
+ role: "assistant";
410
+ content: string | ({
411
+ providerOptions?: Record<string, Record<string, any>> | undefined;
412
+ type: "text";
413
+ text: string;
414
+ } | {
415
+ providerOptions?: Record<string, Record<string, any>> | undefined;
416
+ type: "file";
417
+ mimeType: string;
418
+ data: string | ArrayBuffer;
419
+ } | {
420
+ providerOptions?: Record<string, Record<string, any>> | undefined;
421
+ signature?: string | undefined;
422
+ type: "reasoning";
423
+ text: string;
424
+ } | {
425
+ providerOptions?: Record<string, Record<string, any>> | undefined;
426
+ type: "redacted-reasoning";
427
+ data: string;
428
+ } | {
429
+ providerOptions?: Record<string, Record<string, any>> | undefined;
430
+ type: "tool-call";
431
+ toolCallId: string;
432
+ toolName: string;
433
+ args: any;
434
+ })[];
435
+ } | {
436
+ providerOptions?: Record<string, Record<string, any>> | undefined;
437
+ role: "tool";
438
+ content: {
439
+ providerOptions?: Record<string, Record<string, any>> | undefined;
440
+ args?: any;
441
+ experimental_content?: ({
442
+ type: "text";
443
+ text: string;
444
+ } | {
445
+ mimeType?: string | undefined;
446
+ type: "image";
447
+ data: string;
448
+ })[] | undefined;
449
+ isError?: boolean | undefined;
450
+ type: "tool-result";
451
+ toolCallId: string;
452
+ toolName: string;
453
+ result: any;
454
+ }[];
455
+ } | {
456
+ providerOptions?: Record<string, Record<string, any>> | undefined;
457
+ role: "system";
458
+ content: string;
459
+ })[];
460
+ agentName: string;
461
+ contextOptions: {
462
+ excludeToolMessages?: boolean | undefined;
463
+ recentMessages?: number | undefined;
464
+ searchOptions?: {
465
+ messageRange?: {
466
+ before: number;
467
+ after: number;
468
+ } | undefined;
469
+ textSearch?: boolean | undefined;
470
+ vectorSearch?: boolean | undefined;
471
+ limit: number;
472
+ } | undefined;
473
+ searchOtherThreads?: boolean | undefined;
474
+ };
475
+ apiKey: string;
476
+ }, Promise<{
477
+ id?: string | undefined;
478
+ userId?: string | undefined;
479
+ parentMessageId?: string | undefined;
480
+ stepId?: string | undefined;
481
+ embeddingId?: string | undefined;
482
+ error?: string | undefined;
483
+ agentName?: string | undefined;
484
+ model?: string | undefined;
485
+ provider?: string | undefined;
486
+ providerOptions?: Record<string, Record<string, any>> | undefined;
487
+ message?: {
488
+ providerOptions?: Record<string, Record<string, any>> | undefined;
489
+ role: "user";
490
+ content: string | ({
491
+ providerOptions?: Record<string, Record<string, any>> | undefined;
492
+ type: "text";
493
+ text: string;
494
+ } | {
495
+ providerOptions?: Record<string, Record<string, any>> | undefined;
496
+ mimeType?: string | undefined;
497
+ type: "image";
498
+ image: string | ArrayBuffer;
499
+ } | {
500
+ providerOptions?: Record<string, Record<string, any>> | undefined;
501
+ type: "file";
502
+ mimeType: string;
503
+ data: string | ArrayBuffer;
504
+ })[];
505
+ } | {
506
+ providerOptions?: Record<string, Record<string, any>> | undefined;
507
+ role: "assistant";
508
+ content: string | ({
509
+ providerOptions?: Record<string, Record<string, any>> | undefined;
510
+ type: "text";
511
+ text: string;
512
+ } | {
513
+ providerOptions?: Record<string, Record<string, any>> | undefined;
514
+ type: "file";
515
+ mimeType: string;
516
+ data: string | ArrayBuffer;
517
+ } | {
518
+ providerOptions?: Record<string, Record<string, any>> | undefined;
519
+ signature?: string | undefined;
520
+ type: "reasoning";
521
+ text: string;
522
+ } | {
523
+ providerOptions?: Record<string, Record<string, any>> | undefined;
524
+ type: "redacted-reasoning";
525
+ data: string;
526
+ } | {
527
+ providerOptions?: Record<string, Record<string, any>> | undefined;
528
+ type: "tool-call";
529
+ toolCallId: string;
530
+ toolName: string;
531
+ args: any;
532
+ })[];
533
+ } | {
534
+ providerOptions?: Record<string, Record<string, any>> | undefined;
535
+ role: "tool";
536
+ content: {
537
+ providerOptions?: Record<string, Record<string, any>> | undefined;
538
+ args?: any;
539
+ experimental_content?: ({
540
+ type: "text";
541
+ text: string;
542
+ } | {
543
+ mimeType?: string | undefined;
544
+ type: "image";
545
+ data: string;
546
+ })[] | undefined;
547
+ isError?: boolean | undefined;
548
+ type: "tool-result";
549
+ toolCallId: string;
550
+ toolName: string;
551
+ result: any;
552
+ }[];
553
+ } | {
554
+ providerOptions?: Record<string, Record<string, any>> | undefined;
555
+ role: "system";
556
+ content: string;
557
+ } | undefined;
558
+ text?: string | undefined;
559
+ reasoning?: string | undefined;
560
+ files?: {
561
+ bytes?: ArrayBuffer | undefined;
562
+ url?: string | undefined;
563
+ fileId?: string | undefined;
564
+ mimeType: string;
565
+ }[] | undefined;
566
+ usage?: {
567
+ promptTokens: number;
568
+ completionTokens: number;
569
+ totalTokens: number;
570
+ } | undefined;
571
+ providerMetadata?: Record<string, Record<string, any>> | undefined;
572
+ sources?: {
573
+ title?: string | undefined;
574
+ providerOptions?: Record<string, Record<string, any>> | undefined;
575
+ id: string;
576
+ url: string;
577
+ sourceType: "url";
578
+ }[] | undefined;
579
+ reasoningDetails?: ({
580
+ signature?: string | undefined;
581
+ type: "text";
582
+ text: string;
583
+ } | {
584
+ type: "redacted";
585
+ data: string;
586
+ })[] | undefined;
587
+ warnings?: ({
588
+ details?: string | undefined;
589
+ type: "unsupported-setting";
590
+ setting: string;
591
+ } | {
592
+ details?: string | undefined;
593
+ type: "unsupported-tool";
594
+ tool: any;
595
+ } | {
596
+ type: "other";
597
+ message: string;
598
+ })[] | undefined;
599
+ finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
600
+ status: "pending" | "success" | "failed";
601
+ order: number;
602
+ _creationTime: number;
603
+ threadId: string;
604
+ stepOrder: number;
605
+ tool: boolean;
606
+ _id: string;
607
+ }[]>>;
608
+ };
609
+ //# sourceMappingURL=playground.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../../src/client/playground.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,gBAAgB,EAChB,eAAe,EACf,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAOL,KAAK,cAAc,EACnB,KAAK,KAAK,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAGlC,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;IACzC,UAAU,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACpD,CAAC,CAAC,YAAY,CAAC,CAAC;AAGjB,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,cAAc,EACzB,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,SAAS,SAAS,gBAAgB,EAClD,GAAG,EAAE,eAAe,CAAC,SAAS,CAAC,EAC/B,MAAM,EAAE,MAAM,KACX,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwNF"}