@convex-dev/agent 0.1.18 → 0.2.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 (122) hide show
  1. package/dist/client/createTool.d.ts +30 -11
  2. package/dist/client/createTool.d.ts.map +1 -1
  3. package/dist/client/createTool.js +24 -10
  4. package/dist/client/createTool.js.map +1 -1
  5. package/dist/client/defaultComponent.d.ts +11 -0
  6. package/dist/client/defaultComponent.d.ts.map +1 -0
  7. package/dist/client/defaultComponent.js +7 -0
  8. package/dist/client/defaultComponent.js.map +1 -0
  9. package/dist/client/definePlaygroundAPI.d.ts +68 -23
  10. package/dist/client/definePlaygroundAPI.d.ts.map +1 -1
  11. package/dist/client/definePlaygroundAPI.js +7 -20
  12. package/dist/client/definePlaygroundAPI.js.map +1 -1
  13. package/dist/client/files.d.ts +14 -4
  14. package/dist/client/files.d.ts.map +1 -1
  15. package/dist/client/files.js +66 -11
  16. package/dist/client/files.js.map +1 -1
  17. package/dist/client/index.d.ts +323 -780
  18. package/dist/client/index.d.ts.map +1 -1
  19. package/dist/client/index.js +445 -543
  20. package/dist/client/index.js.map +1 -1
  21. package/dist/client/messages.d.ts +256 -0
  22. package/dist/client/messages.d.ts.map +1 -0
  23. package/dist/client/messages.js +97 -0
  24. package/dist/client/messages.js.map +1 -0
  25. package/dist/client/search.d.ts +35 -12
  26. package/dist/client/search.d.ts.map +1 -1
  27. package/dist/client/search.js +21 -4
  28. package/dist/client/search.js.map +1 -1
  29. package/dist/client/streaming.d.ts +21 -21
  30. package/dist/client/streaming.d.ts.map +1 -1
  31. package/dist/client/streaming.js +35 -40
  32. package/dist/client/streaming.js.map +1 -1
  33. package/dist/client/threads.d.ts +46 -0
  34. package/dist/client/threads.d.ts.map +1 -0
  35. package/dist/client/threads.js +49 -0
  36. package/dist/client/threads.js.map +1 -0
  37. package/dist/client/types.d.ts +159 -75
  38. package/dist/client/types.d.ts.map +1 -1
  39. package/dist/component/_generated/api.d.ts +261 -209
  40. package/dist/component/messages.d.ts +314 -105
  41. package/dist/component/messages.d.ts.map +1 -1
  42. package/dist/component/messages.js +141 -83
  43. package/dist/component/messages.js.map +1 -1
  44. package/dist/component/schema.d.ts +631 -870
  45. package/dist/component/schema.d.ts.map +1 -1
  46. package/dist/component/schema.js +11 -16
  47. package/dist/component/schema.js.map +1 -1
  48. package/dist/component/streams.d.ts +29 -149
  49. package/dist/component/streams.d.ts.map +1 -1
  50. package/dist/component/streams.js +104 -60
  51. package/dist/component/streams.js.map +1 -1
  52. package/dist/component/threads.d.ts +4 -4
  53. package/dist/component/users.d.ts +3 -3
  54. package/dist/mapping.d.ts +15 -16
  55. package/dist/mapping.d.ts.map +1 -1
  56. package/dist/mapping.js +208 -62
  57. package/dist/mapping.js.map +1 -1
  58. package/dist/parts.d.ts +3 -0
  59. package/dist/parts.d.ts.map +1 -0
  60. package/dist/parts.js +34 -0
  61. package/dist/parts.js.map +1 -0
  62. package/dist/react/SmoothText.d.ts +5 -0
  63. package/dist/react/SmoothText.d.ts.map +1 -0
  64. package/dist/react/SmoothText.js +6 -0
  65. package/dist/react/SmoothText.js.map +1 -0
  66. package/dist/react/deltas.d.ts +3 -5
  67. package/dist/react/deltas.d.ts.map +1 -1
  68. package/dist/react/deltas.js +89 -53
  69. package/dist/react/deltas.js.map +1 -1
  70. package/dist/react/index.d.ts +1 -0
  71. package/dist/react/index.d.ts.map +1 -1
  72. package/dist/react/index.js +31 -11
  73. package/dist/react/index.js.map +1 -1
  74. package/dist/react/optimisticallySendMessage.d.ts.map +1 -1
  75. package/dist/react/optimisticallySendMessage.js +2 -8
  76. package/dist/react/optimisticallySendMessage.js.map +1 -1
  77. package/dist/react/toUIMessages.d.ts +5 -4
  78. package/dist/react/toUIMessages.d.ts.map +1 -1
  79. package/dist/react/toUIMessages.js +103 -40
  80. package/dist/react/toUIMessages.js.map +1 -1
  81. package/dist/react/useSmoothText.d.ts +13 -12
  82. package/dist/react/useSmoothText.d.ts.map +1 -1
  83. package/dist/react/useSmoothText.js +1 -1
  84. package/dist/react/useSmoothText.js.map +1 -1
  85. package/dist/validators.d.ts +751 -1464
  86. package/dist/validators.d.ts.map +1 -1
  87. package/dist/validators.js +39 -80
  88. package/dist/validators.js.map +1 -1
  89. package/package.json +34 -30
  90. package/src/client/createTool.ts +66 -40
  91. package/src/client/defaultComponent.ts +17 -0
  92. package/src/client/definePlaygroundAPI.ts +17 -31
  93. package/src/client/files.ts +94 -17
  94. package/src/client/index.test.ts +28 -38
  95. package/src/client/index.ts +785 -977
  96. package/src/client/messages.ts +205 -0
  97. package/src/client/search.ts +37 -10
  98. package/src/client/streaming.ts +53 -56
  99. package/src/client/threads.ts +78 -0
  100. package/src/client/types.ts +239 -131
  101. package/src/component/_generated/api.d.ts +261 -209
  102. package/src/component/messages.test.ts +182 -40
  103. package/src/component/messages.ts +165 -108
  104. package/src/component/schema.ts +11 -17
  105. package/src/component/streams.ts +180 -69
  106. package/src/mapping.ts +253 -96
  107. package/src/parts.ts +39 -0
  108. package/src/react/SmoothText.tsx +9 -0
  109. package/src/react/deltas.test.ts +38 -42
  110. package/src/react/deltas.ts +116 -65
  111. package/src/react/index.ts +35 -13
  112. package/src/react/optimisticallySendMessage.ts +2 -8
  113. package/src/react/toUIMessages.test.ts +154 -36
  114. package/src/react/toUIMessages.ts +136 -57
  115. package/src/react/useSmoothText.ts +14 -15
  116. package/src/validators.test.ts +1 -117
  117. package/src/validators.ts +57 -107
  118. package/dist/client/listMessages.d.ts +0 -22
  119. package/dist/client/listMessages.d.ts.map +0 -1
  120. package/dist/client/listMessages.js +0 -25
  121. package/dist/client/listMessages.js.map +0 -1
  122. package/src/client/listMessages.ts +0 -38
