ai 7.0.0-beta.113 → 7.0.0-beta.115
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 +32 -0
- package/dist/index.d.ts +1506 -1468
- package/dist/index.js +889 -979
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +273 -273
- package/dist/internal/index.js +367 -405
- package/dist/internal/index.js.map +1 -1
- package/dist/test/index.d.ts +18 -18
- package/dist/test/index.js +22 -22
- package/dist/test/index.js.map +1 -1
- package/docs/02-foundations/03-prompts.mdx +13 -11
- package/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx +2 -1
- package/docs/03-ai-sdk-core/39-file-uploads.mdx +1 -1
- package/docs/03-ai-sdk-core/45-provider-management.mdx +1 -1
- package/docs/03-ai-sdk-core/60-telemetry.mdx +87 -13
- package/docs/07-reference/01-ai-sdk-core/12-generate-speech.mdx +2 -2
- package/docs/07-reference/01-ai-sdk-core/20-tool.mdx +7 -0
- package/docs/07-reference/01-ai-sdk-core/22-dynamic-tool.mdx +7 -0
- package/docs/07-reference/01-ai-sdk-core/30-model-message.mdx +9 -1
- package/docs/07-reference/01-ai-sdk-core/40-provider-registry.mdx +104 -0
- package/docs/07-reference/01-ai-sdk-core/42-custom-provider.mdx +56 -10
- package/docs/07-reference/02-ai-sdk-ui/31-convert-to-model-messages.mdx +1 -1
- package/docs/08-migration-guides/23-migration-guide-7-0.mdx +42 -0
- package/docs/09-troubleshooting/70-high-memory-usage-with-images.mdx +2 -2
- package/package.json +5 -5
- package/src/agent/agent.ts +13 -9
- package/src/agent/create-agent-ui-stream-response.ts +8 -8
- package/src/agent/create-agent-ui-stream.ts +9 -9
- package/src/agent/infer-agent-tools.ts +1 -1
- package/src/agent/infer-agent-ui-message.ts +2 -2
- package/src/agent/pipe-agent-ui-stream-to-response.ts +9 -9
- package/src/agent/tool-loop-agent-settings.ts +17 -19
- package/src/agent/tool-loop-agent.ts +16 -8
- package/src/embed/embed-many-result.ts +3 -4
- package/src/embed/embed-many.ts +5 -5
- package/src/embed/embed-result.ts +3 -4
- package/src/embed/embed.ts +4 -4
- package/src/error/invalid-stream-part-error.ts +1 -1
- package/src/error/no-image-generated-error.ts +1 -1
- package/src/error/no-object-generated-error.ts +3 -3
- package/src/error/no-speech-generated-error.ts +1 -1
- package/src/error/no-transcript-generated-error.ts +1 -1
- package/src/error/no-video-generated-error.ts +1 -1
- package/src/error/tool-call-repair-error.ts +2 -2
- package/src/error/verify-no-object-generated-error.ts +1 -1
- package/src/generate-image/generate-image-result.ts +5 -5
- package/src/generate-image/generate-image.ts +12 -15
- package/src/generate-image/index.ts +3 -2
- package/src/generate-object/generate-object-result.ts +2 -2
- package/src/generate-object/generate-object.ts +14 -14
- package/src/generate-object/inject-json-instruction.ts +1 -1
- package/src/generate-object/output-strategy.ts +10 -10
- package/src/generate-object/parse-and-validate-object-result.ts +1 -1
- package/src/generate-object/repair-text.ts +1 -1
- package/src/generate-object/stream-object-result.ts +4 -4
- package/src/generate-object/stream-object.ts +22 -19
- package/src/generate-object/validate-object-generation-input.ts +1 -1
- package/src/generate-speech/generate-speech-result.ts +4 -4
- package/src/generate-speech/generate-speech.ts +12 -13
- package/src/generate-speech/generated-audio-file.ts +1 -2
- package/src/generate-text/collect-tool-approvals.ts +4 -4
- package/src/generate-text/content-part.ts +9 -9
- package/src/generate-text/create-execute-tools-transformation.ts +9 -7
- package/src/generate-text/execute-tool-call.ts +11 -13
- package/src/generate-text/extract-reasoning-content.ts +1 -1
- package/src/generate-text/extract-text-content.ts +4 -1
- package/src/generate-text/generate-text-events.ts +2 -2
- package/src/generate-text/generate-text-result.ts +18 -14
- package/src/generate-text/generate-text.ts +42 -38
- package/src/generate-text/invoke-tool-callbacks-from-stream.ts +2 -3
- package/src/generate-text/output-utils.ts +1 -1
- package/src/generate-text/output.ts +8 -8
- package/src/generate-text/parse-tool-call.ts +36 -9
- package/src/generate-text/prepare-step.ts +3 -5
- package/src/generate-text/prune-messages.ts +1 -1
- package/src/generate-text/reasoning-output.ts +26 -9
- package/src/generate-text/reasoning.ts +1 -1
- package/src/generate-text/resolve-tool-approval.ts +3 -3
- package/src/generate-text/response-message.ts +1 -1
- package/src/generate-text/restricted-telemetry-dispatcher.ts +1 -1
- package/src/generate-text/smooth-stream.ts +6 -5
- package/src/generate-text/step-result.ts +16 -11
- package/src/generate-text/stop-condition.ts +1 -1
- package/src/generate-text/stream-language-model-call.ts +26 -21
- package/src/generate-text/stream-text-result.ts +29 -26
- package/src/generate-text/stream-text.ts +48 -46
- package/src/generate-text/to-response-messages.ts +2 -2
- package/src/generate-text/tool-approval-configuration.ts +2 -2
- package/src/generate-text/tool-approval-request-output.ts +1 -1
- package/src/generate-text/tool-approval-response-output.ts +1 -1
- package/src/generate-text/tool-call-repair-function.ts +4 -4
- package/src/generate-text/tool-call.ts +3 -4
- package/src/generate-text/tool-error.ts +3 -4
- package/src/generate-text/tool-execution-events.ts +2 -2
- package/src/generate-text/tool-output-denied.ts +1 -1
- package/src/generate-text/tool-output.ts +2 -2
- package/src/generate-text/tool-result.ts +7 -4
- package/src/generate-text/tools-context-parameter.ts +1 -1
- package/src/generate-text/validate-tool-context.ts +1 -2
- package/src/generate-video/generate-video-result.ts +4 -4
- package/src/generate-video/generate-video.ts +6 -10
- package/src/global.ts +2 -2
- package/src/index.ts +3 -3
- package/src/logger/log-warnings.ts +1 -1
- package/src/middleware/add-tool-input-examples-middleware.ts +2 -2
- package/src/middleware/default-embedding-settings-middleware.ts +2 -2
- package/src/middleware/default-settings-middleware.ts +2 -2
- package/src/middleware/extract-json-middleware.ts +1 -1
- package/src/middleware/extract-reasoning-middleware.ts +1 -1
- package/src/middleware/simulate-streaming-middleware.ts +1 -1
- package/src/middleware/wrap-embedding-model.ts +2 -2
- package/src/middleware/wrap-image-model.ts +2 -2
- package/src/middleware/wrap-language-model.ts +2 -2
- package/src/middleware/wrap-provider.ts +2 -2
- package/src/model/as-embedding-model-v3.ts +1 -1
- package/src/model/as-embedding-model-v4.ts +1 -1
- package/src/model/as-image-model-v3.ts +1 -1
- package/src/model/as-image-model-v4.ts +5 -1
- package/src/model/as-language-model-v3.ts +1 -1
- package/src/model/as-language-model-v4.ts +1 -1
- package/src/model/as-provider-v3.ts +1 -1
- package/src/model/as-provider-v4.ts +1 -1
- package/src/model/as-reranking-model-v4.ts +1 -1
- package/src/model/as-speech-model-v3.ts +1 -1
- package/src/model/as-speech-model-v4.ts +5 -1
- package/src/model/as-transcription-model-v3.ts +4 -1
- package/src/model/as-transcription-model-v4.ts +1 -1
- package/src/model/as-video-model-v4.ts +1 -1
- package/src/model/resolve-model.ts +8 -8
- package/src/prompt/content-part.ts +45 -15
- package/src/prompt/convert-to-language-model-prompt.ts +108 -122
- package/src/prompt/create-tool-model-output.ts +2 -2
- package/src/prompt/data-content.ts +1 -78
- package/src/prompt/file-part-data.ts +125 -0
- package/src/prompt/index.ts +3 -2
- package/src/prompt/language-model-call-options.ts +1 -1
- package/src/prompt/message-conversion-error.ts +1 -1
- package/src/prompt/message.ts +1 -1
- package/src/prompt/prepare-language-model-call-options.ts +1 -1
- package/src/prompt/prepare-tool-choice.ts +2 -2
- package/src/prompt/prepare-tools.ts +2 -2
- package/src/prompt/prompt.ts +1 -1
- package/src/prompt/standardize-prompt.ts +3 -3
- package/src/registry/custom-provider.ts +127 -92
- package/src/registry/index.ts +1 -1
- package/src/registry/provider-registry.ts +91 -87
- package/src/rerank/rerank-result.ts +1 -1
- package/src/rerank/rerank.ts +8 -5
- package/src/telemetry/create-telemetry-dispatcher.ts +11 -1
- package/src/telemetry/diagnostic-channel-publisher.ts +50 -0
- package/src/telemetry/diagnostic-channel.ts +24 -0
- package/src/telemetry/index.ts +5 -0
- package/src/telemetry/telemetry.ts +1 -1
- package/src/test/mock-embedding-model-v2.ts +1 -1
- package/src/test/mock-embedding-model-v3.ts +1 -1
- package/src/test/mock-embedding-model-v4.ts +1 -1
- package/src/test/mock-image-model-v2.ts +1 -1
- package/src/test/mock-image-model-v3.ts +1 -1
- package/src/test/mock-image-model-v4.ts +1 -1
- package/src/test/mock-language-model-v2.ts +1 -1
- package/src/test/mock-language-model-v3.ts +1 -1
- package/src/test/mock-language-model-v4.ts +1 -1
- package/src/test/mock-provider-v2.ts +6 -7
- package/src/test/mock-provider-v3.ts +7 -8
- package/src/test/mock-provider-v4.ts +7 -8
- package/src/test/mock-reranking-model-v3.ts +1 -1
- package/src/test/mock-reranking-model-v4.ts +1 -1
- package/src/test/mock-server-response.ts +1 -1
- package/src/test/mock-speech-model-v2.ts +1 -1
- package/src/test/mock-speech-model-v3.ts +1 -1
- package/src/test/mock-speech-model-v4.ts +1 -1
- package/src/test/mock-transcription-model-v2.ts +1 -1
- package/src/test/mock-transcription-model-v3.ts +1 -1
- package/src/test/mock-transcription-model-v4.ts +1 -1
- package/src/test/mock-video-model-v3.ts +1 -1
- package/src/test/mock-video-model-v4.ts +1 -1
- package/src/text-stream/pipe-text-stream-to-response.ts +1 -1
- package/src/transcribe/transcribe-result.ts +3 -3
- package/src/transcribe/transcribe.ts +12 -12
- package/src/types/embedding-model-middleware.ts +1 -1
- package/src/types/embedding-model.ts +1 -1
- package/src/types/image-model-middleware.ts +1 -1
- package/src/types/image-model.ts +1 -1
- package/src/types/json-value.ts +1 -1
- package/src/types/language-model-middleware.ts +1 -1
- package/src/types/language-model.ts +2 -2
- package/src/types/provider-metadata.ts +1 -1
- package/src/types/provider-reference.ts +1 -1
- package/src/types/provider.ts +4 -4
- package/src/types/reranking-model.ts +1 -1
- package/src/types/speech-model.ts +5 -1
- package/src/types/transcription-model.ts +1 -1
- package/src/types/usage.ts +1 -1
- package/src/types/video-model.ts +1 -1
- package/src/types/warning.ts +1 -1
- package/src/ui/call-completion-api.ts +2 -2
- package/src/ui/chat-transport.ts +3 -3
- package/src/ui/chat.ts +10 -11
- package/src/ui/convert-file-list-to-file-ui-parts.ts +1 -1
- package/src/ui/convert-to-model-messages.ts +34 -23
- package/src/ui/default-chat-transport.ts +4 -4
- package/src/ui/direct-chat-transport.ts +6 -6
- package/src/ui/http-chat-transport.ts +5 -5
- package/src/ui/last-assistant-message-is-complete-with-approval-responses.ts +0 -1
- package/src/ui/last-assistant-message-is-complete-with-tool-calls.ts +0 -1
- package/src/ui/process-ui-message-stream.ts +20 -21
- package/src/ui/text-stream-chat-transport.ts +3 -3
- package/src/ui/transform-text-to-ui-message-stream.ts +1 -1
- package/src/ui/ui-messages.ts +13 -6
- package/src/ui/use-completion.ts +1 -1
- package/src/ui/validate-ui-messages.ts +3 -3
- package/src/ui-message-stream/create-ui-message-stream-response.ts +2 -2
- package/src/ui-message-stream/create-ui-message-stream.ts +6 -6
- package/src/ui-message-stream/get-response-ui-message-id.ts +2 -2
- package/src/ui-message-stream/handle-ui-message-stream-finish.ts +6 -6
- package/src/ui-message-stream/pipe-ui-message-stream-to-response.ts +3 -3
- package/src/ui-message-stream/read-ui-message-stream.ts +4 -4
- package/src/ui-message-stream/ui-message-chunks.ts +4 -4
- package/src/ui-message-stream/ui-message-stream-on-finish-callback.ts +2 -2
- package/src/ui-message-stream/ui-message-stream-on-step-finish-callback.ts +1 -1
- package/src/ui-message-stream/ui-message-stream-writer.ts +3 -3
- package/src/upload-file/upload-file-result.ts +3 -3
- package/src/upload-file/upload-file.ts +34 -56
- package/src/upload-skill/upload-skill-result.ts +3 -3
- package/src/upload-skill/upload-skill.ts +27 -8
- package/src/util/create-resolvable-promise.ts +1 -1
- package/src/util/deep-partial.ts +1 -1
- package/src/util/download/download.ts +0 -2
- package/src/util/extract-literal-union.ts +18 -0
- package/src/util/is-node-runtime.ts +3 -0
- package/src/util/notify.ts +1 -1
- package/src/util/parse-partial-json.ts +1 -1
- package/src/util/prepare-retries.ts +1 -2
- package/src/util/serial-job-executor.ts +1 -1
- package/src/util/write-to-server-response.ts +1 -1
- package/src/util/detect-media-type.ts +0 -235
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,122 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { convertAsyncIteratorToReadableStream } from '@ai-sdk/provider-utils';
|
|
3
|
-
import { LanguageModelV4Prompt, LanguageModelV4, LanguageModelV3, LanguageModelV2, SharedV4Warning, LanguageModelV4Source, LanguageModelV4ToolChoice, LanguageModelV4FunctionTool, LanguageModelV4ProviderTool, LanguageModelV4CallOptions, LanguageModelV4Usage, JSONObject, EmbeddingModelV4Embedding, SharedV4ProviderMetadata, ProviderV4, ProviderV3, ProviderV2 } from '@ai-sdk/provider';
|
|
1
|
+
import { EmbeddingModelV4Embedding, LanguageModelV4, LanguageModelV3, LanguageModelV2, SharedV4Warning, LanguageModelV4Source, SharedV4ProviderMetadata, LanguageModelV4Usage, JSONObject, LanguageModelV4Prompt, LanguageModelV4CallOptions, ProviderV4, ProviderV3, ProviderV2, LanguageModelV4ToolChoice, LanguageModelV4FunctionTool, LanguageModelV4ProviderTool } from '@ai-sdk/provider';
|
|
4
2
|
import { GatewayModelId } from '@ai-sdk/gateway';
|
|
3
|
+
import { ProviderOptions, SystemModelMessage, ModelMessage, ToolSet, Arrayable, InferToolInput, InferToolOutput, AssistantModelMessage, ToolModelMessage, Context, InferToolSetContext, ReasoningPart, ReasoningFilePart, InferToolContext } from '@ai-sdk/provider-utils';
|
|
4
|
+
export { convertAsyncIteratorToReadableStream } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* This allows a ReadableStream to be consumed using for-await-of syntax.
|
|
9
|
-
*/
|
|
10
|
-
type AsyncIterableStream<T> = AsyncIterable<T> & ReadableStream<T>;
|
|
11
|
-
/**
|
|
12
|
-
* Wraps a ReadableStream and returns an object that is both a ReadableStream and an AsyncIterable.
|
|
13
|
-
* This enables consumption of the stream using for-await-of, with proper resource cleanup on early exit or error.
|
|
14
|
-
*
|
|
15
|
-
* @template T The type of the stream's chunks.
|
|
16
|
-
* @param source The source ReadableStream to wrap.
|
|
17
|
-
* @returns An AsyncIterableStream that can be used as both a ReadableStream and an AsyncIterable.
|
|
18
|
-
*/
|
|
19
|
-
declare function createAsyncIterableStream<T>(source: ReadableStream<T>): AsyncIterableStream<T>;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Experimental. Can change in patch versions without warning.
|
|
23
|
-
*
|
|
24
|
-
* Download function. Called with the array of URLs and a boolean indicating
|
|
25
|
-
* whether the URL is supported by the model.
|
|
26
|
-
*
|
|
27
|
-
* The download function can decide for each URL:
|
|
28
|
-
* - to return null (which means that the URL should be passed to the model)
|
|
29
|
-
* - to download the asset and return the data (incl. retries, authentication, etc.)
|
|
30
|
-
*
|
|
31
|
-
* Should throw DownloadError if the download fails.
|
|
32
|
-
*
|
|
33
|
-
* Should return an array of objects sorted by the order of the requested downloads.
|
|
34
|
-
* For each object, the data should be a Uint8Array if the URL was downloaded.
|
|
35
|
-
* For each object, the mediaType should be the media type of the downloaded asset.
|
|
36
|
-
* For each object, the data should be null if the URL should be passed through as is.
|
|
37
|
-
*/
|
|
38
|
-
type DownloadFunction = (options: Array<{
|
|
39
|
-
url: URL;
|
|
40
|
-
isUrlSupportedByModel: boolean;
|
|
41
|
-
}>) => PromiseLike<Array<{
|
|
42
|
-
data: Uint8Array;
|
|
43
|
-
mediaType: string | undefined;
|
|
44
|
-
} | null>>;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Prompt part of the AI function options.
|
|
48
|
-
* It contains a system message, a simple text prompt, or a list of messages.
|
|
49
|
-
*/
|
|
50
|
-
type Prompt = {
|
|
51
|
-
/**
|
|
52
|
-
* System message to include in the prompt. Can be used with `prompt` or `messages`.
|
|
53
|
-
*/
|
|
54
|
-
system?: string | SystemModelMessage | Array<SystemModelMessage>;
|
|
55
|
-
/**
|
|
56
|
-
* Whether system messages are allowed in the `prompt` or `messages` fields.
|
|
57
|
-
*
|
|
58
|
-
* When disabled, system messages must be provided through the `system` option.
|
|
59
|
-
*
|
|
60
|
-
* @default false
|
|
61
|
-
*/
|
|
62
|
-
allowSystemInMessages?: boolean;
|
|
63
|
-
} & ({
|
|
64
|
-
/**
|
|
65
|
-
* A prompt. It can be either a text prompt or a list of messages.
|
|
66
|
-
*
|
|
67
|
-
* You can either use `prompt` or `messages` but not both.
|
|
68
|
-
*/
|
|
69
|
-
prompt: string | Array<ModelMessage>;
|
|
70
|
-
/**
|
|
71
|
-
* A list of messages.
|
|
72
|
-
*
|
|
73
|
-
* You can either use `prompt` or `messages` but not both.
|
|
74
|
-
*/
|
|
75
|
-
messages?: never;
|
|
76
|
-
} | {
|
|
77
|
-
/**
|
|
78
|
-
* A list of messages.
|
|
79
|
-
*
|
|
80
|
-
* You can either use `prompt` or `messages` but not both.
|
|
81
|
-
*/
|
|
82
|
-
messages: Array<ModelMessage>;
|
|
83
|
-
/**
|
|
84
|
-
* A prompt. It can be either a text prompt or a list of messages.
|
|
85
|
-
*
|
|
86
|
-
* You can either use `prompt` or `messages` but not both.
|
|
87
|
-
*/
|
|
88
|
-
prompt?: never;
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
type StandardizedPrompt = {
|
|
92
|
-
/**
|
|
93
|
-
* System message.
|
|
94
|
-
*/
|
|
95
|
-
system?: string | SystemModelMessage | Array<SystemModelMessage>;
|
|
96
|
-
/**
|
|
97
|
-
* Messages.
|
|
98
|
-
*/
|
|
99
|
-
messages: ModelMessage[];
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Converts a prompt input into a standardized prompt with validated model
|
|
103
|
-
* messages.
|
|
104
|
-
*
|
|
105
|
-
* @param prompt - The prompt definition to standardize.
|
|
106
|
-
* Set `allowSystemInMessages` to true to allow system messages in the
|
|
107
|
-
* `prompt` or `messages` fields. System messages in the `system` option are
|
|
108
|
-
* always allowed.
|
|
109
|
-
* @returns The standardized prompt.
|
|
110
|
-
* @throws {InvalidPromptError} When the prompt is invalid.
|
|
7
|
+
* Embedding.
|
|
111
8
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
declare function convertToLanguageModelPrompt({ prompt, supportedUrls, download, provider, }: {
|
|
115
|
-
prompt: StandardizedPrompt;
|
|
116
|
-
supportedUrls: Record<string, RegExp[]>;
|
|
117
|
-
download: DownloadFunction | undefined;
|
|
118
|
-
provider?: string;
|
|
119
|
-
}): Promise<LanguageModelV4Prompt>;
|
|
9
|
+
type Embedding = EmbeddingModelV4Embedding;
|
|
120
10
|
|
|
121
11
|
declare global {
|
|
122
12
|
/**
|
|
@@ -196,100 +86,39 @@ type ToolChoice<TOOLS extends Record<string, unknown>> = 'auto' | 'none' | 'requ
|
|
|
196
86
|
toolName: Extract<keyof TOOLS, string>;
|
|
197
87
|
};
|
|
198
88
|
|
|
199
|
-
|
|
200
|
-
toolChoice: ToolChoice<any> | undefined;
|
|
201
|
-
}): LanguageModelV4ToolChoice;
|
|
202
|
-
|
|
203
|
-
declare function prepareTools<TOOLS extends ToolSet>({ tools, }: {
|
|
204
|
-
tools: TOOLS | undefined;
|
|
205
|
-
}): Promise<Array<LanguageModelV4FunctionTool | LanguageModelV4ProviderTool> | undefined>;
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Model-facing generation controls. These settings influence how the model
|
|
209
|
-
* generates its response (token limits, sampling, penalties, stop sequences,
|
|
210
|
-
* seed, reasoning).
|
|
211
|
-
*/
|
|
212
|
-
type LanguageModelCallOptions = {
|
|
213
|
-
/**
|
|
214
|
-
* Maximum number of tokens to generate.
|
|
215
|
-
*/
|
|
216
|
-
maxOutputTokens?: number;
|
|
217
|
-
/**
|
|
218
|
-
* Temperature setting. The range depends on the provider and model.
|
|
219
|
-
*
|
|
220
|
-
* It is recommended to set either `temperature` or `topP`, but not both.
|
|
221
|
-
*/
|
|
222
|
-
temperature?: number;
|
|
223
|
-
/**
|
|
224
|
-
* Nucleus sampling. This is a number between 0 and 1.
|
|
225
|
-
*
|
|
226
|
-
* E.g. 0.1 would mean that only tokens with the top 10% probability mass
|
|
227
|
-
* are considered.
|
|
228
|
-
*
|
|
229
|
-
* It is recommended to set either `temperature` or `topP`, but not both.
|
|
230
|
-
*/
|
|
231
|
-
topP?: number;
|
|
232
|
-
/**
|
|
233
|
-
* Only sample from the top K options for each subsequent token.
|
|
234
|
-
*
|
|
235
|
-
* Used to remove "long tail" low probability responses.
|
|
236
|
-
* Recommended for advanced use cases only. You usually only need to use temperature.
|
|
237
|
-
*/
|
|
238
|
-
topK?: number;
|
|
89
|
+
type LanguageModelRequestMetadata = {
|
|
239
90
|
/**
|
|
240
|
-
*
|
|
241
|
-
* repeat information that is already in the prompt.
|
|
242
|
-
*
|
|
243
|
-
* The presence penalty is a number between -1 (increase repetition)
|
|
244
|
-
* and 1 (maximum penalty, decrease repetition). 0 means no penalty.
|
|
91
|
+
* Request HTTP body that was sent to the provider API.
|
|
245
92
|
*/
|
|
246
|
-
|
|
93
|
+
body?: unknown;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
type LanguageModelResponseMetadata = {
|
|
247
97
|
/**
|
|
248
|
-
*
|
|
249
|
-
* to repeatedly use the same words or phrases.
|
|
250
|
-
*
|
|
251
|
-
* The frequency penalty is a number between -1 (increase repetition)
|
|
252
|
-
* and 1 (maximum penalty, decrease repetition). 0 means no penalty.
|
|
98
|
+
* ID for the generated response.
|
|
253
99
|
*/
|
|
254
|
-
|
|
100
|
+
id: string;
|
|
255
101
|
/**
|
|
256
|
-
*
|
|
257
|
-
* If set, the model will stop generating text when one of the stop sequences is generated.
|
|
258
|
-
* Providers may have limits on the number of stop sequences.
|
|
102
|
+
* Timestamp for the start of the generated response.
|
|
259
103
|
*/
|
|
260
|
-
|
|
104
|
+
timestamp: Date;
|
|
261
105
|
/**
|
|
262
|
-
* The
|
|
263
|
-
* by the model, calls will generate deterministic results.
|
|
106
|
+
* The ID of the response model that was used to generate the response.
|
|
264
107
|
*/
|
|
265
|
-
|
|
108
|
+
modelId: string;
|
|
266
109
|
/**
|
|
267
|
-
*
|
|
268
|
-
* the model performs before generating a response.
|
|
269
|
-
*
|
|
270
|
-
* Use `'provider-default'` to use the provider's default reasoning level.
|
|
271
|
-
* Use `'none'` to disable reasoning (if supported by the provider).
|
|
110
|
+
* Response headers (available only for providers that use HTTP requests).
|
|
272
111
|
*/
|
|
273
|
-
|
|
112
|
+
headers?: Record<string, string>;
|
|
274
113
|
};
|
|
275
114
|
|
|
276
115
|
/**
|
|
277
|
-
*
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
type RetryFunction = <OUTPUT>(fn: () => PromiseLike<OUTPUT>) => PromiseLike<OUTPUT>;
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Validate and prepare retries.
|
|
116
|
+
* Additional provider-specific metadata that is returned from the provider.
|
|
117
|
+
*
|
|
118
|
+
* This is needed to enable provider-specific functionality that can be
|
|
119
|
+
* fully encapsulated in the provider.
|
|
285
120
|
*/
|
|
286
|
-
|
|
287
|
-
maxRetries: number | undefined;
|
|
288
|
-
abortSignal: AbortSignal | undefined;
|
|
289
|
-
}): {
|
|
290
|
-
maxRetries: number;
|
|
291
|
-
retry: RetryFunction;
|
|
292
|
-
};
|
|
121
|
+
type ProviderMetadata = SharedV4ProviderMetadata;
|
|
293
122
|
|
|
294
123
|
/**
|
|
295
124
|
* Represents the number of tokens used in a prompt and completion.
|
|
@@ -351,87 +180,18 @@ type LanguageModelUsage = {
|
|
|
351
180
|
* This is the usage information in the shape that the provider returns.
|
|
352
181
|
* It can include additional information that is not part of the standard usage information.
|
|
353
182
|
*/
|
|
354
|
-
raw?: JSONObject;
|
|
355
|
-
};
|
|
356
|
-
/**
|
|
357
|
-
* Represents the number of tokens used in an embedding.
|
|
358
|
-
*/
|
|
359
|
-
type EmbeddingModelUsage = {
|
|
360
|
-
/**
|
|
361
|
-
* The number of tokens used in the embedding.
|
|
362
|
-
*/
|
|
363
|
-
tokens: number;
|
|
364
|
-
};
|
|
365
|
-
declare function asLanguageModelUsage(usage: LanguageModelV4Usage): LanguageModelUsage;
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* Embedding.
|
|
369
|
-
*/
|
|
370
|
-
type Embedding = EmbeddingModelV4Embedding;
|
|
371
|
-
|
|
372
|
-
declare function resolveLanguageModel(model: LanguageModel): LanguageModelV4;
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* Merges multiple abort sources into a single `AbortSignal`.
|
|
376
|
-
* The returned signal will abort when any input signal aborts or when any
|
|
377
|
-
* numeric timeout elapses, using the reason from the first source to abort.
|
|
378
|
-
*
|
|
379
|
-
* @param signals - Abort signals or timeout durations in milliseconds.
|
|
380
|
-
* `null` and `undefined` values are ignored.
|
|
381
|
-
* @returns An `AbortSignal` that aborts when any valid source aborts,
|
|
382
|
-
* or `undefined` if no valid sources are provided.
|
|
383
|
-
*/
|
|
384
|
-
declare function mergeAbortSignals(...signals: (AbortSignal | null | undefined | number)[]): AbortSignal | undefined;
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* A callback function that can be used with `notify`.
|
|
388
|
-
*/
|
|
389
|
-
type Callback<EVENT> = (event: EVENT) => PromiseLike<void> | void;
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Creates an async callback that invokes the provided callbacks in parallel.
|
|
393
|
-
* Undefined callbacks are skipped, and thrown or rejected callback errors are
|
|
394
|
-
* ignored.
|
|
395
|
-
*
|
|
396
|
-
* @param callbacks The callbacks to invoke for each event.
|
|
397
|
-
* @returns A callback that forwards each event to all callbacks and waits for
|
|
398
|
-
* them to settle.
|
|
399
|
-
*/
|
|
400
|
-
declare function mergeCallbacks<EVENT>(...callbacks: Array<Callback<EVENT> | undefined>): Callback<EVENT>;
|
|
401
|
-
|
|
402
|
-
type LanguageModelRequestMetadata = {
|
|
403
|
-
/**
|
|
404
|
-
* Request HTTP body that was sent to the provider API.
|
|
405
|
-
*/
|
|
406
|
-
body?: unknown;
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
type LanguageModelResponseMetadata = {
|
|
410
|
-
/**
|
|
411
|
-
* ID for the generated response.
|
|
412
|
-
*/
|
|
413
|
-
id: string;
|
|
414
|
-
/**
|
|
415
|
-
* Timestamp for the start of the generated response.
|
|
416
|
-
*/
|
|
417
|
-
timestamp: Date;
|
|
418
|
-
/**
|
|
419
|
-
* The ID of the response model that was used to generate the response.
|
|
420
|
-
*/
|
|
421
|
-
modelId: string;
|
|
422
|
-
/**
|
|
423
|
-
* Response headers (available only for providers that use HTTP requests).
|
|
424
|
-
*/
|
|
425
|
-
headers?: Record<string, string>;
|
|
183
|
+
raw?: JSONObject;
|
|
426
184
|
};
|
|
427
|
-
|
|
428
185
|
/**
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
* This is needed to enable provider-specific functionality that can be
|
|
432
|
-
* fully encapsulated in the provider.
|
|
186
|
+
* Represents the number of tokens used in an embedding.
|
|
433
187
|
*/
|
|
434
|
-
type
|
|
188
|
+
type EmbeddingModelUsage = {
|
|
189
|
+
/**
|
|
190
|
+
* The number of tokens used in the embedding.
|
|
191
|
+
*/
|
|
192
|
+
tokens: number;
|
|
193
|
+
};
|
|
194
|
+
declare function asLanguageModelUsage(usage: LanguageModelV4Usage): LanguageModelUsage;
|
|
435
195
|
|
|
436
196
|
/**
|
|
437
197
|
* Warning from the model provider for this call. The call will proceed, but e.g.
|
|
@@ -724,6 +484,75 @@ interface GenerateObjectEndEvent<RESULT> {
|
|
|
724
484
|
readonly providerMetadata: ProviderMetadata | undefined;
|
|
725
485
|
}
|
|
726
486
|
|
|
487
|
+
/**
|
|
488
|
+
* Model-facing generation controls. These settings influence how the model
|
|
489
|
+
* generates its response (token limits, sampling, penalties, stop sequences,
|
|
490
|
+
* seed, reasoning).
|
|
491
|
+
*/
|
|
492
|
+
type LanguageModelCallOptions = {
|
|
493
|
+
/**
|
|
494
|
+
* Maximum number of tokens to generate.
|
|
495
|
+
*/
|
|
496
|
+
maxOutputTokens?: number;
|
|
497
|
+
/**
|
|
498
|
+
* Temperature setting. The range depends on the provider and model.
|
|
499
|
+
*
|
|
500
|
+
* It is recommended to set either `temperature` or `topP`, but not both.
|
|
501
|
+
*/
|
|
502
|
+
temperature?: number;
|
|
503
|
+
/**
|
|
504
|
+
* Nucleus sampling. This is a number between 0 and 1.
|
|
505
|
+
*
|
|
506
|
+
* E.g. 0.1 would mean that only tokens with the top 10% probability mass
|
|
507
|
+
* are considered.
|
|
508
|
+
*
|
|
509
|
+
* It is recommended to set either `temperature` or `topP`, but not both.
|
|
510
|
+
*/
|
|
511
|
+
topP?: number;
|
|
512
|
+
/**
|
|
513
|
+
* Only sample from the top K options for each subsequent token.
|
|
514
|
+
*
|
|
515
|
+
* Used to remove "long tail" low probability responses.
|
|
516
|
+
* Recommended for advanced use cases only. You usually only need to use temperature.
|
|
517
|
+
*/
|
|
518
|
+
topK?: number;
|
|
519
|
+
/**
|
|
520
|
+
* Presence penalty setting. It affects the likelihood of the model to
|
|
521
|
+
* repeat information that is already in the prompt.
|
|
522
|
+
*
|
|
523
|
+
* The presence penalty is a number between -1 (increase repetition)
|
|
524
|
+
* and 1 (maximum penalty, decrease repetition). 0 means no penalty.
|
|
525
|
+
*/
|
|
526
|
+
presencePenalty?: number;
|
|
527
|
+
/**
|
|
528
|
+
* Frequency penalty setting. It affects the likelihood of the model
|
|
529
|
+
* to repeatedly use the same words or phrases.
|
|
530
|
+
*
|
|
531
|
+
* The frequency penalty is a number between -1 (increase repetition)
|
|
532
|
+
* and 1 (maximum penalty, decrease repetition). 0 means no penalty.
|
|
533
|
+
*/
|
|
534
|
+
frequencyPenalty?: number;
|
|
535
|
+
/**
|
|
536
|
+
* Stop sequences.
|
|
537
|
+
* If set, the model will stop generating text when one of the stop sequences is generated.
|
|
538
|
+
* Providers may have limits on the number of stop sequences.
|
|
539
|
+
*/
|
|
540
|
+
stopSequences?: string[];
|
|
541
|
+
/**
|
|
542
|
+
* The seed (integer) to use for random sampling. If set and supported
|
|
543
|
+
* by the model, calls will generate deterministic results.
|
|
544
|
+
*/
|
|
545
|
+
seed?: number;
|
|
546
|
+
/**
|
|
547
|
+
* Reasoning effort level for the model. Controls how much reasoning
|
|
548
|
+
* the model performs before generating a response.
|
|
549
|
+
*
|
|
550
|
+
* Use `'provider-default'` to use the provider's default reasoning level.
|
|
551
|
+
* Use `'none'` to disable reasoning (if supported by the provider).
|
|
552
|
+
*/
|
|
553
|
+
reasoning?: LanguageModelV4CallOptions['reasoning'];
|
|
554
|
+
};
|
|
555
|
+
|
|
727
556
|
/**
|
|
728
557
|
* Timeout configuration for API calls. Can be specified as:
|
|
729
558
|
* - A number representing milliseconds
|
|
@@ -741,6 +570,79 @@ type TimeoutConfiguration<TOOLS extends ToolSet> = number | {
|
|
|
741
570
|
tools?: Partial<Record<`${keyof TOOLS & string}Ms`, number>>;
|
|
742
571
|
};
|
|
743
572
|
|
|
573
|
+
/**
|
|
574
|
+
* Prompt part of the AI function options.
|
|
575
|
+
* It contains a system message, a simple text prompt, or a list of messages.
|
|
576
|
+
*/
|
|
577
|
+
type Prompt = {
|
|
578
|
+
/**
|
|
579
|
+
* System message to include in the prompt. Can be used with `prompt` or `messages`.
|
|
580
|
+
*/
|
|
581
|
+
system?: string | SystemModelMessage | Array<SystemModelMessage>;
|
|
582
|
+
/**
|
|
583
|
+
* Whether system messages are allowed in the `prompt` or `messages` fields.
|
|
584
|
+
*
|
|
585
|
+
* When disabled, system messages must be provided through the `system` option.
|
|
586
|
+
*
|
|
587
|
+
* @default false
|
|
588
|
+
*/
|
|
589
|
+
allowSystemInMessages?: boolean;
|
|
590
|
+
} & ({
|
|
591
|
+
/**
|
|
592
|
+
* A prompt. It can be either a text prompt or a list of messages.
|
|
593
|
+
*
|
|
594
|
+
* You can either use `prompt` or `messages` but not both.
|
|
595
|
+
*/
|
|
596
|
+
prompt: string | Array<ModelMessage>;
|
|
597
|
+
/**
|
|
598
|
+
* A list of messages.
|
|
599
|
+
*
|
|
600
|
+
* You can either use `prompt` or `messages` but not both.
|
|
601
|
+
*/
|
|
602
|
+
messages?: never;
|
|
603
|
+
} | {
|
|
604
|
+
/**
|
|
605
|
+
* A list of messages.
|
|
606
|
+
*
|
|
607
|
+
* You can either use `prompt` or `messages` but not both.
|
|
608
|
+
*/
|
|
609
|
+
messages: Array<ModelMessage>;
|
|
610
|
+
/**
|
|
611
|
+
* A prompt. It can be either a text prompt or a list of messages.
|
|
612
|
+
*
|
|
613
|
+
* You can either use `prompt` or `messages` but not both.
|
|
614
|
+
*/
|
|
615
|
+
prompt?: never;
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
type StandardizedPrompt = {
|
|
619
|
+
/**
|
|
620
|
+
* System message.
|
|
621
|
+
*/
|
|
622
|
+
system?: string | SystemModelMessage | Array<SystemModelMessage>;
|
|
623
|
+
/**
|
|
624
|
+
* Messages.
|
|
625
|
+
*/
|
|
626
|
+
messages: ModelMessage[];
|
|
627
|
+
};
|
|
628
|
+
/**
|
|
629
|
+
* Converts a prompt input into a standardized prompt with validated model
|
|
630
|
+
* messages.
|
|
631
|
+
*
|
|
632
|
+
* @param prompt - The prompt definition to standardize.
|
|
633
|
+
* Set `allowSystemInMessages` to true to allow system messages in the
|
|
634
|
+
* `prompt` or `messages` fields. System messages in the `system` option are
|
|
635
|
+
* always allowed.
|
|
636
|
+
* @returns The standardized prompt.
|
|
637
|
+
* @throws {InvalidPromptError} When the prompt is invalid.
|
|
638
|
+
*/
|
|
639
|
+
declare function standardizePrompt({ allowSystemInMessages, system, prompt, messages, }: Prompt): Promise<StandardizedPrompt>;
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* A callback function that can be used with `notify`.
|
|
643
|
+
*/
|
|
644
|
+
type Callback<EVENT> = (event: EVENT) => PromiseLike<void> | void;
|
|
645
|
+
|
|
744
646
|
/**
|
|
745
647
|
* Tool names that are enabled for a generation step.
|
|
746
648
|
*
|
|
@@ -786,6 +688,31 @@ type TelemetryOptions = {
|
|
|
786
688
|
integrations?: Arrayable<Telemetry>;
|
|
787
689
|
};
|
|
788
690
|
|
|
691
|
+
/**
|
|
692
|
+
* Experimental. Can change in patch versions without warning.
|
|
693
|
+
*
|
|
694
|
+
* Download function. Called with the array of URLs and a boolean indicating
|
|
695
|
+
* whether the URL is supported by the model.
|
|
696
|
+
*
|
|
697
|
+
* The download function can decide for each URL:
|
|
698
|
+
* - to return null (which means that the URL should be passed to the model)
|
|
699
|
+
* - to download the asset and return the data (incl. retries, authentication, etc.)
|
|
700
|
+
*
|
|
701
|
+
* Should throw DownloadError if the download fails.
|
|
702
|
+
*
|
|
703
|
+
* Should return an array of objects sorted by the order of the requested downloads.
|
|
704
|
+
* For each object, the data should be a Uint8Array if the URL was downloaded.
|
|
705
|
+
* For each object, the mediaType should be the media type of the downloaded asset.
|
|
706
|
+
* For each object, the data should be null if the URL should be passed through as is.
|
|
707
|
+
*/
|
|
708
|
+
type DownloadFunction = (options: Array<{
|
|
709
|
+
url: URL;
|
|
710
|
+
isUrlSupportedByModel: boolean;
|
|
711
|
+
}>) => PromiseLike<Array<{
|
|
712
|
+
data: Uint8Array;
|
|
713
|
+
mediaType: string | undefined;
|
|
714
|
+
} | null>>;
|
|
715
|
+
|
|
789
716
|
/**
|
|
790
717
|
* A generated file.
|
|
791
718
|
*/
|
|
@@ -1226,6 +1153,21 @@ type StepResult<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context
|
|
|
1226
1153
|
readonly providerMetadata: ProviderMetadata | undefined;
|
|
1227
1154
|
};
|
|
1228
1155
|
|
|
1156
|
+
/**
|
|
1157
|
+
* A type that combines AsyncIterable and ReadableStream.
|
|
1158
|
+
* This allows a ReadableStream to be consumed using for-await-of syntax.
|
|
1159
|
+
*/
|
|
1160
|
+
type AsyncIterableStream<T> = AsyncIterable<T> & ReadableStream<T>;
|
|
1161
|
+
/**
|
|
1162
|
+
* Wraps a ReadableStream and returns an object that is both a ReadableStream and an AsyncIterable.
|
|
1163
|
+
* This enables consumption of the stream using for-await-of, with proper resource cleanup on early exit or error.
|
|
1164
|
+
*
|
|
1165
|
+
* @template T The type of the stream's chunks.
|
|
1166
|
+
* @param source The source ReadableStream to wrap.
|
|
1167
|
+
* @returns An AsyncIterableStream that can be used as both a ReadableStream and an AsyncIterable.
|
|
1168
|
+
*/
|
|
1169
|
+
declare function createAsyncIterableStream<T>(source: ReadableStream<T>): AsyncIterableStream<T>;
|
|
1170
|
+
|
|
1229
1171
|
/**
|
|
1230
1172
|
* Tool output when the tool execution has been denied (for static tools).
|
|
1231
1173
|
*/
|
|
@@ -1887,4 +1829,62 @@ declare global {
|
|
|
1887
1829
|
var AI_SDK_TELEMETRY_INTEGRATIONS: Telemetry[] | undefined;
|
|
1888
1830
|
}
|
|
1889
1831
|
|
|
1832
|
+
declare function convertToLanguageModelPrompt({ prompt, supportedUrls, download, provider, }: {
|
|
1833
|
+
prompt: StandardizedPrompt;
|
|
1834
|
+
supportedUrls: Record<string, RegExp[]>;
|
|
1835
|
+
download: DownloadFunction | undefined;
|
|
1836
|
+
provider?: string;
|
|
1837
|
+
}): Promise<LanguageModelV4Prompt>;
|
|
1838
|
+
|
|
1839
|
+
declare function prepareToolChoice({ toolChoice, }: {
|
|
1840
|
+
toolChoice: ToolChoice<any> | undefined;
|
|
1841
|
+
}): LanguageModelV4ToolChoice;
|
|
1842
|
+
|
|
1843
|
+
declare function prepareTools<TOOLS extends ToolSet>({ tools, }: {
|
|
1844
|
+
tools: TOOLS | undefined;
|
|
1845
|
+
}): Promise<Array<LanguageModelV4FunctionTool | LanguageModelV4ProviderTool> | undefined>;
|
|
1846
|
+
|
|
1847
|
+
/**
|
|
1848
|
+
* Validates model call options and returns a new object with normalized values.
|
|
1849
|
+
*/
|
|
1850
|
+
declare function prepareLanguageModelCallOptions({ maxOutputTokens, temperature, topP, topK, presencePenalty, frequencyPenalty, seed, stopSequences, reasoning, }: LanguageModelCallOptions): LanguageModelCallOptions;
|
|
1851
|
+
|
|
1852
|
+
type RetryFunction = <OUTPUT>(fn: () => PromiseLike<OUTPUT>) => PromiseLike<OUTPUT>;
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* Validate and prepare retries.
|
|
1856
|
+
*/
|
|
1857
|
+
declare function prepareRetries({ maxRetries, abortSignal, }: {
|
|
1858
|
+
maxRetries: number | undefined;
|
|
1859
|
+
abortSignal: AbortSignal | undefined;
|
|
1860
|
+
}): {
|
|
1861
|
+
maxRetries: number;
|
|
1862
|
+
retry: RetryFunction;
|
|
1863
|
+
};
|
|
1864
|
+
|
|
1865
|
+
declare function resolveLanguageModel(model: LanguageModel): LanguageModelV4;
|
|
1866
|
+
|
|
1867
|
+
/**
|
|
1868
|
+
* Merges multiple abort sources into a single `AbortSignal`.
|
|
1869
|
+
* The returned signal will abort when any input signal aborts or when any
|
|
1870
|
+
* numeric timeout elapses, using the reason from the first source to abort.
|
|
1871
|
+
*
|
|
1872
|
+
* @param signals - Abort signals or timeout durations in milliseconds.
|
|
1873
|
+
* `null` and `undefined` values are ignored.
|
|
1874
|
+
* @returns An `AbortSignal` that aborts when any valid source aborts,
|
|
1875
|
+
* or `undefined` if no valid sources are provided.
|
|
1876
|
+
*/
|
|
1877
|
+
declare function mergeAbortSignals(...signals: (AbortSignal | null | undefined | number)[]): AbortSignal | undefined;
|
|
1878
|
+
|
|
1879
|
+
/**
|
|
1880
|
+
* Creates an async callback that invokes the provided callbacks in parallel.
|
|
1881
|
+
* Undefined callbacks are skipped, and thrown or rejected callback errors are
|
|
1882
|
+
* ignored.
|
|
1883
|
+
*
|
|
1884
|
+
* @param callbacks The callbacks to invoke for each event.
|
|
1885
|
+
* @returns A callback that forwards each event to all callbacks and waits for
|
|
1886
|
+
* them to settle.
|
|
1887
|
+
*/
|
|
1888
|
+
declare function mergeCallbacks<EVENT>(...callbacks: Array<Callback<EVENT> | undefined>): Callback<EVENT>;
|
|
1889
|
+
|
|
1890
1890
|
export { asLanguageModelUsage, convertToLanguageModelPrompt, createAsyncIterableStream, mergeAbortSignals, mergeCallbacks, prepareLanguageModelCallOptions as prepareCallSettings, prepareLanguageModelCallOptions, prepareRetries, prepareToolChoice, prepareTools, resolveLanguageModel, standardizePrompt };
|