ai 3.4.25 → 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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +14 -11
- package/dist/index.d.ts +14 -11
- package/dist/index.js +332 -265
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +313 -246
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/rsc/dist/index.d.ts +9 -1
- package/rsc/dist/rsc-server.d.mts +9 -1
- package/rsc/dist/rsc-server.mjs +313 -69
- package/rsc/dist/rsc-server.mjs.map +1 -1
package/package.json
CHANGED
package/rsc/dist/index.d.ts
CHANGED
@@ -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>;
|