@@ -1,11 +1,14 @@
1
- import type { CoreMessage, DeepPartial, generateObject, GenerateObjectResult, generateText, GenerateTextResult, JSONValue, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelV1, RepairTextFunction, streamObject, StreamObjectResult, streamText, StreamTextResult, TelemetrySettings, ToolChoice, ToolSet } from "ai";
2
- import type { Auth, Expand, FunctionReference, StorageActionWriter, StorageReader, WithoutSystemFields, FunctionArgs, FunctionReturnType, GenericActionCtx, GenericDataModel } from "convex/server";
1
+ import type { InferSchema, ProviderOptions, Schema } from "@ai-sdk/provider-utils";
2
+ import type { JSONValue } from "@ai-sdk/provider";
3
+ import type { GenerateObjectResult, generateText, GenerateTextResult, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LanguageModel, streamObject, streamText, StreamTextResult, ToolChoice, ToolSet, RepairTextFunction, TelemetrySettings, CallSettings, Prompt } from "ai";
4
+ import type { Auth, Expand, FunctionArgs, FunctionReference, FunctionReturnType, GenericActionCtx, GenericDataModel, StorageActionWriter, StorageReader, WithoutSystemFields } from "convex/server";
3
5
  import type { GenericId } from "convex/values";
4
- import type { Schema } from "zod";
5
6
  import type { Mounts } from "../component/_generated/api.js";
6
- import type { ThreadDoc } from "../component/schema.js";
7
- import type { CallSettings, ProviderMetadata, ProviderOptions, StreamDelta, StreamMessage, Usage } from "../validators.js";
7
+ import type { MessageDoc, ThreadDoc } from "../component/schema.js";
8
+ import type { ProviderMetadata, StreamDelta, StreamMessage } from "../validators.js";
8
9
  import type { StreamingOptions } from "./streaming.js";
