ai 3.4.26 → 3.4.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "3.4.26",
3
+ "version": "3.4.27",
4
4
  "description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -105,8 +105,8 @@
105
105
  "tsup": "^7.2.0",
106
106
  "typescript": "5.5.4",
107
107
  "zod": "3.23.8",
108
- "eslint-config-vercel-ai": "0.0.0",
109
- "@vercel/ai-tsconfig": "0.0.0"
108
+ "@vercel/ai-tsconfig": "0.0.0",
109
+ "eslint-config-vercel-ai": "0.0.0"
110
110
  },
111
111
  "peerDependencies": {
112
112
  "openai": "^4.42.0",
@@ -1,6 +1,7 @@
1
1
  import { LanguageModelV1FinishReason, LanguageModelV1CallWarning, LanguageModelV1ProviderMetadata, LanguageModelV1 } from '@ai-sdk/provider';
2
2
  import { ReactNode } from 'react';
3
3
  import { z } from 'zod';
4
+ import { ToolInvocation, Attachment } from '@ai-sdk/ui-utils';
4
5
  import OpenAI from 'openai';
5
6
 
6
7
  type AIAction<T = any, R = any> = (...args: T[]) => Promise<R>;
@@ -436,6 +437,13 @@ It can be a user message, an assistant message, or a tool message.
436
437
  */
437
438
  type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage | CoreToolMessage;
438
439
 
440
+ type UIMessage = {
441
+ role: 'system' | 'user' | 'assistant' | 'function' | 'data' | 'tool';
442
+ content: string;
443
+ toolInvocations?: ToolInvocation[];
444
+ experimental_attachments?: Attachment[];
445
+ };
446
+
439
447
  /**
440
448
  Prompt part of the AI function options.
441
449
  It contains a system message, a simple text prompt, or a list of messages.
@@ -452,7 +460,7 @@ type Prompt = {
452
460
  /**
453
461
  A list of messages. You can either use `prompt` or `messages` but not both.
454
462
  */
455
- messages?: Array<CoreMessage>;
463
+ messages?: Array<CoreMessage> | Array<UIMessage>;
456
464
  };
457
465
 
458
466
  type Streamable$1 = ReactNode | Promise<ReactNode>;
@@ -1,6 +1,7 @@
1
1
  import { LanguageModelV1FinishReason, LanguageModelV1CallWarning, LanguageModelV1ProviderMetadata, LanguageModelV1 } from '@ai-sdk/provider';
2
2
  import { ReactNode } from 'react';
3
3
  import { z } from 'zod';
4
+ import { ToolInvocation, Attachment } from '@ai-sdk/ui-utils';
4
5
  import OpenAI from 'openai';
5
6
 
6
7
  type AIAction<T = any, R = any> = (...args: T[]) => Promise<R>;
@@ -434,6 +435,13 @@ It can be a user message, an assistant message, or a tool message.
434
435
  */
435
436
  type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage | CoreToolMessage;
436
437
 
438
+ type UIMessage = {
439
+ role: 'system' | 'user' | 'assistant' | 'function' | 'data' | 'tool';
440
+ content: string;
441
+ toolInvocations?: ToolInvocation[];
442
+ experimental_attachments?: Attachment[];
443
+ };
444
+
437
445
  /**
438
446
  Prompt part of the AI function options.
439
447
  It contains a system message, a simple text prompt, or a list of messages.
@@ -450,7 +458,7 @@ type Prompt = {
450
458
  /**
451
459
  A list of messages. You can either use `prompt` or `messages` but not both.
452
460
  */
453
- messages?: Array<CoreMessage>;
461
+ messages?: Array<CoreMessage> | Array<UIMessage>;
454
462
  };
455
463
 
456
464
  type Streamable$1 = ReactNode | Promise<ReactNode>;