@convex-dev/agent 0.6.0-alpha.0 → 0.6.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +153 -0
- package/dist/client/createTool.d.ts +18 -21
- package/dist/client/createTool.d.ts.map +1 -1
- package/dist/client/createTool.js +3 -2
- package/dist/client/createTool.js.map +1 -1
- package/dist/client/definePlaygroundAPI.d.ts +48 -48
- package/dist/client/index.d.ts +109 -62
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +92 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/messages.d.ts +12 -12
- package/dist/client/mockModel.d.ts.map +1 -1
- package/dist/client/mockModel.js +9 -2
- package/dist/client/mockModel.js.map +1 -1
- package/dist/client/search.d.ts +12 -12
- package/dist/client/search.d.ts.map +1 -1
- package/dist/client/search.js +3 -3
- package/dist/client/search.js.map +1 -1
- package/dist/client/start.d.ts +1 -1
- package/dist/client/start.d.ts.map +1 -1
- package/dist/client/start.js +28 -14
- package/dist/client/start.js.map +1 -1
- package/dist/client/streamText.d.ts.map +1 -1
- package/dist/client/streamText.js +27 -3
- package/dist/client/streamText.js.map +1 -1
- package/dist/client/streaming.d.ts +105 -94
- package/dist/client/streaming.d.ts.map +1 -1
- package/dist/client/streaming.js +28 -8
- package/dist/client/streaming.js.map +1 -1
- package/dist/client/types.d.ts +13 -12
- package/dist/client/types.d.ts.map +1 -1
- package/dist/component/_generated/component.d.ts +1 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/messages.d.ts +143 -142
- package/dist/component/messages.d.ts.map +1 -1
- package/dist/component/messages.js +13 -3
- package/dist/component/messages.js.map +1 -1
- package/dist/component/streams.d.ts +5 -5
- package/dist/component/threads.d.ts +19 -19
- package/dist/component/users.d.ts +3 -3
- package/dist/deltas.d.ts.map +1 -1
- package/dist/deltas.js +0 -1
- package/dist/deltas.js.map +1 -1
- package/dist/mapping.d.ts +19 -1
- package/dist/mapping.d.ts.map +1 -1
- package/dist/mapping.js +57 -6
- package/dist/mapping.js.map +1 -1
- package/dist/react/useDeltaStreams.d.ts.map +1 -1
- package/dist/react/useDeltaStreams.js +5 -0
- package/dist/react/useDeltaStreams.js.map +1 -1
- package/package.json +4 -2
- package/src/client/approval.test.ts +350 -0
- package/src/client/createTool.ts +50 -52
- package/src/client/index.ts +120 -1
- package/src/client/mockModel.ts +9 -2
- package/src/client/search.ts +7 -3
- package/src/client/start.ts +41 -24
- package/src/client/streamText.ts +27 -3
- package/src/client/streaming.ts +33 -11
- package/src/client/types.ts +14 -12
- package/src/component/_generated/component.ts +53 -64
- package/src/component/messages.ts +12 -2
- package/src/deltas.ts +0 -1
- package/src/mapping.test.ts +77 -0
- package/src/mapping.ts +62 -6
- package/src/react/useDeltaStreams.ts +6 -0
package/MIGRATION.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Migration Guide: v0.3.x to v0.6.0 (AI SDK v6)
|
|
2
|
+
|
|
3
|
+
This guide helps you upgrade from @convex-dev/agent v0.3.x to v0.6.0.
|
|
4
|
+
|
|
5
|
+
## Step 1: Update dependencies
|
|
6
|
+
|
|
7
|
+
Update all AI SDK packages **together** to avoid peer dependency conflicts:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @convex-dev/agent@^0.6.0 ai@^6.0.35 @ai-sdk/provider-utils@^4.0.6
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Official AI SDK providers
|
|
14
|
+
|
|
15
|
+
Update your AI SDK provider packages to v3.x:
|
|
16
|
+
```bash
|
|
17
|
+
# For OpenAI
|
|
18
|
+
npm install @ai-sdk/openai@^3.0.10
|
|
19
|
+
|
|
20
|
+
# For Anthropic
|
|
21
|
+
npm install @ai-sdk/anthropic@^3.0.13
|
|
22
|
+
|
|
23
|
+
# For Groq
|
|
24
|
+
npm install @ai-sdk/groq@^3.0.8
|
|
25
|
+
|
|
26
|
+
# For Google (Gemini)
|
|
27
|
+
npm install @ai-sdk/google@^3.0.8
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Third-party providers
|
|
31
|
+
|
|
32
|
+
Third-party providers also need updates to be compatible with AI SDK v6:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# For OpenRouter
|
|
36
|
+
npm install @openrouter/ai-sdk-provider@^2.0.0
|
|
37
|
+
|
|
38
|
+
# For other providers, check their documentation for AI SDK v6 compatibility
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Handling dependency conflicts
|
|
42
|
+
|
|
43
|
+
If you see peer dependency warnings or errors, try updating all packages at once:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm install @convex-dev/agent@^0.6.0 ai@^6.0.35 @ai-sdk/openai@^3.0.10 @openrouter/ai-sdk-provider@^2.0.0
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If you still have conflicts, you can use `--force` as a last resort:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install @convex-dev/agent@^0.6.0 --force
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> **Note**: Using `--force` can lead to inconsistent dependency trees. After using it, verify your app works correctly and consider running `npm dedupe` to clean up.
|
|
56
|
+
|
|
57
|
+
## Step 2: Update tool definitions
|
|
58
|
+
|
|
59
|
+
Replace `parameters` with `inputSchema`:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
// Before (v5)
|
|
63
|
+
const myTool = createTool({
|
|
64
|
+
description: "My tool",
|
|
65
|
+
parameters: z.object({ query: z.string() }),
|
|
66
|
+
execute: async (ctx, args) => { ... }
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
// After (v6)
|
|
70
|
+
const myTool = createTool({
|
|
71
|
+
description: "My tool",
|
|
72
|
+
inputSchema: z.object({ query: z.string() }),
|
|
73
|
+
execute: async (ctx, input, options) => { ... }
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Step 3: Update Agent config (if using embeddings)
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
// Before
|
|
81
|
+
new Agent(components.agent, {
|
|
82
|
+
textEmbeddingModel: openai.embedding("text-embedding-3-small")
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
// After
|
|
86
|
+
new Agent(components.agent, {
|
|
87
|
+
embeddingModel: openai.embedding("text-embedding-3-small")
|
|
88
|
+
})
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Step 4: Update maxSteps (optional)
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
// Before
|
|
95
|
+
await agent.generateText(ctx, { threadId }, {
|
|
96
|
+
prompt: "...",
|
|
97
|
+
maxSteps: 5
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
// After (maxSteps still works, but stopWhen is preferred)
|
|
101
|
+
import { stepCountIs } from "ai"
|
|
102
|
+
await agent.generateText(ctx, { threadId }, {
|
|
103
|
+
prompt: "...",
|
|
104
|
+
stopWhen: stepCountIs(5)
|
|
105
|
+
})
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Step 5: Verify
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm run typecheck
|
|
112
|
+
npm test
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Common Issues
|
|
116
|
+
|
|
117
|
+
### EmbeddingModelV2 vs EmbeddingModelV3 type errors
|
|
118
|
+
Ensure all `@ai-sdk/*` packages are updated to v3.x. Older versions use AI SDK v5 types.
|
|
119
|
+
|
|
120
|
+
### Tool `args` vs `input`
|
|
121
|
+
AI SDK v6 renamed `args` to `input` in tool calls. The library maintains backwards compatibility, but you may see this in types.
|
|
122
|
+
|
|
123
|
+
### `mimeType` vs `mediaType`
|
|
124
|
+
AI SDK v6 renamed `mimeType` to `mediaType`. Backwards compatibility is maintained.
|
|
125
|
+
|
|
126
|
+
### Peer dependency conflicts
|
|
127
|
+
|
|
128
|
+
If you see errors like:
|
|
129
|
+
```
|
|
130
|
+
npm error ERESOLVE unable to resolve dependency tree
|
|
131
|
+
npm error peer ai@"^5.0.0" from @openrouter/ai-sdk-provider@1.0.3
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
This means a third-party provider needs updating. Common solutions:
|
|
135
|
+
|
|
136
|
+
1. **Update the provider** to a version compatible with AI SDK v6
|
|
137
|
+
2. **Check npm** for the latest version: `npm view @openrouter/ai-sdk-provider versions`
|
|
138
|
+
3. **Use `--force`** if a compatible version isn't available yet (temporary workaround)
|
|
139
|
+
|
|
140
|
+
### Third-party provider compatibility
|
|
141
|
+
|
|
142
|
+
| Provider | AI SDK v5 (ai@5.x) | AI SDK v6 (ai@6.x) |
|
|
143
|
+
|----------|-------------------|-------------------|
|
|
144
|
+
| @openrouter/ai-sdk-provider | v1.x | v2.x |
|
|
145
|
+
| @ai-sdk/openai | v1.x-v2.x | v3.x |
|
|
146
|
+
| @ai-sdk/anthropic | v1.x-v2.x | v3.x |
|
|
147
|
+
| @ai-sdk/groq | v1.x-v2.x | v3.x |
|
|
148
|
+
| @ai-sdk/google | v1.x-v2.x | v3.x |
|
|
149
|
+
|
|
150
|
+
## More Information
|
|
151
|
+
|
|
152
|
+
- [AI SDK v6 Migration Guide](https://ai-sdk.dev/docs/migration-guides/migration-guide-6-0)
|
|
153
|
+
- [Convex Agent Documentation](https://docs.convex.dev/agents)
|
|
@@ -31,27 +31,31 @@ export type ToolNeedsApprovalFunctionCtx<INPUT, Ctx extends ToolCtx = ToolCtx> =
|
|
|
31
31
|
}) => boolean | PromiseLike<boolean>;
|
|
32
32
|
export type ToolExecuteFunctionCtx<INPUT, OUTPUT, Ctx extends ToolCtx = ToolCtx> = (ctx: Ctx, input: INPUT, options: ToolExecutionOptions) => AsyncIterable<OUTPUT> | PromiseLike<OUTPUT>;
|
|
33
33
|
type NeverOptional<N, T> = 0 extends 1 & N ? Partial<T> : [N] extends [never] ? Partial<Record<keyof T, undefined>> : T;
|
|
34
|
+
/**
|
|
35
|
+
* Error message type for deprecated 'handler' property.
|
|
36
|
+
* Using a string literal type causes TypeScript to show this message in errors.
|
|
37
|
+
*/
|
|
38
|
+
type HANDLER_REMOVED_ERROR = "⚠️ 'handler' was removed in @convex-dev/agent v0.6.0. Rename to 'execute'. See: node_modules/@convex-dev/agent/MIGRATION.md";
|
|
34
39
|
export type ToolOutputPropertiesCtx<INPUT, OUTPUT, Ctx extends ToolCtx = ToolCtx> = NeverOptional<OUTPUT, {
|
|
35
40
|
/**
|
|
36
41
|
* An async function that is called with the arguments from the tool call and produces a result.
|
|
37
|
-
* If `execute`
|
|
42
|
+
* If `execute` is not provided, the tool will not be executed automatically.
|
|
38
43
|
*
|
|
39
44
|
* @param input - The input of the tool call.
|
|
40
45
|
* @param options.abortSignal - A signal that can be used to abort the tool call.
|
|
41
46
|
*/
|
|
42
|
-
execute
|
|
43
|
-
outputSchema?: FlexibleSchema<OUTPUT>;
|
|
44
|
-
handler?: never;
|
|
45
|
-
} | {
|
|
46
|
-
/** @deprecated Use execute instead. */
|
|
47
|
-
handler: ToolExecuteFunctionCtx<INPUT, OUTPUT, Ctx>;
|
|
47
|
+
execute?: ToolExecuteFunctionCtx<INPUT, OUTPUT, Ctx>;
|
|
48
48
|
outputSchema?: FlexibleSchema<OUTPUT>;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
handler?: never;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Removed in v0.6.0. Use `execute` instead.
|
|
51
|
+
*/
|
|
52
|
+
handler?: HANDLER_REMOVED_ERROR;
|
|
54
53
|
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Error message type for deprecated 'args' property.
|
|
56
|
+
* Using a string literal type causes TypeScript to show this message in errors.
|
|
57
|
+
*/
|
|
58
|
+
type ARGS_REMOVED_ERROR = "⚠️ 'args' was removed in @convex-dev/agent v0.6.0. Rename to 'inputSchema'. See: node_modules/@convex-dev/agent/MIGRATION.md";
|
|
55
59
|
export type ToolInputProperties<INPUT> = {
|
|
56
60
|
/**
|
|
57
61
|
* The schema of the input that the tool expects.
|
|
@@ -61,17 +65,10 @@ export type ToolInputProperties<INPUT> = {
|
|
|
61
65
|
* You can use descriptions on the schema properties to make the input understandable for the language model.
|
|
62
66
|
*/
|
|
63
67
|
inputSchema: FlexibleSchema<INPUT>;
|
|
64
|
-
args?: never;
|
|
65
|
-
} | {
|
|
66
68
|
/**
|
|
67
|
-
*
|
|
68
|
-
* It is also used to validate the output of the language model.
|
|
69
|
-
* Use descriptions to make the input understandable for the language model.
|
|
70
|
-
*
|
|
71
|
-
* @deprecated Use inputSchema instead.
|
|
69
|
+
* @deprecated Removed in v0.6.0. Use `inputSchema` instead.
|
|
72
70
|
*/
|
|
73
|
-
args
|
|
74
|
-
inputSchema?: never;
|
|
71
|
+
args?: ARGS_REMOVED_ERROR;
|
|
75
72
|
};
|
|
76
73
|
/**
|
|
77
74
|
* This is a wrapper around the ai.tool function that adds extra context to the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTool.d.ts","sourceRoot":"","sources":["../../src/client/createTool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,IAAI,EACJ,oBAAoB,EACpB,OAAO,EACR,MAAM,IAAI,CAAC;AAEZ,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAWxC,MAAM,MAAM,OAAO,CAAC,SAAS,SAAS,gBAAgB,GAAG,gBAAgB,IACvE,gBAAgB,CAAC,SAAS,CAAC,GAAG;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,Q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C,CA+FrB;AAMD,wBAAgB,SAAS,CACvB,GAAG,EAAE,OAAO,EACZ,GAAG,QAAQ,EAAE,CAAC,OAAO,GAAG,SAAS,CAAC,EAAE,GACnC,OAAO,CAgBT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tool } from "ai";
|
|
2
|
-
const MIGRATION_URL = "
|
|
2
|
+
const MIGRATION_URL = "node_modules/@convex-dev/agent/MIGRATION.md";
|
|
3
3
|
const warnedDeprecations = new Set();
|
|
4
4
|
function warnDeprecation(key, message) {
|
|
5
5
|
if (!warnedDeprecations.has(key)) {
|
|
@@ -17,9 +17,10 @@ function warnDeprecation(key, message) {
|
|
|
17
17
|
* @returns A tool to be used with the AI SDK.
|
|
18
18
|
*/
|
|
19
19
|
export function createTool(def) {
|
|
20
|
+
// Runtime backwards compat - types will show errors but runtime still works
|
|
20
21
|
const inputSchema = def.inputSchema ?? def.args;
|
|
21
22
|
if (!inputSchema)
|
|
22
|
-
throw new Error("To use a Convex tool, you must provide an `inputSchema`
|
|
23
|
+
throw new Error("To use a Convex tool, you must provide an `inputSchema`");
|
|
23
24
|
if (def.args && !def.inputSchema) {
|
|
24
25
|
warnDeprecation("createTool.args", "createTool: 'args' is deprecated. Use 'inputSchema' instead.");
|
|
25
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTool.js","sourceRoot":"","sources":["../../src/client/createTool.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAK1B,MAAM,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"createTool.js","sourceRoot":"","sources":["../../src/client/createTool.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAK1B,MAAM,aAAa,GAAG,6CAA6C,CAAC;AACpE,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;AAC7C,SAAS,eAAe,CAAC,GAAW,EAAE,OAAe;IACnD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,GAAG,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC;gBAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -15,7 +15,6 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
15
15
|
apiKey: string;
|
|
16
16
|
}, Promise<boolean>>;
|
|
17
17
|
listUsers: import("convex/server").RegisteredQuery<"public", {
|
|
18
|
-
apiKey: string;
|
|
19
18
|
paginationOpts: {
|
|
20
19
|
id?: number;
|
|
21
20
|
endCursor?: string | null;
|
|
@@ -24,6 +23,7 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
24
23
|
numItems: number;
|
|
25
24
|
cursor: string | null;
|
|
26
25
|
};
|
|
26
|
+
apiKey: string;
|
|
27
27
|
}, Promise<{
|
|
28
28
|
page: {
|
|
29
29
|
_id: string;
|
|
@@ -36,7 +36,6 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
36
36
|
}>>;
|
|
37
37
|
listThreads: import("convex/server").RegisteredQuery<"public", {
|
|
38
38
|
userId?: string | undefined;
|
|
39
|
-
apiKey: string;
|
|
40
39
|
paginationOpts: {
|
|
41
40
|
id?: number;
|
|
42
41
|
endCursor?: string | null;
|
|
@@ -45,6 +44,7 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
45
44
|
numItems: number;
|
|
46
45
|
cursor: string | null;
|
|
47
46
|
};
|
|
47
|
+
apiKey: string;
|
|
48
48
|
}, Promise<{
|
|
49
49
|
page: {
|
|
50
50
|
lastAgentName: string | undefined;
|
|
@@ -74,7 +74,6 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
74
74
|
}[];
|
|
75
75
|
} | undefined;
|
|
76
76
|
threadId: string;
|
|
77
|
-
apiKey: string;
|
|
78
77
|
paginationOpts: {
|
|
79
78
|
id?: number;
|
|
80
79
|
endCursor?: string | null;
|
|
@@ -83,11 +82,12 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
83
82
|
numItems: number;
|
|
84
83
|
cursor: string | null;
|
|
85
84
|
};
|
|
85
|
+
apiKey: string;
|
|
86
86
|
}, Promise<{
|
|
87
87
|
streams: import("./types.js").SyncStreamsReturnValue;
|
|
88
88
|
page: {
|
|
89
|
-
id?: string | undefined;
|
|
90
89
|
userId?: string | undefined;
|
|
90
|
+
id?: string | undefined;
|
|
91
91
|
embeddingId?: string | undefined;
|
|
92
92
|
fileIds?: string[] | undefined;
|
|
93
93
|
error?: string | undefined;
|
|
@@ -244,22 +244,22 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
244
244
|
toolCallId: string;
|
|
245
245
|
toolName: string;
|
|
246
246
|
} | {
|
|
247
|
-
title?: string | undefined;
|
|
248
247
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
249
248
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
250
|
-
|
|
249
|
+
title?: string | undefined;
|
|
251
250
|
type: "source";
|
|
251
|
+
id: string;
|
|
252
252
|
url: string;
|
|
253
253
|
sourceType: "url";
|
|
254
254
|
} | {
|
|
255
255
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
256
256
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
257
257
|
filename?: string | undefined;
|
|
258
|
-
id: string;
|
|
259
|
-
title: string;
|
|
260
258
|
type: "source";
|
|
259
|
+
id: string;
|
|
261
260
|
mediaType: string;
|
|
262
261
|
sourceType: "document";
|
|
262
|
+
title: string;
|
|
263
263
|
} | {
|
|
264
264
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
265
265
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -375,10 +375,10 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
375
375
|
totalTokens: number;
|
|
376
376
|
} | undefined;
|
|
377
377
|
sources?: ({
|
|
378
|
-
title?: string | undefined;
|
|
379
378
|
type?: "source" | undefined;
|
|
380
379
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
381
380
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
381
|
+
title?: string | undefined;
|
|
382
382
|
id: string;
|
|
383
383
|
url: string;
|
|
384
384
|
sourceType: "url";
|
|
@@ -386,11 +386,11 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
386
386
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
387
387
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
388
388
|
filename?: string | undefined;
|
|
389
|
-
id: string;
|
|
390
|
-
title: string;
|
|
391
389
|
type: "source";
|
|
390
|
+
id: string;
|
|
392
391
|
mediaType: string;
|
|
393
392
|
sourceType: "document";
|
|
393
|
+
title: string;
|
|
394
394
|
})[] | undefined;
|
|
395
395
|
warnings?: ({
|
|
396
396
|
details?: string | undefined;
|
|
@@ -404,7 +404,7 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
404
404
|
type: "other";
|
|
405
405
|
message: string;
|
|
406
406
|
})[] | undefined;
|
|
407
|
-
finishReason?: "
|
|
407
|
+
finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
|
|
408
408
|
reasoningDetails?: ({
|
|
409
409
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
410
410
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -419,13 +419,13 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
419
419
|
type: "redacted";
|
|
420
420
|
data: string;
|
|
421
421
|
})[] | undefined;
|
|
422
|
-
|
|
423
|
-
order: number;
|
|
422
|
+
_id: string;
|
|
424
423
|
_creationTime: number;
|
|
425
424
|
threadId: string;
|
|
425
|
+
order: number;
|
|
426
426
|
stepOrder: number;
|
|
427
|
+
status: "pending" | "success" | "failed";
|
|
427
428
|
tool: boolean;
|
|
428
|
-
_id: string;
|
|
429
429
|
}[];
|
|
430
430
|
isDone: boolean;
|
|
431
431
|
continueCursor: import("convex/server").Cursor;
|
|
@@ -445,9 +445,9 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
445
445
|
tools: string[];
|
|
446
446
|
}[]>>;
|
|
447
447
|
createThread: import("convex/server").RegisteredMutation<"public", {
|
|
448
|
+
agentName?: string | undefined;
|
|
448
449
|
title?: string | undefined;
|
|
449
450
|
summary?: string | undefined;
|
|
450
|
-
agentName?: string | undefined;
|
|
451
451
|
userId: string;
|
|
452
452
|
apiKey: string;
|
|
453
453
|
}, Promise<{
|
|
@@ -455,6 +455,7 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
455
455
|
}>>;
|
|
456
456
|
generateText: import("convex/server").RegisteredAction<"public", {
|
|
457
457
|
system?: string | undefined;
|
|
458
|
+
prompt?: string | undefined;
|
|
458
459
|
messages?: ({
|
|
459
460
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
460
461
|
role: "user";
|
|
@@ -604,22 +605,22 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
604
605
|
toolCallId: string;
|
|
605
606
|
toolName: string;
|
|
606
607
|
} | {
|
|
607
|
-
title?: string | undefined;
|
|
608
608
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
609
609
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
610
|
-
|
|
610
|
+
title?: string | undefined;
|
|
611
611
|
type: "source";
|
|
612
|
+
id: string;
|
|
612
613
|
url: string;
|
|
613
614
|
sourceType: "url";
|
|
614
615
|
} | {
|
|
615
616
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
616
617
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
617
618
|
filename?: string | undefined;
|
|
618
|
-
id: string;
|
|
619
|
-
title: string;
|
|
620
619
|
type: "source";
|
|
620
|
+
id: string;
|
|
621
621
|
mediaType: string;
|
|
622
622
|
sourceType: "document";
|
|
623
|
+
title: string;
|
|
623
624
|
} | {
|
|
624
625
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
625
626
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -724,13 +725,12 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
724
725
|
role: "system";
|
|
725
726
|
content: string;
|
|
726
727
|
})[] | undefined;
|
|
727
|
-
prompt?: string | undefined;
|
|
728
728
|
contextOptions?: {
|
|
729
729
|
excludeToolMessages?: boolean | undefined;
|
|
730
730
|
recentMessages?: number | undefined;
|
|
731
731
|
searchOptions?: {
|
|
732
|
-
textSearch?: boolean | undefined;
|
|
733
732
|
vectorSearch?: boolean | undefined;
|
|
733
|
+
textSearch?: boolean | undefined;
|
|
734
734
|
vectorScoreThreshold?: number | undefined;
|
|
735
735
|
messageRange?: {
|
|
736
736
|
before: number;
|
|
@@ -772,10 +772,10 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
772
772
|
totalTokens: number;
|
|
773
773
|
} | undefined;
|
|
774
774
|
sources?: ({
|
|
775
|
-
title?: string | undefined;
|
|
776
775
|
type?: "source" | undefined;
|
|
777
776
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
778
777
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
778
|
+
title?: string | undefined;
|
|
779
779
|
id: string;
|
|
780
780
|
url: string;
|
|
781
781
|
sourceType: "url";
|
|
@@ -783,11 +783,11 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
783
783
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
784
784
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
785
785
|
filename?: string | undefined;
|
|
786
|
-
id: string;
|
|
787
|
-
title: string;
|
|
788
786
|
type: "source";
|
|
787
|
+
id: string;
|
|
789
788
|
mediaType: string;
|
|
790
789
|
sourceType: "document";
|
|
790
|
+
title: string;
|
|
791
791
|
})[] | undefined;
|
|
792
792
|
warnings?: ({
|
|
793
793
|
details?: string | undefined;
|
|
@@ -801,7 +801,7 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
801
801
|
type: "other";
|
|
802
802
|
message: string;
|
|
803
803
|
})[] | undefined;
|
|
804
|
-
finishReason?: "
|
|
804
|
+
finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
|
|
805
805
|
reasoningDetails?: ({
|
|
806
806
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
807
807
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -965,22 +965,22 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
965
965
|
toolCallId: string;
|
|
966
966
|
toolName: string;
|
|
967
967
|
} | {
|
|
968
|
-
title?: string | undefined;
|
|
969
968
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
970
969
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
971
|
-
|
|
970
|
+
title?: string | undefined;
|
|
972
971
|
type: "source";
|
|
972
|
+
id: string;
|
|
973
973
|
url: string;
|
|
974
974
|
sourceType: "url";
|
|
975
975
|
} | {
|
|
976
976
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
977
977
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
978
978
|
filename?: string | undefined;
|
|
979
|
-
id: string;
|
|
980
|
-
title: string;
|
|
981
979
|
type: "source";
|
|
980
|
+
id: string;
|
|
982
981
|
mediaType: string;
|
|
983
982
|
sourceType: "document";
|
|
983
|
+
title: string;
|
|
984
984
|
} | {
|
|
985
985
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
986
986
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -1239,22 +1239,22 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
1239
1239
|
toolCallId: string;
|
|
1240
1240
|
toolName: string;
|
|
1241
1241
|
} | {
|
|
1242
|
-
title?: string | undefined;
|
|
1243
1242
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1244
1243
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1245
|
-
|
|
1244
|
+
title?: string | undefined;
|
|
1246
1245
|
type: "source";
|
|
1246
|
+
id: string;
|
|
1247
1247
|
url: string;
|
|
1248
1248
|
sourceType: "url";
|
|
1249
1249
|
} | {
|
|
1250
1250
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1251
1251
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1252
1252
|
filename?: string | undefined;
|
|
1253
|
-
id: string;
|
|
1254
|
-
title: string;
|
|
1255
1253
|
type: "source";
|
|
1254
|
+
id: string;
|
|
1256
1255
|
mediaType: string;
|
|
1257
1256
|
sourceType: "document";
|
|
1257
|
+
title: string;
|
|
1258
1258
|
} | {
|
|
1259
1259
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1260
1260
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -1363,12 +1363,13 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
1363
1363
|
beforeMessageId?: string | undefined;
|
|
1364
1364
|
searchText?: string | undefined;
|
|
1365
1365
|
agentName: string;
|
|
1366
|
+
apiKey: string;
|
|
1366
1367
|
contextOptions: {
|
|
1367
1368
|
excludeToolMessages?: boolean | undefined;
|
|
1368
1369
|
recentMessages?: number | undefined;
|
|
1369
1370
|
searchOptions?: {
|
|
1370
|
-
textSearch?: boolean | undefined;
|
|
1371
1371
|
vectorSearch?: boolean | undefined;
|
|
1372
|
+
textSearch?: boolean | undefined;
|
|
1372
1373
|
vectorScoreThreshold?: number | undefined;
|
|
1373
1374
|
messageRange?: {
|
|
1374
1375
|
before: number;
|
|
@@ -1378,10 +1379,9 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
1378
1379
|
} | undefined;
|
|
1379
1380
|
searchOtherThreads?: boolean | undefined;
|
|
1380
1381
|
};
|
|
1381
|
-
apiKey: string;
|
|
1382
1382
|
}, Promise<{
|
|
1383
|
-
id?: string | undefined;
|
|
1384
1383
|
userId?: string | undefined;
|
|
1384
|
+
id?: string | undefined;
|
|
1385
1385
|
embeddingId?: string | undefined;
|
|
1386
1386
|
fileIds?: string[] | undefined;
|
|
1387
1387
|
error?: string | undefined;
|
|
@@ -1538,22 +1538,22 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
1538
1538
|
toolCallId: string;
|
|
1539
1539
|
toolName: string;
|
|
1540
1540
|
} | {
|
|
1541
|
-
title?: string | undefined;
|
|
1542
1541
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1543
1542
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1544
|
-
|
|
1543
|
+
title?: string | undefined;
|
|
1545
1544
|
type: "source";
|
|
1545
|
+
id: string;
|
|
1546
1546
|
url: string;
|
|
1547
1547
|
sourceType: "url";
|
|
1548
1548
|
} | {
|
|
1549
1549
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1550
1550
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1551
1551
|
filename?: string | undefined;
|
|
1552
|
-
id: string;
|
|
1553
|
-
title: string;
|
|
1554
1552
|
type: "source";
|
|
1553
|
+
id: string;
|
|
1555
1554
|
mediaType: string;
|
|
1556
1555
|
sourceType: "document";
|
|
1556
|
+
title: string;
|
|
1557
1557
|
} | {
|
|
1558
1558
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1559
1559
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -1669,10 +1669,10 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
1669
1669
|
totalTokens: number;
|
|
1670
1670
|
} | undefined;
|
|
1671
1671
|
sources?: ({
|
|
1672
|
-
title?: string | undefined;
|
|
1673
1672
|
type?: "source" | undefined;
|
|
1674
1673
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1675
1674
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1675
|
+
title?: string | undefined;
|
|
1676
1676
|
id: string;
|
|
1677
1677
|
url: string;
|
|
1678
1678
|
sourceType: "url";
|
|
@@ -1680,11 +1680,11 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
1680
1680
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1681
1681
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1682
1682
|
filename?: string | undefined;
|
|
1683
|
-
id: string;
|
|
1684
|
-
title: string;
|
|
1685
1683
|
type: "source";
|
|
1684
|
+
id: string;
|
|
1686
1685
|
mediaType: string;
|
|
1687
1686
|
sourceType: "document";
|
|
1687
|
+
title: string;
|
|
1688
1688
|
})[] | undefined;
|
|
1689
1689
|
warnings?: ({
|
|
1690
1690
|
details?: string | undefined;
|
|
@@ -1698,7 +1698,7 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
1698
1698
|
type: "other";
|
|
1699
1699
|
message: string;
|
|
1700
1700
|
})[] | undefined;
|
|
1701
|
-
finishReason?: "
|
|
1701
|
+
finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
|
|
1702
1702
|
reasoningDetails?: ({
|
|
1703
1703
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1704
1704
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -1713,13 +1713,13 @@ export declare function definePlaygroundAPI<DataModel extends GenericDataModel>(
|
|
|
1713
1713
|
type: "redacted";
|
|
1714
1714
|
data: string;
|
|
1715
1715
|
})[] | undefined;
|
|
1716
|
-
|
|
1717
|
-
order: number;
|
|
1716
|
+
_id: string;
|
|
1718
1717
|
_creationTime: number;
|
|
1719
1718
|
threadId: string;
|
|
1719
|
+
order: number;
|
|
1720
1720
|
stepOrder: number;
|
|
1721
|
+
status: "pending" | "success" | "failed";
|
|
1721
1722
|
tool: boolean;
|
|
1722
|
-
_id: string;
|
|
1723
1723
|
}[]>>;
|
|
1724
1724
|
};
|
|
1725
1725
|
//# sourceMappingURL=definePlaygroundAPI.d.ts.map
|