@convex-dev/agent 0.0.1-alpha.2 → 0.0.1-alpha.3

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 (60) hide show
  1. package/README.md +91 -95
  2. package/dist/commonjs/client/index.d.ts +60 -60
  3. package/dist/commonjs/client/index.d.ts.map +1 -1
  4. package/dist/commonjs/client/index.js +80 -77
  5. package/dist/commonjs/client/index.js.map +1 -1
  6. package/dist/commonjs/client/types.d.ts +1 -1
  7. package/dist/commonjs/client/types.d.ts.map +1 -1
  8. package/dist/commonjs/component/messages.d.ts +56 -56
  9. package/dist/commonjs/component/messages.d.ts.map +1 -1
  10. package/dist/commonjs/component/messages.js +128 -134
  11. package/dist/commonjs/component/messages.js.map +1 -1
  12. package/dist/commonjs/component/schema.d.ts +256 -256
  13. package/dist/commonjs/component/schema.d.ts.map +1 -1
  14. package/dist/commonjs/component/schema.js +18 -18
  15. package/dist/commonjs/component/schema.js.map +1 -1
  16. package/dist/commonjs/component/vector/index.d.ts +4 -4
  17. package/dist/commonjs/component/vector/index.d.ts.map +1 -1
  18. package/dist/commonjs/component/vector/index.js +12 -10
  19. package/dist/commonjs/component/vector/index.js.map +1 -1
  20. package/dist/commonjs/component/vector/tables.d.ts +3 -3
  21. package/dist/commonjs/component/vector/tables.js +6 -6
  22. package/dist/commonjs/component/vector/tables.js.map +1 -1
  23. package/dist/commonjs/validators.d.ts +5 -5
  24. package/dist/commonjs/validators.d.ts.map +1 -1
  25. package/dist/commonjs/validators.js +3 -3
  26. package/dist/commonjs/validators.js.map +1 -1
  27. package/dist/esm/client/index.d.ts +60 -60
  28. package/dist/esm/client/index.d.ts.map +1 -1
  29. package/dist/esm/client/index.js +80 -77
  30. package/dist/esm/client/index.js.map +1 -1
  31. package/dist/esm/client/types.d.ts +1 -1
  32. package/dist/esm/client/types.d.ts.map +1 -1
  33. package/dist/esm/component/messages.d.ts +56 -56
  34. package/dist/esm/component/messages.d.ts.map +1 -1
  35. package/dist/esm/component/messages.js +128 -134
  36. package/dist/esm/component/messages.js.map +1 -1
  37. package/dist/esm/component/schema.d.ts +256 -256
  38. package/dist/esm/component/schema.d.ts.map +1 -1
  39. package/dist/esm/component/schema.js +18 -18
  40. package/dist/esm/component/schema.js.map +1 -1
  41. package/dist/esm/component/vector/index.d.ts +4 -4
  42. package/dist/esm/component/vector/index.d.ts.map +1 -1
  43. package/dist/esm/component/vector/index.js +12 -10
  44. package/dist/esm/component/vector/index.js.map +1 -1
  45. package/dist/esm/component/vector/tables.d.ts +3 -3
  46. package/dist/esm/component/vector/tables.js +6 -6
  47. package/dist/esm/component/vector/tables.js.map +1 -1
  48. package/dist/esm/validators.d.ts +5 -5
  49. package/dist/esm/validators.d.ts.map +1 -1
  50. package/dist/esm/validators.js +3 -3
  51. package/dist/esm/validators.js.map +1 -1
  52. package/package.json +2 -2
  53. package/src/client/index.ts +133 -127
  54. package/src/client/types.ts +1 -1
  55. package/src/component/_generated/api.d.ts +53 -53
  56. package/src/component/messages.ts +139 -145
  57. package/src/component/schema.ts +18 -18
  58. package/src/component/vector/index.ts +13 -11
  59. package/src/component/vector/tables.ts +6 -6
  60. package/src/validators.ts +6 -3
package/README.md CHANGED
@@ -6,60 +6,59 @@
6
6
 
7
7
  AI Agent framework built on Convex.