10
+ import type * as z3 from "zod/v3";
11
+ import type * as z4 from "zod/v4";
9
12
  /**
10
13
  * Options to configure what messages are fetched as context,
11
14
  * automatically with thread.generateText, or directly via search.
@@ -78,14 +81,32 @@ export type StorageOptions = {
78
81
  saveMessages?: "all" | "none" | "promptAndOutput";
79
82
  };
80
83
  export type GenerationOutputMetadata = {
81
- messageId?: string;
84
+ /**
85
+ * The ID of the prompt message for the generation.
86
+ */
87
+ promptMessageId?: string;
88
+ /**
89
+ * The order of the prompt message and responses for the generation.
90
+ * Each order starts with a user message, then followed by agent responses.
91
+ * If a promptMessageId is provided, that dictates the order.
92
+ */
82
93
  order?: number;
94
+ /**
95
+ * The messages saved for the generation - both saved input and output.
96
+ * If you passed promptMessageId, it will not include that message.
97
+ */
98
+ savedMessages?: MessageDoc[];
99
+ /**
100
+ * @deprecated Use promptMessageId instead.
101
+ * The ID of the prompt message for the generation.
102
+ */
103
+ messageId?: string;
83
104
  };
84
105
  export type UsageHandler = (ctx: RunActionCtx, args: {
85
106
  userId: string | undefined;
86
107
  threadId: string | undefined;
87
108
  agentName: string | undefined;
88
- usage: Usage;
109
+ usage: LanguageModelUsage;
89
110
  providerMetadata: ProviderMetadata | undefined;
90
111
  model: string;
91
112
  provider: string;
@@ -110,7 +131,7 @@ export type TextArgs<AgentTools extends ToolSet, TOOLS extends ToolSet | undefin
110
131
  * The model to use for the LLM calls. This will override the model specified
111
132
  * in the Agent constructor.
112
133
  */
113
- model?: LanguageModelV1;
134
+ model?: LanguageModel;
114
135
  /**
115
136
  * The tools to use for the tool calls. This will override tools specified
116
137
  * in the Agent constructor or createThread / continueThread.
@@ -134,7 +155,7 @@ export type StreamingTextArgs<AgentTools extends ToolSet, TOOLS extends ToolSet
134
155
  * The model to use for the tool calls. This will override the model specified
135
156
  * in the Agent constructor.
136
157
  */
137
- model?: LanguageModelV1;
158
+ model?: LanguageModel;
138
159
  /**
139
160
  * The tools to use for the tool calls. This will override tools specified
140
161
  * in the Agent constructor or createThread / continueThread.
@@ -146,67 +167,106 @@ export type StreamingTextArgs<AgentTools extends ToolSet, TOOLS extends ToolSet
146
167
  */
147
168
  toolChoice?: ToolChoice<TOOLS extends undefined ? AgentTools : TOOLS>;
148
169
  };
149
- type BaseGenerateObjectOptions = CallSettings & {
170
+ export type ObjectMode = "object" | "array" | "enum" | "no-schema";
171
+ export type ObjectSchema = z3.Schema | z4.core.$ZodType | Schema;
172
+ export type DefaultObjectSchema = z4.core.$ZodType<JSONValue>;
173
+ /**
174
+ * Due to some issues with the type inference of the ai sdk, we need to
175
+ * manually type the arguments for the generateObject function.
176
+ * This is a workaround to allow the model to be optional.
177
+ */
178
+ export type GenerateObjectArgs<SCHEMA extends ObjectSchema = DefaultObjectSchema, OUTPUT extends ObjectMode = InferSchema<SCHEMA> extends string ? "enum" : "object", RESULT = OUTPUT extends "array" ? Array<InferSchema<SCHEMA>> : InferSchema<SCHEMA>> = Omit<CallSettings, "stopSequences"> & Prompt & (OUTPUT extends "enum" ? {
150
179
  /**
151
- * The model to use for the object generation. This will override the model
152
- * specified in the Agent constructor.
153
- */
154
- model?: LanguageModelV1;
180
+ The enum values that the model should use.
181
+ */
182
+ enum: Array<RESULT>;
183
+ mode?: "json";
184
+ output: "enum";
185
+ } : OUTPUT extends "no-schema" ? {} : {
155
186
  /**
156
- * The system prompt to use for the object generation. This will override the
157
- * system prompt specified in the Agent constructor.
158
- */
159
- system?: string;
187
+ The schema of the object that the model should generate.
188
+ */
189
+ schema: SCHEMA;
160
190
  /**
161
- * The prompt to the LLM to use for the object generation.
162
- * Specify this or messages, but not both.
163
- */
164
- prompt?: string;
191
+ Optional name of the output that should be generated.
192
+ Used by some providers for additional LLM guidance, e.g.
193
+ via tool or schema name.
194
+ */
195
+ schemaName?: string;
165
196
  /**
166
- * The messages to use for the object generation.
167
- * Note: recent messages are automatically added based on the thread it's
168
- * associated with and your contextOptions.
169
- */
170
- messages?: CoreMessage[];
197
+ Optional description of the output that should be generated.
198
+ Used by some providers for additional LLM guidance, e.g.
199
+ via tool or schema description.
200
+ */
201
+ schemaDescription?: string;
171
202
  /**
172
- * The message to use as the "prompt" for the object generation.
173
- * If this is provided, it will be used instead of the prompt or messages.
174
- * This is useful if you want to first save a user message, then use it as
175
- * the prompt for the object generation in another call.
176
- */
177
- promptMessageId?: string;
203
+ The mode to use for object generation.
204
+
205
+ The schema is converted into a JSON schema and used in one of the following ways
206
+
207
+ - 'auto': The provider will choose the best mode for the model.
208
+ - 'tool': A tool with the JSON schema as parameters is provided and the provider is instructed to use it.
209
+ - 'json': The JSON schema and an instruction are injected into the prompt. If the provider supports JSON mode, it is enabled. If the provider supports JSON grammars, the grammar is used.
210
+
211
+ Please note that most providers do not support all modes.
212
+
213
+ Default and recommended: 'auto' (best mode for the model).
214
+ */
215
+ mode?: "auto" | "json" | "tool";
216
+ }) & {
217
+ output?: OUTPUT;
218
+ /**
219
+ The language model to use.
220
+ */
221
+ model?: LanguageModel;
222
+ /**
223
+ A function that attempts to repair the raw output of the model
224
+ to enable JSON parsing.
225
+ */
178
226
  experimental_repairText?: RepairTextFunction;
227
+ /**
228
+ Optional telemetry configuration (experimental).
229
+ */
179
230
  experimental_telemetry?: TelemetrySettings;
231
+ /**
232
+ Additional provider-specific options. They are passed through
233
+ to the provider from the AI SDK and enable provider-specific
234
+ functionality that can be fully encapsulated in the provider.
235
+ */
180
236
  providerOptions?: ProviderOptions;
181
- experimental_providerMetadata?: ProviderMetadata;
182
- };
183
- type GenerateObjectObjectOptions<T extends Record<string, unknown>> = BaseGenerateObjectOptions & {
184
- output?: "object";
185
- mode?: "auto" | "json" | "tool";
186
- schema: Schema<T>;
187
- schemaName?: string;
188
- schemaDescription?: string;
189
- };
190
- type GenerateObjectArrayOptions<T> = BaseGenerateObjectOptions & {
191
- output: "array";
192
- mode?: "auto" | "json" | "tool";
193
- schema: Schema<T>;
194
- schemaName?: string;
195
- schemaDescription?: string;
196
- };
197
- type GenerateObjectWithEnumOptions<T extends string> = BaseGenerateObjectOptions & {
198
- output: "enum";
199
- enum: Array<T>;
200
- mode?: "auto" | "json" | "tool";
237
+ /**
238
+ * Internal. For test use only. May change without notice.
239
+ */
240
+ _internal?: {
241
+ generateId?: () => string;
242
+ currentDate?: () => Date;
243
+ };
201
244
  };
202
- type GenerateObjectNoSchemaOptions = BaseGenerateObjectOptions & {
203
- schema?: undefined;
204
- mode?: "json";
245
+ export type StreamObjectArgs<SCHEMA extends ObjectSchema = DefaultObjectSchema, OUTPUT extends ObjectMode = InferSchema<SCHEMA> extends string ? "enum" : "object", RESULT = OUTPUT extends "array" ? Array<InferSchema<SCHEMA>> : InferSchema<SCHEMA>> = GenerateObjectArgs<SCHEMA, OUTPUT, RESULT> & Pick<Parameters<typeof streamObject<SCHEMA, OUTPUT, RESULT>>[0], "onError" | "onFinish" | "_internal">;
246
+ export type MaybeCustomCtx<CustomCtx, DataModel extends GenericDataModel, AgentTools extends ToolSet> = CustomCtx extends Record<string, unknown> ? {
247
+ /**
248
+ * If you have a custom ctx that you use with the Agent
249
+ * (e.g. new Agent<{ orgId: string }>(...))
250
+ * you need to provide this function to add any extra fields.
251
+ * e.g.
252
+ * ```ts
253
+ * const myAgent = new Agent<{ orgId: string }>(...);
254
+ * const myAction = myAgent.asTextAction({
255
+ * customCtx: (ctx: ActionCtx, target, llmArgs) => {
256
+ * const orgId = await lookupOrgId(ctx, target.threadId);
257
+ * return { orgId };
258
+ * },
259
+ * });
260
+ * ```
261
+ * Then, in your tools, you can
262
+ */
263
+ customCtx: (ctx: GenericActionCtx<DataModel>, target: {
264
+ userId?: string | undefined;
265
+ threadId?: string | undefined;
266
+ }, llmArgs: TextArgs<AgentTools>) => CustomCtx;
267
+ } : {
268
+ customCtx?: never;
205
269
  };
206
- type GenerateObjectArgs<T> = T extends Record<string, unknown> ? GenerateObjectObjectOptions<T> : T extends Array<unknown> ? GenerateObjectArrayOptions<T> : T extends string ? GenerateObjectWithEnumOptions<T> : GenerateObjectNoSchemaOptions;
207
- type StreamObjectArgs<T> = T extends Record<string, unknown> ? GenerateObjectObjectOptions<T> : T extends Array<unknown> ? GenerateObjectArrayOptions<T> : GenerateObjectNoSchemaOptions;
208
- export type OurObjectArgs<T> = GenerateObjectArgs<T> & Pick<Parameters<typeof generateObject<any>>[0], "experimental_repairText" | "abortSignal">;
209
- export type OurStreamObjectArgs<T> = StreamObjectArgs<T> & Pick<Parameters<typeof streamObject<T>>[0], "onError" | "onFinish" | "abortSignal">;
210
270
  type ThreadOutputMetadata = Required<GenerationOutputMetadata>;
211
271
  /**
212
272
  * The interface for a thread returned from {@link createThread} or {@link continueThread}.
@@ -235,7 +295,7 @@ export interface Thread<DefaultTools extends ToolSet> {
235
295
  * for the {@link ContextOptions} and {@link StorageOptions}.
236
296
  * @returns The result of the generateText function.
237
297
  */
238
- generateText<TOOLS extends ToolSet | undefined = undefined, OUTPUT = never, OUTPUT_PARTIAL = never>(args: TextArgs<TOOLS extends undefined ? DefaultTools : TOOLS, TOOLS, OUTPUT, OUTPUT_PARTIAL>, options?: Options): Promise<GenerateTextResult<TOOLS extends undefined ? DefaultTools : TOOLS, OUTPUT> & ThreadOutputMetadata>;
298
+ generateText<TOOLS extends ToolSet | undefined = undefined, OUTPUT = never, OUTPUT_PARTIAL = never>(generateTextArgs: TextArgs<TOOLS extends undefined ? DefaultTools : TOOLS, TOOLS, OUTPUT, OUTPUT_PARTIAL>, options?: Options): Promise<GenerateTextResult<TOOLS extends undefined ? DefaultTools : TOOLS, OUTPUT> & ThreadOutputMetadata>;
239
299
  /**
240
300
  * This behaves like {@link streamText} from the "ai" package except that
241
301
  * it add context based on the userId and threadId and saves the input and
@@ -246,7 +306,7 @@ export interface Thread<DefaultTools extends ToolSet> {
246
306
  * for the {@link ContextOptions} and {@link StorageOptions}.
247
307
  * @returns The result of the streamText function.
248
308
  */
249
- streamText<TOOLS extends ToolSet | undefined = undefined, OUTPUT = never, PARTIAL_OUTPUT = never>(args: StreamingTextArgs<TOOLS extends undefined ? DefaultTools : TOOLS, TOOLS, OUTPUT, PARTIAL_OUTPUT>, options?: Options & {
309
+ streamText<TOOLS extends ToolSet | undefined = undefined, OUTPUT = never, PARTIAL_OUTPUT = never>(streamTextArgs: StreamingTextArgs<TOOLS extends undefined ? DefaultTools : TOOLS, TOOLS, OUTPUT, PARTIAL_OUTPUT>, options?: Options & {
250
310
  /**
251
311
  * Whether to save incremental data (deltas) from streaming responses.
252
312
  * Defaults to false.
@@ -269,18 +329,20 @@ export interface Thread<DefaultTools extends ToolSet> {
269
329
  * for the {@link ContextOptions} and {@link StorageOptions}.
270
330
  * @returns The result of the generateObject function.
271
331
  */
272
- generateObject<T>(args: OurObjectArgs<T>, options?: Options): Promise<GenerateObjectResult<T> & ThreadOutputMetadata>;
273
- /**
274
- * This behaves like {@link generateObject} from the "ai" package except that
275
- * it add context based on the userId and threadId and saves the input and
276
- * resulting messages to the thread, if specified. This overload is for when there's no schema.
277
- * Use {@link continueThread} to get a version of this function already scoped
278
- * to a thread (and optionally userId).
279
- * @param args The arguments to the generateObject function, along with extra controls
280
- * for the {@link ContextOptions} and {@link StorageOptions}.
281
- * @returns The result of the generateObject function.
282
- */
283
- generateObject(args: GenerateObjectNoSchemaOptions, options?: Options): Promise<GenerateObjectResult<JSONValue> & ThreadOutputMetadata>;
332
+ generateObject<SCHEMA extends ObjectSchema = DefaultObjectSchema, OUTPUT extends ObjectMode = InferSchema<SCHEMA> extends string ? "enum" : "object", RESULT = OUTPUT extends "array" ? Array<InferSchema<SCHEMA>> : InferSchema<SCHEMA>>(generateObjectArgs: GenerateObjectArgs<SCHEMA, OUTPUT, RESULT> & {
333
+ /**
334
+ * If provided, this message will be used as the "prompt" for the LLM call,
335
+ * instead of the prompt or messages.
336
+ * This is useful if you want to first save a user message, then use it as
337
+ * the prompt for the LLM call in another call.
338
+ */
339
+ promptMessageId?: string;
340
+ /**
341
+ * The model to use for the LLM calls. This will override the model specified
342
+ * in the Agent constructor.
343
+ */
344
+ model?: LanguageModel;
345
+ }, options?: Options): Promise<GenerateObjectResult<RESULT> & ThreadOutputMetadata>;
284
346
  /**
285
347
  * This behaves like {@link streamObject} from the "ai" package except that
286
348
  * it add context based on the userId and threadId and saves the input and
@@ -291,7 +353,24 @@ export interface Thread<DefaultTools extends ToolSet> {
291
353
  * for the {@link ContextOptions} and {@link StorageOptions}.
292
354
  * @returns The result of the streamObject function.
293
355
  */
294
- streamObject<T>(args: OurStreamObjectArgs<T>, options?: Options): Promise<StreamObjectResult<DeepPartial<T>, T, never> & ThreadOutputMetadata>;
356
+ streamObject<SCHEMA extends ObjectSchema = DefaultObjectSchema, OUTPUT extends ObjectMode = InferSchema<SCHEMA> extends string ? "enum" : "object", RESULT = OUTPUT extends "array" ? Array<InferSchema<SCHEMA>> : InferSchema<SCHEMA>>(
357
+ /**
358
+ * The same arguments you'd pass to "ai" sdk {@link streamObject}.
359
+ */
360
+ streamObjectArgs: StreamObjectArgs<SCHEMA, OUTPUT, RESULT> & {
361
+ /**
362
+ * If provided, this message will be used as the "prompt" for the LLM call,
363
+ * instead of the prompt or messages.
364
+ * This is useful if you want to first save a user message, then use it as
365
+ * the prompt for the LLM call in another call.
366
+ */
367
+ promptMessageId?: string;
368
+ /**
369
+ * The model to use for the LLM calls. This will override the model specified
370
+ * in the Agent constructor.
371
+ */
372
+ model?: LanguageModel;
373
+ }, options?: Options): Promise<ReturnType<typeof streamObject<SCHEMA, OUTPUT, RESULT>> & ThreadOutputMetadata>;
295
374
  }
296
375
  export type Options = {
297
376
  /**
@@ -302,6 +381,11 @@ export type Options = {
302
381
  * The storage options to use for saving the input and output messages to the thread.
303
382
  */
304
383
  storageOptions?: StorageOptions;
384
+ /**
385
+ * The usage handler to use for this thread. Overrides any handler
386
+ * set in the agent constructor.
387
+ */
388
+ usageHandler?: UsageHandler;
305
389
  };
306
390
  export type SyncStreamsReturnValue = {
307
391
  kind: "list";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,4BAA4B,EAC5B,6BAA6B,EAC7B,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,OAAO,EACR,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EACV,IAAI,EACJ,MAAM,EACN,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,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