ai 6.0.23 → 6.0.24
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 +6 -0
- package/dist/index.d.mts +3 -15
- package/dist/index.d.ts +3 -15
- package/dist/index.js +41 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +2 -0
- package/dist/internal/index.d.ts +2 -0
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -946,25 +946,13 @@ Timeout configuration for API calls. Can be specified as:
|
|
|
946
946
|
- A number representing milliseconds
|
|
947
947
|
- An object with `totalMs` property for the total timeout in milliseconds
|
|
948
948
|
- An object with `stepMs` property for the timeout of each step in milliseconds
|
|
949
|
+
- An object with `chunkMs` property for the timeout between stream chunks (streaming only)
|
|
949
950
|
*/
|
|
950
951
|
type TimeoutConfiguration = number | {
|
|
951
952
|
totalMs?: number;
|
|
952
953
|
stepMs?: number;
|
|
954
|
+
chunkMs?: number;
|
|
953
955
|
};
|
|
954
|
-
/**
|
|
955
|
-
Extracts the total timeout value in milliseconds from a TimeoutConfiguration.
|
|
956
|
-
|
|
957
|
-
@param timeout - The timeout configuration.
|
|
958
|
-
@returns The total timeout in milliseconds, or undefined if no timeout is configured.
|
|
959
|
-
*/
|
|
960
|
-
declare function getTotalTimeoutMs(timeout: TimeoutConfiguration | undefined): number | undefined;
|
|
961
|
-
/**
|
|
962
|
-
Extracts the step timeout value in milliseconds from a TimeoutConfiguration.
|
|
963
|
-
|
|
964
|
-
@param timeout - The timeout configuration.
|
|
965
|
-
@returns The step timeout in milliseconds, or undefined if no step timeout is configured.
|
|
966
|
-
*/
|
|
967
|
-
declare function getStepTimeoutMs(timeout: TimeoutConfiguration | undefined): number | undefined;
|
|
968
956
|
type CallSettings = {
|
|
969
957
|
/**
|
|
970
958
|
Maximum number of tokens to generate.
|
|
@@ -5560,4 +5548,4 @@ declare global {
|
|
|
5560
5548
|
var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
|
|
5561
5549
|
}
|
|
5562
5550
|
|
|
5563
|
-
export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName,
|
|
5551
|
+
export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -946,25 +946,13 @@ Timeout configuration for API calls. Can be specified as:
|
|
|
946
946
|
- A number representing milliseconds
|
|
947
947
|
- An object with `totalMs` property for the total timeout in milliseconds
|
|
948
948
|
- An object with `stepMs` property for the timeout of each step in milliseconds
|
|
949
|
+
- An object with `chunkMs` property for the timeout between stream chunks (streaming only)
|
|
949
950
|
*/
|
|
950
951
|
type TimeoutConfiguration = number | {
|
|
951
952
|
totalMs?: number;
|
|
952
953
|
stepMs?: number;
|
|
954
|
+
chunkMs?: number;
|
|
953
955
|
};
|
|
954
|
-
/**
|
|
955
|
-
Extracts the total timeout value in milliseconds from a TimeoutConfiguration.
|
|
956
|
-
|
|
957
|
-
@param timeout - The timeout configuration.
|
|
958
|
-
@returns The total timeout in milliseconds, or undefined if no timeout is configured.
|
|
959
|
-
*/
|
|
960
|
-
declare function getTotalTimeoutMs(timeout: TimeoutConfiguration | undefined): number | undefined;
|
|
961
|
-
/**
|
|
962
|
-
Extracts the step timeout value in milliseconds from a TimeoutConfiguration.
|
|
963
|
-
|
|
964
|
-
@param timeout - The timeout configuration.
|
|
965
|
-
@returns The step timeout in milliseconds, or undefined if no step timeout is configured.
|
|
966
|
-
*/
|
|
967
|
-
declare function getStepTimeoutMs(timeout: TimeoutConfiguration | undefined): number | undefined;
|
|
968
956
|
type CallSettings = {
|
|
969
957
|
/**
|
|
970
958
|
Maximum number of tokens to generate.
|
|
@@ -5560,4 +5548,4 @@ declare global {
|
|
|
5560
5548
|
var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
|
|
5561
5549
|
}
|
|
5562
5550
|
|
|
5563
|
-
export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName,
|
|
5551
|
+
export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };
|
package/dist/index.js
CHANGED
|
@@ -96,11 +96,9 @@ __export(src_exports, {
|
|
|
96
96
|
generateObject: () => generateObject,
|
|
97
97
|
generateText: () => generateText,
|
|
98
98
|
getStaticToolName: () => getStaticToolName,
|
|
99
|
-
getStepTimeoutMs: () => getStepTimeoutMs,
|
|
100
99
|
getTextFromDataUrl: () => getTextFromDataUrl,
|
|
101
100
|
getToolName: () => getToolName,
|
|
102
101
|
getToolOrDynamicToolName: () => getToolOrDynamicToolName,
|
|
103
|
-
getTotalTimeoutMs: () => getTotalTimeoutMs,
|
|
104
102
|
hasToolCall: () => hasToolCall,
|
|
105
103
|
isDataUIPart: () => isDataUIPart,
|
|
106
104
|
isDeepEqualData: () => isDeepEqualData,
|
|
@@ -826,6 +824,12 @@ function getStepTimeoutMs(timeout) {
|
|
|
826
824
|
}
|
|
827
825
|
return timeout.stepMs;
|
|
828
826
|
}
|
|
827
|
+
function getChunkTimeoutMs(timeout) {
|
|
828
|
+
if (timeout == null || typeof timeout === "number") {
|
|
829
|
+
return void 0;
|
|
830
|
+
}
|
|
831
|
+
return timeout.chunkMs;
|
|
832
|
+
}
|
|
829
833
|
|
|
830
834
|
// src/prompt/convert-to-language-model-prompt.ts
|
|
831
835
|
var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
@@ -1020,7 +1024,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
|
1020
1024
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
1021
1025
|
|
|
1022
1026
|
// src/version.ts
|
|
1023
|
-
var VERSION = true ? "6.0.
|
|
1027
|
+
var VERSION = true ? "6.0.24" : "0.0.0-test";
|
|
1024
1028
|
|
|
1025
1029
|
// src/util/download/download.ts
|
|
1026
1030
|
var download = async ({ url }) => {
|
|
@@ -5771,7 +5775,9 @@ function streamText({
|
|
|
5771
5775
|
}) {
|
|
5772
5776
|
const totalTimeoutMs = getTotalTimeoutMs(timeout);
|
|
5773
5777
|
const stepTimeoutMs = getStepTimeoutMs(timeout);
|
|
5778
|
+
const chunkTimeoutMs = getChunkTimeoutMs(timeout);
|
|
5774
5779
|
const stepAbortController = stepTimeoutMs != null ? new AbortController() : void 0;
|
|
5780
|
+
const chunkAbortController = chunkTimeoutMs != null ? new AbortController() : void 0;
|
|
5775
5781
|
return new DefaultStreamTextResult({
|
|
5776
5782
|
model: resolveLanguageModel(model),
|
|
5777
5783
|
telemetry,
|
|
@@ -5781,10 +5787,13 @@ function streamText({
|
|
|
5781
5787
|
abortSignal: mergeAbortSignals(
|
|
5782
5788
|
abortSignal,
|
|
5783
5789
|
totalTimeoutMs != null ? AbortSignal.timeout(totalTimeoutMs) : void 0,
|
|
5784
|
-
stepAbortController == null ? void 0 : stepAbortController.signal
|
|
5790
|
+
stepAbortController == null ? void 0 : stepAbortController.signal,
|
|
5791
|
+
chunkAbortController == null ? void 0 : chunkAbortController.signal
|
|
5785
5792
|
),
|
|
5786
5793
|
stepTimeoutMs,
|
|
5787
5794
|
stepAbortController,
|
|
5795
|
+
chunkTimeoutMs,
|
|
5796
|
+
chunkAbortController,
|
|
5788
5797
|
system,
|
|
5789
5798
|
prompt,
|
|
5790
5799
|
messages,
|
|
@@ -5881,6 +5890,8 @@ var DefaultStreamTextResult = class {
|
|
|
5881
5890
|
abortSignal,
|
|
5882
5891
|
stepTimeoutMs,
|
|
5883
5892
|
stepAbortController,
|
|
5893
|
+
chunkTimeoutMs,
|
|
5894
|
+
chunkAbortController,
|
|
5884
5895
|
system,
|
|
5885
5896
|
prompt,
|
|
5886
5897
|
messages,
|
|
@@ -6347,6 +6358,29 @@ var DefaultStreamTextResult = class {
|
|
|
6347
6358
|
var _a16, _b, _c, _d, _e, _f;
|
|
6348
6359
|
const includeRawChunks2 = self.includeRawChunks;
|
|
6349
6360
|
const stepTimeoutId = stepTimeoutMs != null ? setTimeout(() => stepAbortController.abort(), stepTimeoutMs) : void 0;
|
|
6361
|
+
let chunkTimeoutId = void 0;
|
|
6362
|
+
function resetChunkTimeout() {
|
|
6363
|
+
if (chunkTimeoutMs != null) {
|
|
6364
|
+
if (chunkTimeoutId != null) {
|
|
6365
|
+
clearTimeout(chunkTimeoutId);
|
|
6366
|
+
}
|
|
6367
|
+
chunkTimeoutId = setTimeout(
|
|
6368
|
+
() => chunkAbortController.abort(),
|
|
6369
|
+
chunkTimeoutMs
|
|
6370
|
+
);
|
|
6371
|
+
}
|
|
6372
|
+
}
|
|
6373
|
+
function clearChunkTimeout() {
|
|
6374
|
+
if (chunkTimeoutId != null) {
|
|
6375
|
+
clearTimeout(chunkTimeoutId);
|
|
6376
|
+
chunkTimeoutId = void 0;
|
|
6377
|
+
}
|
|
6378
|
+
}
|
|
6379
|
+
function clearStepTimeout() {
|
|
6380
|
+
if (stepTimeoutId != null) {
|
|
6381
|
+
clearTimeout(stepTimeoutId);
|
|
6382
|
+
}
|
|
6383
|
+
}
|
|
6350
6384
|
stepFinish = new import_provider_utils19.DelayedPromise();
|
|
6351
6385
|
const stepInputMessages = [...initialMessages, ...responseMessages];
|
|
6352
6386
|
const prepareStepResult = await (prepareStep == null ? void 0 : prepareStep({
|
|
@@ -6471,6 +6505,7 @@ var DefaultStreamTextResult = class {
|
|
|
6471
6505
|
new TransformStream({
|
|
6472
6506
|
async transform(chunk, controller) {
|
|
6473
6507
|
var _a17, _b2, _c2, _d2, _e2;
|
|
6508
|
+
resetChunkTimeout();
|
|
6474
6509
|
if (chunk.type === "stream-start") {
|
|
6475
6510
|
warnings = chunk.warnings;
|
|
6476
6511
|
return;
|
|
@@ -6701,9 +6736,8 @@ var DefaultStreamTextResult = class {
|
|
|
6701
6736
|
pendingDeferredToolCalls.delete(output2.toolCallId);
|
|
6702
6737
|
}
|
|
6703
6738
|
}
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
}
|
|
6739
|
+
clearStepTimeout();
|
|
6740
|
+
clearChunkTimeout();
|
|
6707
6741
|
if (
|
|
6708
6742
|
// Continue if:
|
|
6709
6743
|
// 1. There are client tool calls that have all been executed, OR
|
|
@@ -12154,11 +12188,9 @@ var TextStreamChatTransport = class extends HttpChatTransport {
|
|
|
12154
12188
|
generateObject,
|
|
12155
12189
|
generateText,
|
|
12156
12190
|
getStaticToolName,
|
|
12157
|
-
getStepTimeoutMs,
|
|
12158
12191
|
getTextFromDataUrl,
|
|
12159
12192
|
getToolName,
|
|
12160
12193
|
getToolOrDynamicToolName,
|
|
12161
|
-
getTotalTimeoutMs,
|
|
12162
12194
|
hasToolCall,
|
|
12163
12195
|
isDataUIPart,
|
|
12164
12196
|
isDeepEqualData,
|