8
8
 
9
- - Automatic storage of chat history, per-user or per-chat.
9
+ - Automatic storage of chat history, per-user or per-thread.
10
10
  - RAG for chat context, via hybrid text & vector search, with configuration options.
11
11
  Or use the API to query the history yourself and do it your way.
12
- - Opt-in search for messages from other chats (for the same specifieduser).
12
+ - Opt-in search for messages from other threads (for the same specifieduser).
13
13
  - Tool calls via the AI SDK, along with Convex-specific helpers.
14
14
  - Easy workflow integration with the [Workflow component](https://convex.dev/components/workflow).
15
- - Reactive & realtime updates to asynchronous chats.
15
+ - Reactive & realtime updates to asynchronous threads.
16
16
  - Support for streaming text and storing the result in the database.
17
- - Optionally filter tool calls out of the chat history.
17
+ - Optionally filter tool calls out of the thread history.
18
18
 
19
19
  Example usage:
20
20
 
21
21
  ```ts
22
22
  // Define an agent similarly to the AI SDK
23
23
  const supportAgent = new Agent(components.agent, {
24
- chat: openai.chat("gpt-4o-mini"),
24
+ thread: openai.chat("gpt-4o-mini"),
25
25
  textEmbedding: openai.embedding("text-embedding-3-small"),
26
26
  instructions: "You are a helpful assistant.",
27
27
  tools: { accountLookup, fileTicket, sendEmail },
28
28
  });
29
29
 
30
30
  // Use the agent from within a normal action:
31
- export const createChatting = action({
32
- args: { prompt: v.string(), userId: v.string() },
33
- handler: async (ctx, { prompt, userId }): Promise<{ chatId: string; initialResponse: string }> => {
34
- // Start a new chat for the user.
35
- const { chatId, chat } = await supportAgent.createChat(ctx, { userId });
36
- const result = await chat.generateText({ prompt });
37
- return { chatId, initialResponse: result.text };
31
+ export const createThread = action({
32
+ args: { prompt: v.string() },
33
+ handler: async (ctx, { prompt }) => {
34
+ const { threadId, thread } = await supportAgent.createThread(ctx, {});
35
+ const result = await thread.generateText({ prompt });
36
+ return { threadId, text: result.text };
38
37
  },
39
38
  });
40
39
 
41
40
  // Pick up where you left off:
42
- export const continueChat = action({
43
- args: { prompt: v.string(), chatId: v.string() },
44
- handler: async (ctx, { prompt, chatId }): Promise<string> => {
45
- // This includes previous message history from the chat automatically.
46
- const { chat } = await supportAgent.continueChat(ctx, { chatId });
47
- const result = await chat.generateText({ prompt });
41
+ export const continueThread = action({
42
+ args: { prompt: v.string(), threadId: v.string() },
43
+ handler: async (ctx, { prompt, threadId }) => {
44
+ // This includes previous message history from the thread automatically.
45
+ const { thread } = await supportAgent.continueThread(ctx, { threadId });
46
+ const result = await thread.generateText({ prompt });
48
47
  return result.text;
49
48
  },
50
49
  });
51
50
 
52
- // Or use it within a workflow:
51
+ // Or use it within a workflow, specific to a user:
53
52
  export const supportAgentStep = supportAgent.asAction({ maxSteps: 10 });
54
53
 
55
54
  const workflow = new WorkflowManager(components.workflow);
56
55
  const s = internal.example; // where steps are defined
57
56
 
58
57
  export const supportAgentWorkflow = workflow.define({
59
- args: { prompt: v.string(), userId: v.string(), chatId: v.string() },
60
- handler: async (step, { prompt, userId, chatId }) => {
58
+ args: { prompt: v.string(), userId: v.string(), threadId: v.string() },
59
+ handler: async (step, { prompt, userId, threadId }) => {
61
60
  const suggestion = await step.runAction(s.supportAgentStep, {
62
- chatId, generateText: { prompt },
61
+ threadId, generateText: { prompt },
63
62
  });
64
63
  const polished = await step.runAction(s.adaptSuggestionForUser, {
65
64
  suggestion, userId,
@@ -118,7 +117,7 @@ import { Agent } from "@convex-dev/agent";
118
117
  // Define an agent similarly to the AI SDK
119
118
  const supportAgent = new Agent(components.agent, {
120
119
  // Note: all of these are optional.
121
- chat: openai.chat("gpt-4o-mini"),
120
+ thread: openai.chat("gpt-4o-mini"),
122
121
  // Used for vector search (RAG).
123
122
  textEmbedding: openai.embedding("text-embedding-3-small"),
124
123
  // Will be the default system prompt if not overriden.
@@ -142,9 +141,9 @@ const supportAgent = new Agent(components.agent, {
142
141
  // How many recent messages to include. These are added after the search
143
142
  // messages, and do not count against the search limit.
144
143
  recentMessages: 10,
145
- // Whether to search across other chats for relevant messages.
146
- // By default, only the current chat is searched.
147
- searchOtherChats: true,
144
+ // Whether to search across other threads for relevant messages.
145
+ // By default, only the current thread is searched.
146
+ searchOtherThreads: true,
148
147
  // Options for searching messages.
149
148
  searchOptions: {
150
149
  // The maximum number of messages to fetch.
@@ -163,7 +162,7 @@ const supportAgent = new Agent(components.agent, {
163
162
  storageOptions: {
164
163
  // Defaults to false, allowing you to pass in arbitrary context that will
165
164
  // be in addition to automatically fetched content.
166
- // Pass true to have all input messages saved to the chat history.
165
+ // Pass true to have all input messages saved to the thread history.
167
166
  saveAllInputMessages: true,
168
167
  // Defaults to true
169
168
  saveOutputMessages: true,
@@ -175,35 +174,40 @@ const supportAgent = new Agent(components.agent, {
175
174
  });
176
175
  ```
177
176
 
178
- ### Starting a chat
177
+ ### Starting a thread
179
178
 
180
- You can start a chat from either an action or a mutation.
179
+ You can start a thread from either an action or a mutation.
181
180
  If it's in an action, you can also start sending messages.
182
- The chatId allows you to resume later and maintain message history.
181
+ The threadId allows you to resume later and maintain message history.
182
+ If you specify a userId, the thread will be associated with that user and messages will be saved to the user's history.
183
+ You can also search the user's history for relevant messages in this thread.
183
184
 
184
185
  ```ts
185
186
  // Use the agent from within a normal action:
186
- export const createChatting = action({
187
+ export const createThread = action({
187
188
  args: { prompt: v.string(), userId: v.string() },
188
- handler: async (ctx, { prompt, userId }): Promise<{ chatId: string; initialResponse: string }> => {
189
- // Start a new chat for the user.
190
- const { chatId, chat } = await supportAgent.createChat(ctx, { userId });
191
- const result = await chat.generateText({ prompt });
192
- return { chatId, initialResponse: result.text };
189
+ handler: async (ctx, { prompt, userId }): Promise<{ threadId: string; initialResponse: string }> => {
190
+ // Start a new thread for the user.
191
+ const { threadId, thread } = await supportAgent.createThread(ctx, { userId });
192
+ const result = await thread.generateText({ prompt });
193
+ return { threadId, initialResponse: result.text };
193
194
  },
194
195
  });
195
196
  ```
196
197
 
197
- ### Continuing a chat
198
+ ### Continuing a thread
199
+
200
+ If you specify a userId too, you can search the user's history for relevant messages
201
+ to include in the prompt context.
198
202
 
199
203
  ```ts
200
204
  // Pick up where you left off:
201
- export const continueChat = action({
202
- args: { prompt: v.string(), chatId: v.string() },
203
- handler: async (ctx, { prompt, chatId }): Promise<string> => {
204
- // This includes previous message history from the chat automatically.
205
- const { chat } = await supportAgent.continueChat(ctx, { chatId });
206
- const result = await chat.generateText({ prompt });
205
+ export const continueThread = action({
206
+ args: { prompt: v.string(), threadId: v.string() },
207
+ handler: async (ctx, { prompt, threadId }): Promise<string> => {
208
+ // This includes previous message history from the thread automatically.
209
+ const { thread } = await supportAgent.continueThread(ctx, { threadId });
210
+ const result = await thread.generateText({ prompt });
207
211
  return result.text;
208
212
  },
209
213
  });
@@ -216,10 +220,10 @@ export const supportAgentStep = supportAgent.asAction({ maxSteps: 10 });
216
220
 
217
221
  // Then from within another action:
218
222
  export const callSupportAgent = action({
219
- args: { prompt: v.string(), userId: v.string(), chatId: v.string() },
220
- handler: async (step, { prompt, userId, chatId }) => {
221
- const suggestion = await step.runAction(s.supportAgentStep, {
222
- chatId, userId, generateText: { prompt },
223
+ args: { prompt: v.string(), userId: v.string(), threadId: v.string() },
224
+ handler: async (ctx, { prompt, userId, threadId }) => {
225
+ const suggestion = await ctx.runAction(s.supportAgentStep, {
226
+ threadId, userId, generateText: { prompt },
223
227
  });
224
228
  },
225
229
  });
@@ -237,102 +241,94 @@ const workflow = new WorkflowManager(components.workflow);
237
241
  const s = internal.example; // where steps are defined
238
242
 
239
243
  export const supportAgentWorkflow = workflow.define({
240
- args: { prompt: v.string(), userId: v.string(), chatId: v.string() },
241
- handler: async (step, { prompt, userId, chatId }) => {
244
+ args: { prompt: v.string(), userId: v.string(), threadId: v.string() },
245
+ handler: async (step, { prompt, userId, threadId }) => {
242
246
  const suggestion = await step.runAction(s.supportAgentStep, {
243
- chatId,
244
- generateText: { prompt },
247
+ threadId, userId, generateText: { prompt },
245
248
  });
246
249
  const polished = await step.runAction(s.adaptSuggestionForUser, {
247
- userId,
248
- generateText: { prompt: suggestion },
250
+ threadId, userId, generateText: { prompt: suggestion },
249
251
  });
250
252
  await step.runMutation(s.sendUserMessage, { userId, message: polished.message });
251
253
  },
252
254
  });
253
255
  ```
254
256
 
255
- ### Fetching chat history
257
+ ### Fetching thread history
256
258
 
257
259
  ```ts
258
- const messages = await ctx.runQuery(components.agent.messages.getChatMessages, {
259
- chatId,
260
- });
260
+ const messages = await ctx.runQuery(
261
+ components.agent.messages.getThreadMessages,
262
+ { threadId }
263
+ );
264
+ ```
265
+
266
+ ### Generating text for a user without an associated thread
267
+
268
+ ```ts
269
+ const result = await supportAgent.generateText(ctx, { userId }, { prompt });
261
270
  ```
262
271
 
263
272
  ### Manually managing messages
264
273
 
265
274
  ```ts
266
- const messages = await ctx.runQuery(components.agent.messages.getChatMessages, {
267
- chatId,
268
- {...searchOptions}
269
- });
275
+ const messages = await ctx.runQuery(
276
+ components.agent.messages.getThreadMessages,
277
+ { threadId, ...searchOptions }
278
+ );
270
279
  ```
271
280
 
272
281
  ```ts
273
- const messages = await agent.saveMessages(ctx, { chatId, userId, messages });
282
+ const messages = await agent.saveMessages(ctx, { threadId, userId, messages });
274
283
  ```
275
284
 
276
285
  ```ts
277
- const messages = await agent.saveSteps(ctx, { chatId, userId, step });
286
+ const messages = await agent.saveSteps(ctx, { threadId, userId, step });
278
287
  ```
279
288
 
280
289
  // Update the message from pending to complete, along with any associated steps.
281
290
  ```ts
282
- const messages = await agent.completeMessage(ctx, { chatId, userId, messageId });
291
+ const messages = await agent.completeMessage(ctx, { threadId, userId, messageId });
283
292
  ```
284
293
 
285
294
  ### Manage embeddings
286
295
 
287
296
  ```ts
288
- const messages = await ctx.runQuery(components.agent.embeddings.paginate, {
289
- vectorDimension: 1536,
290
- targetModel: "gpt-4o-mini",
291
- cursor: null,
292
- limit: 10,
293
- });
297
+ const messages = await ctx.runQuery(
298
+ components.agent.embeddings.paginate,
299
+ { vectorDimension: 1536, cursor: null, limit: 10 }
300
+ );
294
301
  ```
295
302
 
296
303
  ```ts
297
- const messages = await ctx.runQuery(components.agent.embeddings.deleteBatchForChat, {
298
- vectorDimension: 1536,
299
- targetModel: "gpt-4o-mini",
300
- chatId: "123",
301
- cursor: null,
302
- limit: 10,
303
- });
304
+ const messages = await ctx.runQuery(
305
+ components.agent.embeddings.deleteBatchForThread,
306
+ { vectorDimension: 1536, targetModel: "gpt-4o-mini", threadId: "123", cursor: null, limit: 10 }
307
+ );
304
308
  ```
305
309
 
306
310
  ```ts
307
- const messages = await ctx.runQuery(components.agent.embeddings.insertBatch, {
308
- vectorDimension: 1536,
309
- vectors: [
310
- {
311
- model: "gpt-4o-mini",
312
- kind: "chat",
313
- userId: "123",
314
- chatId: "123",
315
- vector: embedding,
316
- },
317
- ],
318
- });
311
+ const messages = await ctx.runQuery(
312
+ components.agent.embeddings.insertBatch, {
313
+ vectorDimension: 1536,
314
+ vectors: [
315
+ { model: "gpt-4o-mini", kind: "thread", userId: "123", threadId: "123", vector: embedding, },
316
+ ],
317
+ }
318
+ );
319
319
  ```
320
320
 
321
321
  ```ts
322
322
  const messages = await ctx.runQuery(components.agent.embeddings.updateBatch, {
323
323
  vectors: [
324
- {
325
- model: "gpt-4o-mini",
326
- id: "123", // message's embeddingId
327
- vector: embedding,
328
- },
324
+ { model: "gpt-4o-mini", vector: embedding, id: msg.embeddingId },
329
325
  ],
330
326
  });
331
327
  ```
332
328
 
333
329
  ```ts
334
330
  const messages = await ctx.runQuery(components.agent.embeddings.deleteBatch, {
335
- ids: ["123", "456"],
331
+ ids: [embeddingId1, embeddingId2],
336
332
  });
337
333
  ```
338
334
 
@@ -43,10 +43,10 @@ export type ContextOptions = {
43
43
  };
44
44
  };
