ai 6.0.0-beta.63 → 6.0.0-beta.64

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.0-beta.64
4
+
5
+ ### Patch Changes
6
+
7
+ - 2d28066: chore(agent): limit agent call parameters
8
+
3
9
  ## 6.0.0-beta.63
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -2380,6 +2380,33 @@ type TextStreamPart<TOOLS extends ToolSet> = {
2380
2380
  rawValue: unknown;
2381
2381
  };
2382
2382
 
2383
+ type AgentCallParameters = {
2384
+ /**
2385
+ * A prompt. It can be either a text prompt or a list of messages.
2386
+ *
2387
+ * You can either use `prompt` or `messages` but not both.
2388
+ */
2389
+ prompt: string | Array<ModelMessage>;
2390
+ /**
2391
+ * A list of messages.
2392
+ *
2393
+ * You can either use `prompt` or `messages` but not both.
2394
+ */
2395
+ messages?: never;
2396
+ } | {
2397
+ /**
2398
+ * A list of messages.
2399
+ *
2400
+ * You can either use `prompt` or `messages` but not both.
2401
+ */
2402
+ messages: Array<ModelMessage>;
2403
+ /**
2404
+ * A prompt. It can be either a text prompt or a list of messages.
2405
+ *
2406
+ * You can either use `prompt` or `messages` but not both.
2407
+ */
2408
+ prompt?: never;
2409
+ };
2383
2410
  /**
2384
2411
  * An Agent receives a prompt (text or messages) and generates or streams an output
2385
2412
  * that consists of steps, tool calls, data parts, etc.
@@ -2404,11 +2431,11 @@ interface Agent<TOOLS extends ToolSet = {}, OUTPUT extends Output = never> {
2404
2431
  /**
2405
2432
  * Generates an output from the agent (non-streaming).
2406
2433
  */
2407
- generate(options: Prompt): PromiseLike<GenerateTextResult<TOOLS, InferGenerateOutput<OUTPUT>>>;
2434
+ generate(options: AgentCallParameters): PromiseLike<GenerateTextResult<TOOLS, InferGenerateOutput<OUTPUT>>>;
2408
2435
  /**
2409
2436
  * Streams an output from the agent (streaming).
2410
2437
  */
2411
- stream(options: Prompt): StreamTextResult<TOOLS, InferStreamOutput<OUTPUT>>;
2438
+ stream(options: AgentCallParameters): StreamTextResult<TOOLS, InferStreamOutput<OUTPUT>>;
2412
2439
  }
2413
2440
 
2414
2441
  /**
@@ -2540,11 +2567,11 @@ declare class ToolLoopAgent<TOOLS extends ToolSet = {}, OUTPUT extends Output =
2540
2567
  /**
2541
2568
  * Generates an output from the agent (non-streaming).
2542
2569
  */
2543
- generate(options: Prompt): Promise<GenerateTextResult<TOOLS, InferGenerateOutput<OUTPUT>>>;
2570
+ generate(options: AgentCallParameters): Promise<GenerateTextResult<TOOLS, InferGenerateOutput<OUTPUT>>>;
2544
2571
  /**
2545
2572
  * Streams an output from the agent (streaming).
2546
2573
  */
2547
- stream(options: Prompt): StreamTextResult<TOOLS, InferStreamOutput<OUTPUT>>;
2574
+ stream(options: AgentCallParameters): StreamTextResult<TOOLS, InferStreamOutput<OUTPUT>>;
2548
2575
  }
2549
2576
 
2550
2577
  /**
package/dist/index.d.ts CHANGED
@@ -2380,6 +2380,33 @@ type TextStreamPart<TOOLS extends ToolSet> = {
2380
2380
  rawValue: unknown;
2381
2381
  };
2382
2382
 
2383
+ type AgentCallParameters = {
2384
+ /**
2385
+ * A prompt. It can be either a text prompt or a list of messages.
2386
+ *
2387
+ * You can either use `prompt` or `messages` but not both.
2388
+ */
2389
+ prompt: string | Array<ModelMessage>;
2390
+ /**
2391
+ * A list of messages.
2392
+ *
2393
+ * You can either use `prompt` or `messages` but not both.
2394
+ */
2395
+ messages?: never;
2396
+ } | {
2397
+ /**
2398
+ * A list of messages.
2399
+ *
2400
+ * You can either use `prompt` or `messages` but not both.
2401
+ */
2402
+ messages: Array<ModelMessage>;
2403
+ /**
2404
+ * A prompt. It can be either a text prompt or a list of messages.
2405
+ *
2406
+ * You can either use `prompt` or `messages` but not both.
2407
+ */
2408
+ prompt?: never;
2409
+ };
2383
2410
  /**
2384
2411
  * An Agent receives a prompt (text or messages) and generates or streams an output
2385
2412
  * that consists of steps, tool calls, data parts, etc.
@@ -2404,11 +2431,11 @@ interface Agent<TOOLS extends ToolSet = {}, OUTPUT extends Output = never> {
2404
2431
  /**
2405
2432
  * Generates an output from the agent (non-streaming).
2406
2433
  */
2407
- generate(options: Prompt): PromiseLike<GenerateTextResult<TOOLS, InferGenerateOutput<OUTPUT>>>;
2434
+ generate(options: AgentCallParameters): PromiseLike<GenerateTextResult<TOOLS, InferGenerateOutput<OUTPUT>>>;
2408
2435
  /**
2409
2436
  * Streams an output from the agent (streaming).
2410
2437
  */
2411
- stream(options: Prompt): StreamTextResult<TOOLS, InferStreamOutput<OUTPUT>>;
2438
+ stream(options: AgentCallParameters): StreamTextResult<TOOLS, InferStreamOutput<OUTPUT>>;
2412
2439
  }
2413
2440
 
2414
2441
  /**
@@ -2540,11 +2567,11 @@ declare class ToolLoopAgent<TOOLS extends ToolSet = {}, OUTPUT extends Output =
2540
2567
  /**
2541
2568
  * Generates an output from the agent (non-streaming).
2542
2569
  */
2543
- generate(options: Prompt): Promise<GenerateTextResult<TOOLS, InferGenerateOutput<OUTPUT>>>;
2570
+ generate(options: AgentCallParameters): Promise<GenerateTextResult<TOOLS, InferGenerateOutput<OUTPUT>>>;
2544
2571
  /**
2545
2572
  * Streams an output from the agent (streaming).
2546
2573
  */
2547
- stream(options: Prompt): StreamTextResult<TOOLS, InferStreamOutput<OUTPUT>>;
2574
+ stream(options: AgentCallParameters): StreamTextResult<TOOLS, InferStreamOutput<OUTPUT>>;
2548
2575
  }
2549
2576
 
2550
2577
  /**
package/dist/index.js CHANGED
@@ -873,7 +873,7 @@ function detectMediaType({
873
873
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
874
874
 
875
875
  // src/version.ts
876
- var VERSION = true ? "6.0.0-beta.63" : "0.0.0-test";
876
+ var VERSION = true ? "6.0.0-beta.64" : "0.0.0-test";
877
877
 
878
878
  // src/util/download/download.ts
879
879
  var download = async ({ url }) => {