@convex-dev/agent 0.0.16-alpha.0 → 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.
- package/README.md +92 -71
- package/dist/commonjs/client/index.d.ts +1012 -920
- package/dist/commonjs/client/index.d.ts.map +1 -1
- package/dist/commonjs/client/index.js +188 -31
- package/dist/commonjs/client/index.js.map +1 -1
- package/dist/commonjs/client/playground.d.ts +251 -116
- package/dist/commonjs/client/playground.d.ts.map +1 -1
- package/dist/commonjs/client/playground.js +33 -11
- package/dist/commonjs/client/playground.js.map +1 -1
- package/dist/commonjs/component/messages.d.ts +683 -571
- package/dist/commonjs/component/messages.d.ts.map +1 -1
- package/dist/commonjs/component/messages.js +56 -33
- package/dist/commonjs/component/messages.js.map +1 -1
- package/dist/commonjs/component/schema.d.ts +1080 -1324
- package/dist/commonjs/component/schema.d.ts.map +1 -1
- package/dist/commonjs/component/schema.js +20 -14
- package/dist/commonjs/component/schema.js.map +1 -1
- package/dist/commonjs/component/vector/index.d.ts.map +1 -1
- package/dist/commonjs/component/vector/index.js +4 -6
- package/dist/commonjs/component/vector/index.js.map +1 -1
- package/dist/commonjs/component/vector/tables.d.ts +10 -10
- package/dist/commonjs/component/vector/tables.d.ts.map +1 -1
- package/dist/commonjs/component/vector/tables.js.map +1 -1
- package/dist/commonjs/mapping.d.ts +7 -1
- package/dist/commonjs/mapping.d.ts.map +1 -1
- package/dist/commonjs/mapping.js +39 -18
- package/dist/commonjs/mapping.js.map +1 -1
- package/dist/commonjs/validators.d.ts +1669 -2336
- package/dist/commonjs/validators.d.ts.map +1 -1
- package/dist/commonjs/validators.js +35 -25
- package/dist/commonjs/validators.js.map +1 -1
- package/dist/esm/client/index.d.ts +1012 -920
- package/dist/esm/client/index.d.ts.map +1 -1
- package/dist/esm/client/index.js +188 -31
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/client/playground.d.ts +251 -116
- package/dist/esm/client/playground.d.ts.map +1 -1
- package/dist/esm/client/playground.js +33 -11
- package/dist/esm/client/playground.js.map +1 -1
- package/dist/esm/component/messages.d.ts +683 -571
- package/dist/esm/component/messages.d.ts.map +1 -1
- package/dist/esm/component/messages.js +56 -33
- package/dist/esm/component/messages.js.map +1 -1
- package/dist/esm/component/schema.d.ts +1080 -1324
- package/dist/esm/component/schema.d.ts.map +1 -1
- package/dist/esm/component/schema.js +20 -14
- package/dist/esm/component/schema.js.map +1 -1
- package/dist/esm/component/vector/index.d.ts.map +1 -1
- package/dist/esm/component/vector/index.js +4 -6
- package/dist/esm/component/vector/index.js.map +1 -1
- package/dist/esm/component/vector/tables.d.ts +10 -10
- package/dist/esm/component/vector/tables.d.ts.map +1 -1
- package/dist/esm/component/vector/tables.js.map +1 -1
- package/dist/esm/mapping.d.ts +7 -1
- package/dist/esm/mapping.d.ts.map +1 -1
- package/dist/esm/mapping.js +39 -18
- package/dist/esm/mapping.js.map +1 -1
- package/dist/esm/validators.d.ts +1669 -2336
- package/dist/esm/validators.d.ts.map +1 -1
- package/dist/esm/validators.js +35 -25
- package/dist/esm/validators.js.map +1 -1
- package/package.json +1 -1
- package/src/client/index.test.ts +68 -0
- package/src/client/index.ts +219 -35
- package/src/client/playground.ts +49 -23
- package/src/component/_generated/api.d.ts +311 -323
- package/src/component/messages.test.ts +23 -0
- package/src/component/messages.ts +75 -42
- package/src/component/schema.ts +26 -13
- package/src/component/vector/index.ts +5 -6
- package/src/component/vector/tables.ts +15 -15
- package/src/mapping.ts +65 -32
- package/src/validators.ts +47 -27
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { GenericDataModel, GenericQueryCtx, ApiFromModules } from "convex/server";
|
|
2
|
-
import { type Agent } from "./index";
|
|
3
|
-
import type { UseApi } from "./types";
|
|
2
|
+
import { type AgentComponent, type Agent } from "./index";
|
|
4
3
|
import type { ToolSet } from "ai";
|
|
5
|
-
import { Mounts } from "../component/_generated/api";
|
|
6
4
|
export type PlaygroundAPI = ApiFromModules<{
|
|
7
|
-
playground: ReturnType<typeof definePlaygroundAPI
|
|
5
|
+
playground: ReturnType<typeof definePlaygroundAPI>;
|
|
8
6
|
}>["playground"];
|
|
9
|
-
export declare function definePlaygroundAPI
|
|
7
|
+
export declare function definePlaygroundAPI(component: AgentComponent, { agents, userNameLookup, }: {
|
|
10
8
|
agents: Agent<ToolSet>[];
|
|
11
|
-
userNameLookup?: (ctx: GenericQueryCtx<DataModel>, userId: string) => string | Promise<string>;
|
|
9
|
+
userNameLookup?: <DataModel extends GenericDataModel>(ctx: GenericQueryCtx<DataModel>, userId: string) => string | Promise<string>;
|
|
12
10
|
}): {
|
|
11
|
+
isApiKeyValid: import("convex/server").RegisteredQuery<"public", {
|
|
12
|
+
apiKey: string;
|
|
13
|
+
}, Promise<boolean>>;
|
|
13
14
|
listUsers: import("convex/server").RegisteredQuery<"public", {
|
|
14
15
|
apiKey: string;
|
|
15
16
|
paginationOpts: {
|
|
@@ -22,7 +23,7 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
22
23
|
};
|
|
23
24
|
}, Promise<{
|
|
24
25
|
page: {
|
|
25
|
-
|
|
26
|
+
_id: string;
|
|
26
27
|
name: string;
|
|
27
28
|
}[];
|
|
28
29
|
continueCursor: string;
|
|
@@ -77,102 +78,98 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
77
78
|
agentName?: string | undefined;
|
|
78
79
|
embeddingId?: string | string | string | string | string | string | string | string | string | undefined;
|
|
79
80
|
error?: string | undefined;
|
|
80
|
-
|
|
81
|
+
files?: {
|
|
82
|
+
data?: (ArrayBuffer | string) | undefined;
|
|
83
|
+
fileId?: string | undefined;
|
|
84
|
+
mimeType: string;
|
|
85
|
+
url?: string | undefined;
|
|
86
|
+
}[] | undefined;
|
|
81
87
|
finishReason?: "stop" | "length" | "content-filter" | "tool-calls" | "error" | "other" | "unknown" | undefined;
|
|
82
88
|
id?: string | undefined;
|
|
83
89
|
message?: {
|
|
84
90
|
content: string | ({
|
|
85
|
-
experimental_providerMetadata?: {
|
|
86
|
-
[x: string]: any;
|
|
87
|
-
} | undefined;
|
|
88
91
|
providerOptions?: {
|
|
89
|
-
[x: string]:
|
|
92
|
+
[x: string]: {
|
|
93
|
+
[x: string]: any;
|
|
94
|
+
};
|
|
90
95
|
} | undefined;
|
|
91
96
|
text: string;
|
|
92
97
|
type: "text";
|
|
93
98
|
} | {
|
|
94
|
-
experimental_providerMetadata?: {
|
|
95
|
-
[x: string]: any;
|
|
96
|
-
} | undefined;
|
|
97
99
|
image: string | ArrayBuffer;
|
|
98
100
|
mimeType?: string | undefined;
|
|
99
101
|
providerOptions?: {
|
|
100
|
-
[x: string]:
|
|
102
|
+
[x: string]: {
|
|
103
|
+
[x: string]: any;
|
|
104
|
+
};
|
|
101
105
|
} | undefined;
|
|
102
106
|
type: "image";
|
|
103
107
|
} | {
|
|
104
108
|
data: string | ArrayBuffer;
|
|
105
|
-
experimental_providerMetadata?: {
|
|
106
|
-
[x: string]: any;
|
|
107
|
-
} | undefined;
|
|
108
109
|
mimeType: string;
|
|
109
110
|
providerOptions?: {
|
|
110
|
-
[x: string]:
|
|
111
|
+
[x: string]: {
|
|
112
|
+
[x: string]: any;
|
|
113
|
+
};
|
|
111
114
|
} | undefined;
|
|
112
115
|
type: "file";
|
|
113
116
|
})[];
|
|
114
|
-
experimental_providerMetadata?: {
|
|
115
|
-
[x: string]: any;
|
|
116
|
-
} | undefined;
|
|
117
117
|
providerOptions?: {
|
|
118
|
-
[x: string]:
|
|
118
|
+
[x: string]: {
|
|
119
|
+
[x: string]: any;
|
|
120
|
+
};
|
|
119
121
|
} | undefined;
|
|
120
122
|
role: "user";
|
|
121
123
|
} | {
|
|
122
124
|
content: string | ({
|
|
123
|
-
experimental_providerMetadata?: {
|
|
124
|
-
[x: string]: any;
|
|
125
|
-
} | undefined;
|
|
126
125
|
providerOptions?: {
|
|
127
|
-
[x: string]:
|
|
126
|
+
[x: string]: {
|
|
127
|
+
[x: string]: any;
|
|
128
|
+
};
|
|
128
129
|
} | undefined;
|
|
129
130
|
text: string;
|
|
130
131
|
type: "text";
|
|
131
132
|
} | {
|
|
132
133
|
data: string | ArrayBuffer;
|
|
133
|
-
experimental_providerMetadata?: {
|
|
134
|
-
[x: string]: any;
|
|
135
|
-
} | undefined;
|
|
136
134
|
mimeType: string;
|
|
137
135
|
providerOptions?: {
|
|
138
|
-
[x: string]:
|
|
136
|
+
[x: string]: {
|
|
137
|
+
[x: string]: any;
|
|
138
|
+
};
|
|
139
139
|
} | undefined;
|
|
140
140
|
type: "file";
|
|
141
141
|
} | {
|
|
142
|
-
experimental_providerMetadata?: {
|
|
143
|
-
[x: string]: any;
|
|
144
|
-
} | undefined;
|
|
145
142
|
providerOptions?: {
|
|
146
|
-
[x: string]:
|
|
143
|
+
[x: string]: {
|
|
144
|
+
[x: string]: any;
|
|
145
|
+
};
|
|
147
146
|
} | undefined;
|
|
147
|
+
signature?: string | undefined;
|
|
148
148
|
text: string;
|
|
149
149
|
type: "reasoning";
|
|
150
150
|
} | {
|
|
151
151
|
data: string;
|
|
152
|
-
experimental_providerMetadata?: {
|
|
153
|
-
[x: string]: any;
|
|
154
|
-
} | undefined;
|
|
155
152
|
providerOptions?: {
|
|
156
|
-
[x: string]:
|
|
153
|
+
[x: string]: {
|
|
154
|
+
[x: string]: any;
|
|
155
|
+
};
|
|
157
156
|
} | undefined;
|
|
158
157
|
type: "redacted-reasoning";
|
|
159
158
|
} | {
|
|
160
159
|
args: any;
|
|
161
|
-
experimental_providerMetadata?: {
|
|
162
|
-
[x: string]: any;
|
|
163
|
-
} | undefined;
|
|
164
160
|
providerOptions?: {
|
|
165
|
-
[x: string]:
|
|
161
|
+
[x: string]: {
|
|
162
|
+
[x: string]: any;
|
|
163
|
+
};
|
|
166
164
|
} | undefined;
|
|
167
165
|
toolCallId: string;
|
|
168
166
|
toolName: string;
|
|
169
167
|
type: "tool-call";
|
|
170
168
|
})[];
|
|
171
|
-
experimental_providerMetadata?: {
|
|
172
|
-
[x: string]: any;
|
|
173
|
-
} | undefined;
|
|
174
169
|
providerOptions?: {
|
|
175
|
-
[x: string]:
|
|
170
|
+
[x: string]: {
|
|
171
|
+
[x: string]: any;
|
|
172
|
+
};
|
|
176
173
|
} | undefined;
|
|
177
174
|
role: "assistant";
|
|
178
175
|
} | {
|
|
@@ -186,32 +183,29 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
186
183
|
mimeType?: string | undefined;
|
|
187
184
|
type: "image";
|
|
188
185
|
})[] | undefined;
|
|
189
|
-
experimental_providerMetadata?: {
|
|
190
|
-
[x: string]: any;
|
|
191
|
-
} | undefined;
|
|
192
186
|
isError?: boolean | undefined;
|
|
193
187
|
providerOptions?: {
|
|
194
|
-
[x: string]:
|
|
188
|
+
[x: string]: {
|
|
189
|
+
[x: string]: any;
|
|
190
|
+
};
|
|
195
191
|
} | undefined;
|
|
196
192
|
result: any;
|
|
197
193
|
toolCallId: string;
|
|
198
194
|
toolName: string;
|
|
199
195
|
type: "tool-result";
|
|
200
196
|
}[];
|
|
201
|
-
experimental_providerMetadata?: {
|
|
202
|
-
[x: string]: any;
|
|
203
|
-
} | undefined;
|
|
204
197
|
providerOptions?: {
|
|
205
|
-
[x: string]:
|
|
198
|
+
[x: string]: {
|
|
199
|
+
[x: string]: any;
|
|
200
|
+
};
|
|
206
201
|
} | undefined;
|
|
207
202
|
role: "tool";
|
|
208
203
|
} | {
|
|
209
204
|
content: string;
|
|
210
|
-
experimental_providerMetadata?: {
|
|
211
|
-
[x: string]: any;
|
|
212
|
-
} | undefined;
|
|
213
205
|
providerOptions?: {
|
|
214
|
-
[x: string]:
|
|
206
|
+
[x: string]: {
|
|
207
|
+
[x: string]: any;
|
|
208
|
+
};
|
|
215
209
|
} | undefined;
|
|
216
210
|
role: "system";
|
|
217
211
|
} | undefined;
|
|
@@ -220,12 +214,27 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
220
214
|
parentMessageId?: string | undefined;
|
|
221
215
|
provider?: string | undefined;
|
|
222
216
|
providerMetadata?: {
|
|
223
|
-
[x: string]:
|
|
217
|
+
[x: string]: {
|
|
218
|
+
[x: string]: any;
|
|
219
|
+
};
|
|
220
|
+
} | undefined;
|
|
221
|
+
providerOptions?: {
|
|
222
|
+
[x: string]: {
|
|
223
|
+
[x: string]: any;
|
|
224
|
+
};
|
|
224
225
|
} | undefined;
|
|
225
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;
|
|
226
235
|
sources?: {
|
|
227
236
|
id: string;
|
|
228
|
-
|
|
237
|
+
providerOptions?: {
|
|
229
238
|
[x: string]: {
|
|
230
239
|
[x: string]: any;
|
|
231
240
|
};
|
|
@@ -276,67 +285,56 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
276
285
|
}>>;
|
|
277
286
|
generateText: import("convex/server").RegisteredAction<"public", {
|
|
278
287
|
messages?: ({
|
|
279
|
-
providerOptions?: Record<string, any
|
|
280
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
288
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
281
289
|
role: "user";
|
|
282
290
|
content: string | ({
|
|
283
|
-
providerOptions?: Record<string, any
|
|
284
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
291
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
285
292
|
type: "text";
|
|
286
293
|
text: string;
|
|
287
294
|
} | {
|
|
288
|
-
providerOptions?: Record<string, any
|
|
289
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
295
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
290
296
|
mimeType?: string | undefined;
|
|
291
297
|
type: "image";
|
|
292
298
|
image: string | ArrayBuffer;
|
|
293
299
|
} | {
|
|
294
|
-
providerOptions?: Record<string, any
|
|
295
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
300
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
296
301
|
type: "file";
|
|
297
302
|
mimeType: string;
|
|
298
303
|
data: string | ArrayBuffer;
|
|
299
304
|
})[];
|
|
300
305
|
} | {
|
|
301
|
-
providerOptions?: Record<string, any
|
|
302
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
306
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
303
307
|
role: "assistant";
|
|
304
308
|
content: string | ({
|
|
305
|
-
providerOptions?: Record<string, any
|
|
306
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
309
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
307
310
|
type: "text";
|
|
308
311
|
text: string;
|
|
309
312
|
} | {
|
|
310
|
-
providerOptions?: Record<string, any
|
|
311
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
313
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
312
314
|
type: "file";
|
|
313
315
|
mimeType: string;
|
|
314
316
|
data: string | ArrayBuffer;
|
|
315
317
|
} | {
|
|
316
|
-
providerOptions?: Record<string, any
|
|
317
|
-
|
|
318
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
319
|
+
signature?: string | undefined;
|
|
318
320
|
type: "reasoning";
|
|
319
321
|
text: string;
|
|
320
322
|
} | {
|
|
321
|
-
providerOptions?: Record<string, any
|
|
322
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
323
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
323
324
|
type: "redacted-reasoning";
|
|
324
325
|
data: string;
|
|
325
326
|
} | {
|
|
326
|
-
providerOptions?: Record<string, any
|
|
327
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
327
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
328
328
|
type: "tool-call";
|
|
329
329
|
toolCallId: string;
|
|
330
330
|
toolName: string;
|
|
331
331
|
args: any;
|
|
332
332
|
})[];
|
|
333
333
|
} | {
|
|
334
|
-
providerOptions?: Record<string, any
|
|
335
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
334
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
336
335
|
role: "tool";
|
|
337
336
|
content: {
|
|
338
|
-
providerOptions?: Record<string, any
|
|
339
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
337
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
340
338
|
args?: any;
|
|
341
339
|
experimental_content?: ({
|
|
342
340
|
type: "text";
|
|
@@ -353,12 +351,30 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
353
351
|
result: any;
|
|
354
352
|
}[];
|
|
355
353
|
} | {
|
|
356
|
-
providerOptions?: Record<string, any
|
|
357
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
354
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
358
355
|
role: "system";
|
|
359
356
|
content: string;
|
|
360
357
|
})[] | undefined;
|
|
361
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;
|
|
362
378
|
userId: string;
|
|
363
379
|
threadId: string;
|
|
364
380
|
agentName: string;
|
|
@@ -371,67 +387,56 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
371
387
|
threadId?: string | undefined;
|
|
372
388
|
beforeMessageId?: string | undefined;
|
|
373
389
|
messages: ({
|
|
374
|
-
providerOptions?: Record<string, any
|
|
375
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
390
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
376
391
|
role: "user";
|
|
377
392
|
content: string | ({
|
|
378
|
-
providerOptions?: Record<string, any
|
|
379
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
393
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
380
394
|
type: "text";
|
|
381
395
|
text: string;
|
|
382
396
|
} | {
|
|
383
|
-
providerOptions?: Record<string, any
|
|
384
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
397
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
385
398
|
mimeType?: string | undefined;
|
|
386
399
|
type: "image";
|
|
387
400
|
image: string | ArrayBuffer;
|
|
388
401
|
} | {
|
|
389
|
-
providerOptions?: Record<string, any
|
|
390
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
402
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
391
403
|
type: "file";
|
|
392
404
|
mimeType: string;
|
|
393
405
|
data: string | ArrayBuffer;
|
|
394
406
|
})[];
|
|
395
407
|
} | {
|
|
396
|
-
providerOptions?: Record<string, any
|
|
397
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
408
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
398
409
|
role: "assistant";
|
|
399
410
|
content: string | ({
|
|
400
|
-
providerOptions?: Record<string, any
|
|
401
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
411
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
402
412
|
type: "text";
|
|
403
413
|
text: string;
|
|
404
414
|
} | {
|
|
405
|
-
providerOptions?: Record<string, any
|
|
406
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
415
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
407
416
|
type: "file";
|
|
408
417
|
mimeType: string;
|
|
409
418
|
data: string | ArrayBuffer;
|
|
410
419
|
} | {
|
|
411
|
-
providerOptions?: Record<string, any
|
|
412
|
-
|
|
420
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
421
|
+
signature?: string | undefined;
|
|
413
422
|
type: "reasoning";
|
|
414
423
|
text: string;
|
|
415
424
|
} | {
|
|
416
|
-
providerOptions?: Record<string, any
|
|
417
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
425
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
418
426
|
type: "redacted-reasoning";
|
|
419
427
|
data: string;
|
|
420
428
|
} | {
|
|
421
|
-
providerOptions?: Record<string, any
|
|
422
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
429
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
423
430
|
type: "tool-call";
|
|
424
431
|
toolCallId: string;
|
|
425
432
|
toolName: string;
|
|
426
433
|
args: any;
|
|
427
434
|
})[];
|
|
428
435
|
} | {
|
|
429
|
-
providerOptions?: Record<string, any
|
|
430
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
436
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
431
437
|
role: "tool";
|
|
432
438
|
content: {
|
|
433
|
-
providerOptions?: Record<string, any
|
|
434
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
439
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
435
440
|
args?: any;
|
|
436
441
|
experimental_content?: ({
|
|
437
442
|
type: "text";
|
|
@@ -448,14 +453,13 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
448
453
|
result: any;
|
|
449
454
|
}[];
|
|
450
455
|
} | {
|
|
451
|
-
providerOptions?: Record<string, any
|
|
452
|
-
experimental_providerMetadata?: Record<string, any> | undefined;
|
|
456
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
453
457
|
role: "system";
|
|
454
458
|
content: string;
|
|
455
459
|
})[];
|
|
456
460
|
agentName: string;
|
|
457
461
|
contextOptions: {
|
|
458
|
-
|
|
462
|
+
excludeToolMessages?: boolean | undefined;
|
|
459
463
|
recentMessages?: number | undefined;
|
|
460
464
|
searchOptions?: {
|
|
461
465
|
messageRange?: {
|
|
@@ -469,6 +473,137 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
469
473
|
searchOtherThreads?: boolean | undefined;
|
|
470
474
|
};
|
|
471
475
|
apiKey: string;
|
|
472
|
-
}, Promise<
|
|
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
|
+
}[]>>;
|
|
473
608
|
};
|
|
474
609
|
//# sourceMappingURL=playground.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../../src/client/playground.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,gBAAgB,EAChB,eAAe,
|
|
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"}
|