ai 7.0.78 → 7.0.79
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.ts +8 -2
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +1 -1
- package/docs/02-foundations/02-providers-and-models.mdx +2 -2
- package/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx +4 -4
- package/package.json +7 -7
- package/src/batch/batch-types.ts +7 -0
- package/src/batch/batch.ts +2 -0
- package/src/generate-text/generate-text.ts +6 -2
- package/src/index.ts +7 -1
- package/src/ui/process-ui-message-stream.ts +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 7.0.79
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b251584: Preserve active text and reasoning parts when another merged UI message stream finishes a step, and align workflow stream normalization with the explicit part end chunks.
|
|
8
|
+
- 591d25b: feat: add batch completion webhooks. `experimental_startTextBatch` accepts a `webhookUrl`, and the gateway provider registers it through the batch `callbackUrl` contract and exports typed async-job metadata. Direct Anthropic and OpenAI batch providers return an unsupported warning when the option is provided.
|
|
9
|
+
- 9de0baf: Parse structured generateText output when providers omit finishReason but return text.
|
|
10
|
+
- Updated dependencies [591d25b]
|
|
11
|
+
- @ai-sdk/gateway@4.0.64
|
|
12
|
+
- @ai-sdk/provider@4.0.8
|
|
13
|
+
- @ai-sdk/provider-utils@5.0.30
|
|
14
|
+
|
|
3
15
|
## 7.0.78
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EmbeddingModelV4, EmbeddingModelV3, EmbeddingModelV2, EmbeddingModelV4Embedding, EmbeddingModelV4Middleware, ImageModelV4, ImageModelV3, ImageModelV2, ImageModelV4ProviderMetadata, ImageModelV2ProviderMetadata, ImageModelV4Middleware, JSONValue as JSONValue$1, LanguageModelV4, LanguageModelV3, LanguageModelV2, SharedV4Warning, LanguageModelV4Source, LanguageModelV4Middleware, RerankingModelV4, RerankingModelV3, SharedV4ProviderMetadata, SharedV4ProviderReference, SpeechModelV4, SpeechModelV3, SpeechModelV2, TranscriptionModelV4, TranscriptionModelV3, TranscriptionModelV2, JSONObject, ImageModelV4Usage, LanguageModelV4CallOptions, LanguageModelV4Prompt, AISDKError, LanguageModelV4ToolCall, JSONSchema7, ProviderV4, ProviderV3, ProviderV2, Experimental_BatchLanguageModelV4, Experimental_BatchV4Error, Experimental_BatchV4Status, Experimental_BatchV4StartResult, SharedV4Headers, JSONParseError, TypeValidationError, Experimental_VideoModelV4, Experimental_VideoModelV3, Experimental_VideoModelV4FrameType, Experimental_VideoModelV4OperationWebhook, Experimental_VideoModelV4OperationStatusResult, EmbeddingModelV4CallOptions, Experimental_RealtimeFactoryV4, Experimental_RealtimeFactoryV4GetTokenOptions, Experimental_RealtimeFactoryV4GetTokenResult, Experimental_RealtimeModelV4, Experimental_RealtimeModelV4ClientEvent, Experimental_RealtimeModelV4ServerEvent, Experimental_RealtimeModelV4SessionConfig, Experimental_RealtimeModelV4ToolDefinition, FilesV4, SkillsV4, NoSuchModelError, SharedV4AudioFormat, Experimental_SpeechTranslationModelV4, Experimental_SpeechTranslationModelV4Usage, FilesV4UploadFileCallOptions, SkillsV4UploadSkillResult, SkillsV4UploadSkillCallOptions, SkillsV4File } from '@ai-sdk/provider';
|
|
2
2
|
export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, JSONSchema7, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, NoSuchProviderReferenceError, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
|
|
3
3
|
import { GatewayModelId } from '@ai-sdk/gateway';
|
|
4
|
-
export { GatewayModelId, createGateway, gateway } from '@ai-sdk/gateway';
|
|
4
|
+
export { GatewayAsyncJobMetadata, GatewayModelId, GatewayProviderMetadata, createGateway, gateway } from '@ai-sdk/gateway';
|
|
5
5
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
6
6
|
import { ModelMessage, AssistantModelMessage, ToolModelMessage, ProviderOptions, ToolSet, SystemModelMessage, UserModelMessage, DataContent, FlexibleSchema, InferSchema, Context, Arrayable, InferToolSetContext, InferToolInput, InferToolOutput, ReasoningPart, ReasoningFilePart, Experimental_SandboxSession, Tool, ToolCall, IdGenerator, ToolExecutionOptions, MaybePromiseLike, InferToolContext, Experimental_ToolCallerTool, HasRequiredKey, TextPart, FilePart, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
|
|
7
7
|
export { AssistantContent, AssistantModelMessage, DataContent, DownloadError, Experimental_SandboxProcess, Experimental_SandboxSession, Experimental_ToolCallerTool, FilePart, FlexibleSchema, IdGenerator, ImagePart, InferSchema, InferToolInput, InferToolOutput, ModelMessage, Schema, SystemModelMessage, TextPart, Tool, ToolApprovalRequest, ToolApprovalResponse, ToolCallPart, ToolContent, ToolExecuteFunction, ToolExecutionOptions, ToolModelMessage, ToolResultPart, ToolSet, UserContent, UserModelMessage, asSchema, createIdGenerator, dynamicTool, experimental_toolCaller, generateId, jsonSchema, parseJsonEventStream, tool, zodSchema } from '@ai-sdk/provider-utils';
|
|
@@ -6163,6 +6163,12 @@ type StartTextBatchOptions = {
|
|
|
6163
6163
|
model: BatchLanguageModel;
|
|
6164
6164
|
requests: ReadonlyArray<TextBatchRequest>;
|
|
6165
6165
|
providerOptions?: ProviderOptions;
|
|
6166
|
+
/**
|
|
6167
|
+
* URL that the provider should notify when the batch reaches a terminal
|
|
6168
|
+
* state. Providers that do not support completion webhooks return an
|
|
6169
|
+
* unsupported warning.
|
|
6170
|
+
*/
|
|
6171
|
+
webhookUrl?: string;
|
|
6166
6172
|
} & BatchRequestOptions;
|
|
6167
6173
|
/**
|
|
6168
6174
|
* The acknowledged text batch and warnings produced while starting it.
|
|
@@ -6215,7 +6221,7 @@ type TextBatchItemResult = (TextBatchGenerationResult & {
|
|
|
6215
6221
|
/**
|
|
6216
6222
|
* Starts a durable text-generation batch.
|
|
6217
6223
|
*/
|
|
6218
|
-
declare function startTextBatch({ model: modelArg, requests, providerOptions, abortSignal, headers, timeout, }: StartTextBatchOptions): Promise<StartTextBatchResult>;
|
|
6224
|
+
declare function startTextBatch({ model: modelArg, requests, providerOptions, webhookUrl, abortSignal, headers, timeout, }: StartTextBatchOptions): Promise<StartTextBatchResult>;
|
|
6219
6225
|
/**
|
|
6220
6226
|
* Retrieves the latest normalized status for a durable batch.
|
|
6221
6227
|
*/
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,10 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
createGateway,
|
|
10
|
+
gateway as gateway2
|
|
11
|
+
} from "@ai-sdk/gateway";
|
|
9
12
|
import {
|
|
10
13
|
asSchema as asSchema8,
|
|
11
14
|
createIdGenerator as createIdGenerator9,
|
|
@@ -1143,7 +1146,7 @@ import {
|
|
|
1143
1146
|
} from "@ai-sdk/provider-utils";
|
|
1144
1147
|
|
|
1145
1148
|
// src/version.ts
|
|
1146
|
-
var VERSION = true ? "7.0.
|
|
1149
|
+
var VERSION = true ? "7.0.79" : "0.0.0-test";
|
|
1147
1150
|
|
|
1148
1151
|
// src/util/download/download.ts
|
|
1149
1152
|
var download = async ({
|
|
@@ -6080,7 +6083,7 @@ async function generateText({
|
|
|
6080
6083
|
callbacks: [onEnd, telemetryDispatcher.onEnd]
|
|
6081
6084
|
});
|
|
6082
6085
|
let resolvedOutput;
|
|
6083
|
-
if (lastStep.finishReason === "stop") {
|
|
6086
|
+
if (lastStep.finishReason === "stop" || lastStep.finishReason == null && lastStep.text.length > 0) {
|
|
6084
6087
|
const outputSpecification = output != null ? output : text();
|
|
6085
6088
|
resolvedOutput = await outputSpecification.parseCompleteOutput(
|
|
6086
6089
|
{ text: lastStep.text },
|
|
@@ -7393,8 +7396,6 @@ function processUIMessageStream({
|
|
|
7393
7396
|
break;
|
|
7394
7397
|
}
|
|
7395
7398
|
case "finish-step": {
|
|
7396
|
-
state.activeTextParts = createIdMap();
|
|
7397
|
-
state.activeReasoningParts = createIdMap();
|
|
7398
7399
|
break;
|
|
7399
7400
|
}
|
|
7400
7401
|
case "reset-step": {
|
|
@@ -11751,6 +11752,7 @@ async function startTextBatch({
|
|
|
11751
11752
|
model: modelArg,
|
|
11752
11753
|
requests,
|
|
11753
11754
|
providerOptions,
|
|
11755
|
+
webhookUrl,
|
|
11754
11756
|
abortSignal,
|
|
11755
11757
|
headers,
|
|
11756
11758
|
timeout
|
|
@@ -11790,7 +11792,8 @@ async function startTextBatch({
|
|
|
11790
11792
|
requests: normalizedRequests,
|
|
11791
11793
|
providerOptions,
|
|
11792
11794
|
abortSignal: operationAbortSignal,
|
|
11793
|
-
headers: headersWithUserAgent
|
|
11795
|
+
headers: headersWithUserAgent,
|
|
11796
|
+
...webhookUrl != null && { webhookUrl }
|
|
11794
11797
|
});
|
|
11795
11798
|
const { batchId, warnings, ...status } = result;
|
|
11796
11799
|
logWarnings({
|