45
45
  /**
46
- * Whether to search across other chats for relevant messages.
47
- * By default, only the current chat is searched.
46
+ * Whether to search across other threads for relevant messages.
47
+ * By default, only the current thread is searched.
48
48
  */
49
- searchOtherChats?: boolean;
49
+ searchOtherThreads?: boolean;
50
50
  };
51
51
  export type StorageOptions = {
52
52
  saveAllInputMessages?: boolean;
@@ -62,7 +62,7 @@ export declare class Agent<AgentTools extends ToolSet> {
62
62
  component: UseApi<typeof api>;
63
63
  options: {
64
64
  name?: string;
65
- chat: LanguageModelV1;
65
+ thread: LanguageModelV1;
66
66
  textEmbedding?: EmbeddingModelV1<string>;
67
67
  instructions?: string;
68
68
  tools?: AgentTools;
@@ -71,7 +71,7 @@ export declare class Agent<AgentTools extends ToolSet> {
71
71
  };
72
72
  constructor(component: UseApi<typeof api>, options: {
73
73
  name?: string;
74
- chat: LanguageModelV1;
74
+ thread: LanguageModelV1;
75
75
  textEmbedding?: EmbeddingModelV1<string>;
76
76
  instructions?: string;
77
77
  tools?: AgentTools;
@@ -79,74 +79,74 @@ export declare class Agent<AgentTools extends ToolSet> {
79
79
  maxSteps?: number;
80
80
  });
81
81
  /**
82
- * Start a new chat with the agent. This will have a fresh history, though if
83
- * you pass in a userId you can have it search across other chats for relevant
82
+ * Start a new thread with the agent. This will have a fresh history, though if
83
+ * you pass in a userId you can have it search across other threads for relevant
84
84
  * messages as context for the LLM calls.
85
- * @param ctx The context of the Convex function. From an action, you can chat
86
- * with the agent. From a mutation, you can start a chat and save the chatId
87
- * to pass to continueChat later.
88
- * @param args The chat metadata.
89
- * @returns The chatId of the new chat and the chat object.
85
+ * @param ctx The context of the Convex function. From an action, you can thread
86
+ * with the agent. From a mutation, you can start a thread and save the threadId
87
+ * to pass to continueThread later.
88
+ * @param args The thread metadata.
89
+ * @returns The threadId of the new thread and the thread object.
90
90
  */
91
- createChat(ctx: RunActionCtx, args: {
91
+ createThread(ctx: RunActionCtx, args: {
92
92
  /**
93
- * The userId to associate with the chat. If not provided, the chat will be
93
+ * The userId to associate with the thread. If not provided, the thread will be
94
94
  * anonymous.
95
95
  */
96
96
  userId?: string;
97
97
  /**
98
- * The parent chatIds to merge with.
99
- * If the chat is a continuation of one or many previous chats,
100
- * you can pass in the chatIds of the parent chats to merge the histories.
98
+ * The parent threadIds to merge with.
99
+ * If the thread is a continuation of one or many previous threads,
100
+ * you can pass in the threadIds of the parent threads to merge the histories.
101
101
  */
102
- parentChatIds?: string[];
102
+ parentThreadIds?: string[];
103
103
  /**
104
- * The title of the chat. Not currently used.
104
+ * The title of the thread. Not currently used.
105
105
  */
106
106
  title?: string;
107
107
  /**
108
- * The summary of the chat. Not currently used.
108
+ * The summary of the thread. Not currently used.
109
109
  */
110
110
  summary?: string;
111
111
  }): Promise<{
112
- chatId: string;
113
- chat: Chat<AgentTools>;
112
+ threadId: string;
113
+ thread: Thread<AgentTools>;
114
114
  }>;
115
115
  /**
116
- * Start a new chat with the agent. This will have a fresh history, though if
117
- * you pass in a userId you can have it search across other chats for relevant
116
+ * Start a new thread with the agent. This will have a fresh history, though if
117
+ * you pass in a userId you can have it search across other threads for relevant
118
118
  * messages as context for the LLM calls.
119
119
  * @param ctx The context of the Convex function. From a mutation, you can
120
- * start a chat and save the chatId to pass to continueChat later.
121
- * @param args The chat metadata.
122
- * @returns The chatId of the new chat.
120
+ * start a thread and save the threadId to pass to continueThread later.
121
+ * @param args The thread metadata.
122
+ * @returns The threadId of the new thread.
123
123
  */
124
- createChat(ctx: RunMutationCtx, args: {
124
+ createThread(ctx: RunMutationCtx, args: {
125
125
  userId?: string;
126
- parentChatIds?: string[];
126
+ parentThreadIds?: string[];
127
127
  title?: string;
128
128
  summary?: string;
129
129
  }): Promise<{
130
- chatId: string;
130
+ threadId: string;
131
131
  }>;
132
- continueChat(ctx: RunActionCtx, { chatId, userId, }: {
133
- chatId: string;
132
+ continueThread(ctx: RunActionCtx, { threadId, userId, }: {
133
+ threadId: string;
134
134
  /**
135
- * If supplied, the userId can be used to search across other chats for
135
+ * If supplied, the userId can be used to search across other threads for
136
136
  * relevant messages from the same user as context for the LLM calls.
137
137
  */
138
138
  userId?: string;
139
139
  }): Promise<{
140
- chat: Chat<AgentTools>;
140
+ thread: Thread<AgentTools>;
141
141
  }>;
142
142
  fetchContextMessages(ctx: RunQueryCtx | RunActionCtx, args: {
143
143
  userId?: string;
144
- chatId?: string;
144
+ threadId?: string;
145
145
  messages: CoreMessage[];
146
146
  parentMessageId?: string;
147
147
  } & ContextOptions): Promise<CoreMessage[]>;
148
148
  saveMessages(ctx: RunMutationCtx, args: {
149
- chatId?: string;
149
+ threadId?: string;
150
150
  userId?: string;
151
151
  messages: CoreMessageMaybeWithId[];
152
152
  pending?: boolean;
@@ -157,12 +157,12 @@ export declare class Agent<AgentTools extends ToolSet> {
157
157
  messageIds: string[];
158
158
  }>;
159
159
  saveStep<TOOLS extends ToolSet>(ctx: RunMutationCtx, args: {
160
- chatId: string;
160
+ threadId: string;
161
161
  messageId: string;
162
162
  step: StepResult<TOOLS>;
163
163
  }): Promise<void>;
164
164
  completeMessage<TOOLS extends ToolSet>(ctx: RunMutationCtx, args: {
165
- chatId: string;
165
+ threadId: string;
166
166
  messageId: string;
167
167
  result: {
168
168
  kind: "error";
@@ -176,32 +176,32 @@ export declare class Agent<AgentTools extends ToolSet> {
176
176
  }): Promise<void>;
177
177
  /**
178
178
  * This behaves like {@link generateText} except that it add context based on
179
- * the userId and chatId. It saves the input and resulting messages to the
180
- * chat, if specified.
181
- * however. To do that, use {@link continueChat} or {@link saveMessages}.
179
+ * the userId and threadId. It saves the input and resulting messages to the
180
+ * thread, if specified.
181
+ * however. To do that, use {@link continueThread} or {@link saveMessages}.
182
182
  * @param ctx The context of the agent.
183
183
  * @param args The arguments to the generateText function.
184
184
  * @returns The result of the generateText function.
185
185
  */
186
- generateText<TOOLS extends ToolSet, OUTPUT = never, OUTPUT_PARTIAL = never>(ctx: RunActionCtx, { userId, chatId, }: {
186
+ generateText<TOOLS extends ToolSet, OUTPUT = never, OUTPUT_PARTIAL = never>(ctx: RunActionCtx, { userId, threadId, }: {
187
187
  userId?: string;
188
- chatId?: string;
188
+ threadId?: string;
189
189
  }, args: TextArgs<AgentTools, TOOLS, Parameters<typeof generateText<TOOLS, OUTPUT, OUTPUT_PARTIAL>>[0]>): Promise<GenerateTextResult<TOOLS & AgentTools, OUTPUT> & GenerationOutputMetadata>;
190
- streamText<TOOLS extends ToolSet, OUTPUT = never, PARTIAL_OUTPUT = never>(ctx: RunActionCtx, { userId, chatId }: {
190
+ streamText<TOOLS extends ToolSet, OUTPUT = never, PARTIAL_OUTPUT = never>(ctx: RunActionCtx, { userId, threadId }: {
191
191
  userId?: string;
192
- chatId?: string;
192
+ threadId?: string;
193
193
  }, args: TextArgs<AgentTools, TOOLS, Parameters<typeof streamText<TOOLS, OUTPUT, PARTIAL_OUTPUT>>[0]>): Promise<StreamTextResult<TOOLS, PARTIAL_OUTPUT> & GenerationOutputMetadata>;
194
- generateObject<T>(ctx: RunActionCtx, { userId, chatId }: {
194
+ generateObject<T>(ctx: RunActionCtx, { userId, threadId }: {
195
195
  userId?: string;
196
- chatId?: string;
196
+ threadId?: string;
197
197
  }, args: Omit<Parameters<typeof generateObject>[0], "model"> & {
198
198
  model?: LanguageModelV1;
199
199
  } & {
200
200
  parentMessageId?: string;
201
201
  } & ContextOptions & StorageOptions): Promise<GenerateObjectResult<T> & GenerationOutputMetadata>;
202
- streamObject<T>(ctx: RunMutationCtx, { userId, chatId }: {
202
+ streamObject<T>(ctx: RunMutationCtx, { userId, threadId }: {
203
203
  userId?: string;
204
- chatId?: string;
204
+ threadId?: string;
205
205
  }, args: Omit<Parameters<typeof streamObject<T>>[0], "model"> & {
206
206
  model?: LanguageModelV1;
207
207
  } & {
@@ -217,12 +217,12 @@ export declare class Agent<AgentTools extends ToolSet> {
217
217
  maxSteps?: number;
218
218
  }): import("convex/server").RegisteredAction<"internal", {
219
219
  userId?: string | undefined;
220
- chatId?: string | undefined;
221
- createChat?: {
220
+ threadId?: string | undefined;
221
+ createThread?: {
222
222
  title?: string | undefined;
223
+ userId?: string | undefined;
223
224
  summary?: string | undefined;
224
- parentChatIds?: string[] | undefined;
225
- userId: string;
225
+ parentThreadIds?: string[] | undefined;
226
226
  } | undefined;
227
227
  maxRetries?: number | undefined;
228
228
  contextOptions?: {
@@ -237,15 +237,15 @@ export declare class Agent<AgentTools extends ToolSet> {
237
237
  vectorSearch?: boolean | undefined;
238
238
  limit: number;
239
239
  } | undefined;
240
- searchOtherChats?: boolean | undefined;
240
+ searchOtherThreads?: boolean | undefined;
241
241
  } | undefined;
242
242
  storageOptions?: {
243
243
  saveAllInputMessages?: boolean | undefined;
244
244
  saveAllOutputMessages?: boolean | undefined;
245
245
  } | undefined;
246
- continueChat?: {
246
+ continueThread?: {
247
247
  userId?: string | undefined;
248
- chatId: string;
248
+ threadId: string;
249
249
  } | undefined;
250
250
  generateText?: {
251
251
  messages?: ({
@@ -614,14 +614,14 @@ export declare class Agent<AgentTools extends ToolSet> {
614
614
  }
615
615
  export type ToolCtx = RunActionCtx & {
616
616
  userId?: string;
617
- chatId?: string;
617
+ threadId?: string;
618
618
  messageId?: string;
619
619
  };
620
620
  /**
621
621
  * This is a wrapper around the ai.tool function that adds support for
622
- * userId and chatId to the tool, if they're called within a chat from an agent.
622
+ * userId and threadId to the tool, if they're called within a thread from an agent.
623
623
  * @param tool The AI tool. See https://sdk.vercel.ai/docs/ai-sdk-core/tools-and-tool-calling
624
- * @returns The same tool, but with userId and chatId args support added.
624
+ * @returns The same tool, but with userId and threadId args support added.
625
625
  */
626
626
  export declare function createTool<V extends Validator<any, any, any>, RESULT>(convexTool: {
627
627
  args: V;
@@ -647,7 +647,7 @@ type ObjectArgs<T extends {
647
647
  }> = Omit<T, "model"> & {
648
648
  model?: LanguageModelV1;
649
649
  } & ContextOptions & StorageOptions;
650
- interface Chat<AgentTools extends ToolSet> {
650
+ interface Thread<AgentTools extends ToolSet> {
651
651
  generateText<TOOLS extends ToolSet, OUTPUT = never, OUTPUT_PARTIAL = never>(args: TextArgs<AgentTools, TOOLS, Parameters<typeof generateText<TOOLS, OUTPUT, OUTPUT_PARTIAL>>[0]>): Promise<GenerateTextResult<TOOLS & AgentTools, OUTPUT> & GenerationOutputMetadata>;
652
652
  streamText<TOOLS extends ToolSet, OUTPUT = never, PARTIAL_OUTPUT = never>(args: TextArgs<AgentTools, TOOLS, Parameters<typeof streamText<TOOLS, OUTPUT, PARTIAL_OUTPUT>>[0]>): Promise<StreamTextResult<TOOLS & AgentTools, PARTIAL_OUTPUT> & GenerationOutputMetadata>;
653
653
  generateObject<T>(args: ObjectArgs<Parameters<typeof generateObject>[0]>): Promise<GenerateObjectResult<T> & GenerationOutputMetadata>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,oB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