ai 4.1.45 → 4.1.47
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 +18 -0
- package/README.md +2 -2
- package/dist/index.d.mts +135 -10
- package/dist/index.d.ts +135 -10
- package/dist/index.js +341 -162
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +319 -141
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/rsc/dist/index.d.ts +45 -1
- package/rsc/dist/rsc-server.d.mts +45 -1
- package/rsc/dist/rsc-server.mjs +65 -17
- package/rsc/dist/rsc-server.mjs.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# ai
|
2
2
|
|
3
|
+
## 4.1.47
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [da5c734]
|
8
|
+
- @ai-sdk/react@1.1.19
|
9
|
+
|
10
|
+
## 4.1.46
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- ddf9740: feat (ai): add anthropic reasoning
|
15
|
+
- Updated dependencies [ddf9740]
|
16
|
+
- @ai-sdk/provider@1.0.9
|
17
|
+
- @ai-sdk/ui-utils@1.1.16
|
18
|
+
- @ai-sdk/provider-utils@2.1.10
|
19
|
+
- @ai-sdk/react@1.1.18
|
20
|
+
|
3
21
|
## 4.1.45
|
4
22
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
@@ -53,7 +53,7 @@ The [AI SDK UI](https://sdk.vercel.ai/docs/ai-sdk-ui/overview) module provides a
|
|
53
53
|
import { useChat } from 'ai/react';
|
54
54
|
|
55
55
|
export default function Page() {
|
56
|
-
const { messages, input, handleSubmit, handleInputChange,
|
56
|
+
const { messages, input, handleSubmit, handleInputChange, status } =
|
57
57
|
useChat();
|
58
58
|
|
59
59
|
return (
|
@@ -70,7 +70,7 @@ export default function Page() {
|
|
70
70
|
value={input}
|
71
71
|
placeholder="Send a message..."
|
72
72
|
onChange={handleInputChange}
|
73
|
-
disabled={
|
73
|
+
disabled={status !== 'ready'}
|
74
74
|
/>
|
75
75
|
</form>
|
76
76
|
</div>
|
package/dist/index.d.mts
CHANGED
@@ -686,6 +686,50 @@ interface FilePart {
|
|
686
686
|
*/
|
687
687
|
experimental_providerMetadata?: ProviderMetadata;
|
688
688
|
}
|
689
|
+
/**
|
690
|
+
* Reasoning content part of a prompt. It contains a reasoning.
|
691
|
+
*/
|
692
|
+
interface ReasoningPart {
|
693
|
+
type: 'reasoning';
|
694
|
+
/**
|
695
|
+
The reasoning text.
|
696
|
+
*/
|
697
|
+
text: string;
|
698
|
+
/**
|
699
|
+
An optional signature for verifying that the reasoning originated from the model.
|
700
|
+
*/
|
701
|
+
signature?: string;
|
702
|
+
/**
|
703
|
+
Additional provider-specific metadata. They are passed through
|
704
|
+
to the provider from the AI SDK and enable provider-specific
|
705
|
+
functionality that can be fully encapsulated in the provider.
|
706
|
+
*/
|
707
|
+
providerOptions?: ProviderOptions;
|
708
|
+
/**
|
709
|
+
@deprecated Use `providerOptions` instead.
|
710
|
+
*/
|
711
|
+
experimental_providerMetadata?: ProviderMetadata;
|
712
|
+
}
|
713
|
+
/**
|
714
|
+
Redacted reasoning content part of a prompt.
|
715
|
+
*/
|
716
|
+
interface RedactedReasoningPart {
|
717
|
+
type: 'redacted-reasoning';
|
718
|
+
/**
|
719
|
+
Redacted reasoning data.
|
720
|
+
*/
|
721
|
+
data: string;
|
722
|
+
/**
|
723
|
+
Additional provider-specific metadata. They are passed through
|
724
|
+
to the provider from the AI SDK and enable provider-specific
|
725
|
+
functionality that can be fully encapsulated in the provider.
|
726
|
+
*/
|
727
|
+
providerOptions?: ProviderOptions;
|
728
|
+
/**
|
729
|
+
@deprecated Use `providerOptions` instead.
|
730
|
+
*/
|
731
|
+
experimental_providerMetadata?: ProviderMetadata;
|
732
|
+
}
|
689
733
|
/**
|
690
734
|
Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
|
691
735
|
*/
|
@@ -816,7 +860,7 @@ declare const coreAssistantMessageSchema: z.ZodType<CoreAssistantMessage>;
|
|
816
860
|
/**
|
817
861
|
Content of an assistant message. It can be a string or an array of text and tool call parts.
|
818
862
|
*/
|
819
|
-
type AssistantContent = string | Array<TextPart | ToolCallPart>;
|
863
|
+
type AssistantContent = string | Array<TextPart | ReasoningPart | RedactedReasoningPart | ToolCallPart>;
|
820
864
|
/**
|
821
865
|
A tool message. It contains the result of one or more tool calls.
|
822
866
|
*/
|
@@ -1529,6 +1573,15 @@ declare function appendClientMessage({ messages, message, }: {
|
|
1529
1573
|
message: Message;
|
1530
1574
|
}): Message[];
|
1531
1575
|
|
1576
|
+
type ReasoningDetail = {
|
1577
|
+
type: 'text';
|
1578
|
+
text: string;
|
1579
|
+
signature?: string;
|
1580
|
+
} | {
|
1581
|
+
type: 'redacted';
|
1582
|
+
data: string;
|
1583
|
+
};
|
1584
|
+
|
1532
1585
|
type Parameters = z.ZodTypeAny | Schema<any>;
|
1533
1586
|
type inferParameters<PARAMETERS extends Parameters> = PARAMETERS extends Schema<any> ? PARAMETERS['_type'] : PARAMETERS extends z.ZodTypeAny ? z.infer<PARAMETERS> : never;
|
1534
1587
|
interface ToolExecutionOptions {
|
@@ -1718,6 +1771,7 @@ type StepResult<TOOLS extends ToolSet> = {
|
|
1718
1771
|
The reasoning that was generated during the generation.
|
1719
1772
|
*/
|
1720
1773
|
readonly reasoning: string | undefined;
|
1774
|
+
readonly reasoningDetails: Array<ReasoningDetail>;
|
1721
1775
|
/**
|
1722
1776
|
The sources that were used to generate the text.
|
1723
1777
|
*/
|
@@ -1825,6 +1879,10 @@ interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT> {
|
|
1825
1879
|
*/
|
1826
1880
|
readonly reasoning: string | undefined;
|
1827
1881
|
/**
|
1882
|
+
The full reasoning that the model has generated.
|
1883
|
+
*/
|
1884
|
+
readonly reasoningDetails: Array<ReasoningDetail>;
|
1885
|
+
/**
|
1828
1886
|
Sources that have been used as input to generate the response.
|
1829
1887
|
For multi-step generation, the sources are accumulated from all steps.
|
1830
1888
|
*/
|
@@ -1933,9 +1991,9 @@ declare namespace output {
|
|
1933
1991
|
};
|
1934
1992
|
}
|
1935
1993
|
|
1936
|
-
declare const symbol$
|
1994
|
+
declare const symbol$e: unique symbol;
|
1937
1995
|
declare class InvalidToolArgumentsError extends AISDKError {
|
1938
|
-
private readonly [symbol$
|
1996
|
+
private readonly [symbol$e];
|
1939
1997
|
readonly toolName: string;
|
1940
1998
|
readonly toolArgs: string;
|
1941
1999
|
constructor({ toolArgs, toolName, cause, message, }: {
|
@@ -1947,9 +2005,9 @@ declare class InvalidToolArgumentsError extends AISDKError {
|
|
1947
2005
|
static isInstance(error: unknown): error is InvalidToolArgumentsError;
|
1948
2006
|
}
|
1949
2007
|
|
1950
|
-
declare const symbol$
|
2008
|
+
declare const symbol$d: unique symbol;
|
1951
2009
|
declare class NoSuchToolError extends AISDKError {
|
1952
|
-
private readonly [symbol$
|
2010
|
+
private readonly [symbol$d];
|
1953
2011
|
readonly toolName: string;
|
1954
2012
|
readonly availableTools: string[] | undefined;
|
1955
2013
|
constructor({ toolName, availableTools, message, }: {
|
@@ -2193,6 +2251,12 @@ interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT> {
|
|
2193
2251
|
*/
|
2194
2252
|
readonly reasoning: Promise<string | undefined>;
|
2195
2253
|
/**
|
2254
|
+
The full reasoning that the model has generated.
|
2255
|
+
|
2256
|
+
Resolved when the response is finished.
|
2257
|
+
*/
|
2258
|
+
readonly reasoningDetails: Promise<Array<ReasoningDetail>>;
|
2259
|
+
/**
|
2196
2260
|
The tool calls that have been executed in the last step.
|
2197
2261
|
|
2198
2262
|
Resolved when the response is finished.
|
@@ -2331,6 +2395,12 @@ type TextStreamPart<TOOLS extends ToolSet> = {
|
|
2331
2395
|
} | {
|
2332
2396
|
type: 'reasoning';
|
2333
2397
|
textDelta: string;
|
2398
|
+
} | {
|
2399
|
+
type: 'reasoning-signature';
|
2400
|
+
signature: string;
|
2401
|
+
} | {
|
2402
|
+
type: 'redacted-reasoning';
|
2403
|
+
data: string;
|
2334
2404
|
} | {
|
2335
2405
|
type: 'source';
|
2336
2406
|
source: Source;
|
@@ -2733,9 +2803,9 @@ declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageM
|
|
2733
2803
|
declare const experimental_customProvider: typeof customProvider;
|
2734
2804
|
type ExtractModelId<MODELS extends Record<string, unknown>> = Extract<keyof MODELS, string>;
|
2735
2805
|
|
2736
|
-
declare const symbol$
|
2806
|
+
declare const symbol$c: unique symbol;
|
2737
2807
|
declare class NoSuchProviderError extends NoSuchModelError {
|
2738
|
-
private readonly [symbol$
|
2808
|
+
private readonly [symbol$c];
|
2739
2809
|
readonly providerId: string;
|
2740
2810
|
readonly availableProviders: string[];
|
2741
2811
|
constructor({ modelId, modelType, providerId, availableProviders, message, }: {
|
@@ -2789,9 +2859,9 @@ declare function simulateReadableStream<T>({ chunks, initialDelayInMs, chunkDela
|
|
2789
2859
|
};
|
2790
2860
|
}): ReadableStream<T>;
|
2791
2861
|
|
2792
|
-
declare const symbol$
|
2862
|
+
declare const symbol$b: unique symbol;
|
2793
2863
|
declare class InvalidArgumentError extends AISDKError {
|
2794
|
-
private readonly [symbol$
|
2864
|
+
private readonly [symbol$b];
|
2795
2865
|
readonly parameter: string;
|
2796
2866
|
readonly value: unknown;
|
2797
2867
|
constructor({ parameter, value, message, }: {
|
@@ -2802,6 +2872,61 @@ declare class InvalidArgumentError extends AISDKError {
|
|
2802
2872
|
static isInstance(error: unknown): error is InvalidArgumentError;
|
2803
2873
|
}
|
2804
2874
|
|
2875
|
+
type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
|
2876
|
+
type: 'text-delta';
|
2877
|
+
textDelta: string;
|
2878
|
+
} | {
|
2879
|
+
type: 'reasoning';
|
2880
|
+
textDelta: string;
|
2881
|
+
} | {
|
2882
|
+
type: 'reasoning-signature';
|
2883
|
+
signature: string;
|
2884
|
+
} | {
|
2885
|
+
type: 'redacted-reasoning';
|
2886
|
+
data: string;
|
2887
|
+
} | {
|
2888
|
+
type: 'source';
|
2889
|
+
source: Source;
|
2890
|
+
} | ({
|
2891
|
+
type: 'tool-call';
|
2892
|
+
} & ToolCallUnion<TOOLS>) | {
|
2893
|
+
type: 'tool-call-streaming-start';
|
2894
|
+
toolCallId: string;
|
2895
|
+
toolName: string;
|
2896
|
+
} | {
|
2897
|
+
type: 'tool-call-delta';
|
2898
|
+
toolCallId: string;
|
2899
|
+
toolName: string;
|
2900
|
+
argsTextDelta: string;
|
2901
|
+
} | ({
|
2902
|
+
type: 'tool-result';
|
2903
|
+
} & ToolResultUnion<TOOLS>) | {
|
2904
|
+
type: 'response-metadata';
|
2905
|
+
id?: string;
|
2906
|
+
timestamp?: Date;
|
2907
|
+
modelId?: string;
|
2908
|
+
} | {
|
2909
|
+
type: 'finish';
|
2910
|
+
finishReason: FinishReason;
|
2911
|
+
logprobs?: LogProbs;
|
2912
|
+
usage: LanguageModelUsage;
|
2913
|
+
experimental_providerMetadata?: ProviderMetadata;
|
2914
|
+
} | {
|
2915
|
+
type: 'error';
|
2916
|
+
error: unknown;
|
2917
|
+
};
|
2918
|
+
|
2919
|
+
declare const symbol$a: unique symbol;
|
2920
|
+
declare class InvalidStreamPartError extends AISDKError {
|
2921
|
+
private readonly [symbol$a];
|
2922
|
+
readonly chunk: SingleRequestTextStreamPart<any>;
|
2923
|
+
constructor({ chunk, message, }: {
|
2924
|
+
chunk: SingleRequestTextStreamPart<any>;
|
2925
|
+
message: string;
|
2926
|
+
});
|
2927
|
+
static isInstance(error: unknown): error is InvalidStreamPartError;
|
2928
|
+
}
|
2929
|
+
|
2805
2930
|
declare const symbol$9: unique symbol;
|
2806
2931
|
/**
|
2807
2932
|
Thrown when no image could be generated. This can have multiple causes:
|
@@ -3097,4 +3222,4 @@ declare namespace llamaindexAdapter {
|
|
3097
3222
|
};
|
3098
3223
|
}
|
3099
3224
|
|
3100
|
-
export { AssistantContent, AssistantResponse, CallWarning, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreTool, CoreToolCallUnion, CoreToolChoice, CoreToolMessage, CoreToolResultUnion, CoreUserMessage, DataContent, DataStreamOptions, DataStreamWriter, DownloadError, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, GenerateImageResult as Experimental_GenerateImageResult, GeneratedImage as Experimental_GeneratedImage, Experimental_LanguageModelV1Middleware, FilePart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelResponseMetadata, ImagePart, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidToolArgumentsError, langchainAdapter as LangChainAdapter, LanguageModel, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LanguageModelV1Middleware, llamaindexAdapter as LlamaIndexAdapter, LogProbs, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, Provider, ProviderMetadata, RepairTextFunction, RetryError, StepResult, StreamData, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextPart, TextStreamPart, Tool, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolCallUnion, ToolChoice, ToolContent, ToolExecutionError, ToolExecutionOptions, ToolResultPart, ToolResultUnion, ToolSet, UserContent, appendClientMessage, appendResponseMessages, convertToCoreMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createDataStream, createDataStreamResponse, customProvider, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, experimental_wrapLanguageModel, extractReasoningMiddleware, generateObject, generateText, pipeDataStreamToResponse, simulateReadableStream, smoothStream, streamObject, streamText, tool, wrapLanguageModel };
|
3225
|
+
export { AssistantContent, AssistantResponse, CallWarning, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreTool, CoreToolCallUnion, CoreToolChoice, CoreToolMessage, CoreToolResultUnion, CoreUserMessage, DataContent, DataStreamOptions, DataStreamWriter, DownloadError, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, GenerateImageResult as Experimental_GenerateImageResult, GeneratedImage as Experimental_GeneratedImage, Experimental_LanguageModelV1Middleware, FilePart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelResponseMetadata, ImagePart, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolArgumentsError, langchainAdapter as LangChainAdapter, LanguageModel, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LanguageModelV1Middleware, llamaindexAdapter as LlamaIndexAdapter, LogProbs, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, Provider, ProviderMetadata, RepairTextFunction, RetryError, StepResult, StreamData, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextPart, TextStreamPart, Tool, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolCallUnion, ToolChoice, ToolContent, ToolExecutionError, ToolExecutionOptions, ToolResultPart, ToolResultUnion, ToolSet, UserContent, appendClientMessage, appendResponseMessages, convertToCoreMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createDataStream, createDataStreamResponse, customProvider, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, experimental_wrapLanguageModel, extractReasoningMiddleware, generateObject, generateText, pipeDataStreamToResponse, simulateReadableStream, smoothStream, streamObject, streamText, tool, wrapLanguageModel };
|
package/dist/index.d.ts
CHANGED
@@ -686,6 +686,50 @@ interface FilePart {
|
|
686
686
|
*/
|
687
687
|
experimental_providerMetadata?: ProviderMetadata;
|
688
688
|
}
|
689
|
+
/**
|
690
|
+
* Reasoning content part of a prompt. It contains a reasoning.
|
691
|
+
*/
|
692
|
+
interface ReasoningPart {
|
693
|
+
type: 'reasoning';
|
694
|
+
/**
|
695
|
+
The reasoning text.
|
696
|
+
*/
|
697
|
+
text: string;
|
698
|
+
/**
|
699
|
+
An optional signature for verifying that the reasoning originated from the model.
|
700
|
+
*/
|
701
|
+
signature?: string;
|
702
|
+
/**
|
703
|
+
Additional provider-specific metadata. They are passed through
|
704
|
+
to the provider from the AI SDK and enable provider-specific
|
705
|
+
functionality that can be fully encapsulated in the provider.
|
706
|
+
*/
|
707
|
+
providerOptions?: ProviderOptions;
|
708
|
+
/**
|
709
|
+
@deprecated Use `providerOptions` instead.
|
710
|
+
*/
|
711
|
+
experimental_providerMetadata?: ProviderMetadata;
|
712
|
+
}
|
713
|
+
/**
|
714
|
+
Redacted reasoning content part of a prompt.
|
715
|
+
*/
|
716
|
+
interface RedactedReasoningPart {
|
717
|
+
type: 'redacted-reasoning';
|
718
|
+
/**
|
719
|
+
Redacted reasoning data.
|
720
|
+
*/
|
721
|
+
data: string;
|
722
|
+
/**
|
723
|
+
Additional provider-specific metadata. They are passed through
|
724
|
+
to the provider from the AI SDK and enable provider-specific
|
725
|
+
functionality that can be fully encapsulated in the provider.
|
726
|
+
*/
|
727
|
+
providerOptions?: ProviderOptions;
|
728
|
+
/**
|
729
|
+
@deprecated Use `providerOptions` instead.
|
730
|
+
*/
|
731
|
+
experimental_providerMetadata?: ProviderMetadata;
|
732
|
+
}
|
689
733
|
/**
|
690
734
|
Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
|
691
735
|
*/
|
@@ -816,7 +860,7 @@ declare const coreAssistantMessageSchema: z.ZodType<CoreAssistantMessage>;
|
|
816
860
|
/**
|
817
861
|
Content of an assistant message. It can be a string or an array of text and tool call parts.
|
818
862
|
*/
|
819
|
-
type AssistantContent = string | Array<TextPart | ToolCallPart>;
|
863
|
+
type AssistantContent = string | Array<TextPart | ReasoningPart | RedactedReasoningPart | ToolCallPart>;
|
820
864
|
/**
|
821
865
|
A tool message. It contains the result of one or more tool calls.
|
822
866
|
*/
|
@@ -1529,6 +1573,15 @@ declare function appendClientMessage({ messages, message, }: {
|
|
1529
1573
|
message: Message;
|
1530
1574
|
}): Message[];
|
1531
1575
|
|
1576
|
+
type ReasoningDetail = {
|
1577
|
+
type: 'text';
|
1578
|
+
text: string;
|
1579
|
+
signature?: string;
|
1580
|
+
} | {
|
1581
|
+
type: 'redacted';
|
1582
|
+
data: string;
|
1583
|
+
};
|
1584
|
+
|
1532
1585
|
type Parameters = z.ZodTypeAny | Schema<any>;
|
1533
1586
|
type inferParameters<PARAMETERS extends Parameters> = PARAMETERS extends Schema<any> ? PARAMETERS['_type'] : PARAMETERS extends z.ZodTypeAny ? z.infer<PARAMETERS> : never;
|
1534
1587
|
interface ToolExecutionOptions {
|
@@ -1718,6 +1771,7 @@ type StepResult<TOOLS extends ToolSet> = {
|
|
1718
1771
|
The reasoning that was generated during the generation.
|
1719
1772
|
*/
|
1720
1773
|
readonly reasoning: string | undefined;
|
1774
|
+
readonly reasoningDetails: Array<ReasoningDetail>;
|
1721
1775
|
/**
|
1722
1776
|
The sources that were used to generate the text.
|
1723
1777
|
*/
|
@@ -1825,6 +1879,10 @@ interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT> {
|
|
1825
1879
|
*/
|
1826
1880
|
readonly reasoning: string | undefined;
|
1827
1881
|
/**
|
1882
|
+
The full reasoning that the model has generated.
|
1883
|
+
*/
|
1884
|
+
readonly reasoningDetails: Array<ReasoningDetail>;
|
1885
|
+
/**
|
1828
1886
|
Sources that have been used as input to generate the response.
|
1829
1887
|
For multi-step generation, the sources are accumulated from all steps.
|
1830
1888
|
*/
|
@@ -1933,9 +1991,9 @@ declare namespace output {
|
|
1933
1991
|
};
|
1934
1992
|
}
|
1935
1993
|
|
1936
|
-
declare const symbol$
|
1994
|
+
declare const symbol$e: unique symbol;
|
1937
1995
|
declare class InvalidToolArgumentsError extends AISDKError {
|
1938
|
-
private readonly [symbol$
|
1996
|
+
private readonly [symbol$e];
|
1939
1997
|
readonly toolName: string;
|
1940
1998
|
readonly toolArgs: string;
|
1941
1999
|
constructor({ toolArgs, toolName, cause, message, }: {
|
@@ -1947,9 +2005,9 @@ declare class InvalidToolArgumentsError extends AISDKError {
|
|
1947
2005
|
static isInstance(error: unknown): error is InvalidToolArgumentsError;
|
1948
2006
|
}
|
1949
2007
|
|
1950
|
-
declare const symbol$
|
2008
|
+
declare const symbol$d: unique symbol;
|
1951
2009
|
declare class NoSuchToolError extends AISDKError {
|
1952
|
-
private readonly [symbol$
|
2010
|
+
private readonly [symbol$d];
|
1953
2011
|
readonly toolName: string;
|
1954
2012
|
readonly availableTools: string[] | undefined;
|
1955
2013
|
constructor({ toolName, availableTools, message, }: {
|
@@ -2193,6 +2251,12 @@ interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT> {
|
|
2193
2251
|
*/
|
2194
2252
|
readonly reasoning: Promise<string | undefined>;
|
2195
2253
|
/**
|
2254
|
+
The full reasoning that the model has generated.
|
2255
|
+
|
2256
|
+
Resolved when the response is finished.
|
2257
|
+
*/
|
2258
|
+
readonly reasoningDetails: Promise<Array<ReasoningDetail>>;
|
2259
|
+
/**
|
2196
2260
|
The tool calls that have been executed in the last step.
|
2197
2261
|
|
2198
2262
|
Resolved when the response is finished.
|
@@ -2331,6 +2395,12 @@ type TextStreamPart<TOOLS extends ToolSet> = {
|
|
2331
2395
|
} | {
|
2332
2396
|
type: 'reasoning';
|
2333
2397
|
textDelta: string;
|
2398
|
+
} | {
|
2399
|
+
type: 'reasoning-signature';
|
2400
|
+
signature: string;
|
2401
|
+
} | {
|
2402
|
+
type: 'redacted-reasoning';
|
2403
|
+
data: string;
|
2334
2404
|
} | {
|
2335
2405
|
type: 'source';
|
2336
2406
|
source: Source;
|
@@ -2733,9 +2803,9 @@ declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageM
|
|
2733
2803
|
declare const experimental_customProvider: typeof customProvider;
|
2734
2804
|
type ExtractModelId<MODELS extends Record<string, unknown>> = Extract<keyof MODELS, string>;
|
2735
2805
|
|
2736
|
-
declare const symbol$
|
2806
|
+
declare const symbol$c: unique symbol;
|
2737
2807
|
declare class NoSuchProviderError extends NoSuchModelError {
|
2738
|
-
private readonly [symbol$
|
2808
|
+
private readonly [symbol$c];
|
2739
2809
|
readonly providerId: string;
|
2740
2810
|
readonly availableProviders: string[];
|
2741
2811
|
constructor({ modelId, modelType, providerId, availableProviders, message, }: {
|
@@ -2789,9 +2859,9 @@ declare function simulateReadableStream<T>({ chunks, initialDelayInMs, chunkDela
|
|
2789
2859
|
};
|
2790
2860
|
}): ReadableStream<T>;
|
2791
2861
|
|
2792
|
-
declare const symbol$
|
2862
|
+
declare const symbol$b: unique symbol;
|
2793
2863
|
declare class InvalidArgumentError extends AISDKError {
|
2794
|
-
private readonly [symbol$
|
2864
|
+
private readonly [symbol$b];
|
2795
2865
|
readonly parameter: string;
|
2796
2866
|
readonly value: unknown;
|
2797
2867
|
constructor({ parameter, value, message, }: {
|
@@ -2802,6 +2872,61 @@ declare class InvalidArgumentError extends AISDKError {
|
|
2802
2872
|
static isInstance(error: unknown): error is InvalidArgumentError;
|
2803
2873
|
}
|
2804
2874
|
|
2875
|
+
type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
|
2876
|
+
type: 'text-delta';
|
2877
|
+
textDelta: string;
|
2878
|
+
} | {
|
2879
|
+
type: 'reasoning';
|
2880
|
+
textDelta: string;
|
2881
|
+
} | {
|
2882
|
+
type: 'reasoning-signature';
|
2883
|
+
signature: string;
|
2884
|
+
} | {
|
2885
|
+
type: 'redacted-reasoning';
|
2886
|
+
data: string;
|
2887
|
+
} | {
|
2888
|
+
type: 'source';
|
2889
|
+
source: Source;
|
2890
|
+
} | ({
|
2891
|
+
type: 'tool-call';
|
2892
|
+
} & ToolCallUnion<TOOLS>) | {
|
2893
|
+
type: 'tool-call-streaming-start';
|
2894
|
+
toolCallId: string;
|
2895
|
+
toolName: string;
|
2896
|
+
} | {
|
2897
|
+
type: 'tool-call-delta';
|
2898
|
+
toolCallId: string;
|
2899
|
+
toolName: string;
|
2900
|
+
argsTextDelta: string;
|
2901
|
+
} | ({
|
2902
|
+
type: 'tool-result';
|
2903
|
+
} & ToolResultUnion<TOOLS>) | {
|
2904
|
+
type: 'response-metadata';
|
2905
|
+
id?: string;
|
2906
|
+
timestamp?: Date;
|
2907
|
+
modelId?: string;
|
2908
|
+
} | {
|
2909
|
+
type: 'finish';
|
2910
|
+
finishReason: FinishReason;
|
2911
|
+
logprobs?: LogProbs;
|
2912
|
+
usage: LanguageModelUsage;
|
2913
|
+
experimental_providerMetadata?: ProviderMetadata;
|
2914
|
+
} | {
|
2915
|
+
type: 'error';
|
2916
|
+
error: unknown;
|
2917
|
+
};
|
2918
|
+
|
2919
|
+
declare const symbol$a: unique symbol;
|
2920
|
+
declare class InvalidStreamPartError extends AISDKError {
|
2921
|
+
private readonly [symbol$a];
|
2922
|
+
readonly chunk: SingleRequestTextStreamPart<any>;
|
2923
|
+
constructor({ chunk, message, }: {
|
2924
|
+
chunk: SingleRequestTextStreamPart<any>;
|
2925
|
+
message: string;
|
2926
|
+
});
|
2927
|
+
static isInstance(error: unknown): error is InvalidStreamPartError;
|
2928
|
+
}
|
2929
|
+
|
2805
2930
|
declare const symbol$9: unique symbol;
|
2806
2931
|
/**
|
2807
2932
|
Thrown when no image could be generated. This can have multiple causes:
|
@@ -3097,4 +3222,4 @@ declare namespace llamaindexAdapter {
|
|
3097
3222
|
};
|
3098
3223
|
}
|
3099
3224
|
|
3100
|
-
export { AssistantContent, AssistantResponse, CallWarning, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreTool, CoreToolCallUnion, CoreToolChoice, CoreToolMessage, CoreToolResultUnion, CoreUserMessage, DataContent, DataStreamOptions, DataStreamWriter, DownloadError, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, GenerateImageResult as Experimental_GenerateImageResult, GeneratedImage as Experimental_GeneratedImage, Experimental_LanguageModelV1Middleware, FilePart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelResponseMetadata, ImagePart, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidToolArgumentsError, langchainAdapter as LangChainAdapter, LanguageModel, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LanguageModelV1Middleware, llamaindexAdapter as LlamaIndexAdapter, LogProbs, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, Provider, ProviderMetadata, RepairTextFunction, RetryError, StepResult, StreamData, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextPart, TextStreamPart, Tool, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolCallUnion, ToolChoice, ToolContent, ToolExecutionError, ToolExecutionOptions, ToolResultPart, ToolResultUnion, ToolSet, UserContent, appendClientMessage, appendResponseMessages, convertToCoreMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createDataStream, createDataStreamResponse, customProvider, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, experimental_wrapLanguageModel, extractReasoningMiddleware, generateObject, generateText, pipeDataStreamToResponse, simulateReadableStream, smoothStream, streamObject, streamText, tool, wrapLanguageModel };
|
3225
|
+
export { AssistantContent, AssistantResponse, CallWarning, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreTool, CoreToolCallUnion, CoreToolChoice, CoreToolMessage, CoreToolResultUnion, CoreUserMessage, DataContent, DataStreamOptions, DataStreamWriter, DownloadError, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, GenerateImageResult as Experimental_GenerateImageResult, GeneratedImage as Experimental_GeneratedImage, Experimental_LanguageModelV1Middleware, FilePart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelResponseMetadata, ImagePart, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolArgumentsError, langchainAdapter as LangChainAdapter, LanguageModel, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LanguageModelV1Middleware, llamaindexAdapter as LlamaIndexAdapter, LogProbs, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, Provider, ProviderMetadata, RepairTextFunction, RetryError, StepResult, StreamData, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextPart, TextStreamPart, Tool, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolCallUnion, ToolChoice, ToolContent, ToolExecutionError, ToolExecutionOptions, ToolResultPart, ToolResultUnion, ToolSet, UserContent, appendClientMessage, appendResponseMessages, convertToCoreMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createDataStream, createDataStreamResponse, customProvider, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, experimental_wrapLanguageModel, extractReasoningMiddleware, generateObject, generateText, pipeDataStreamToResponse, simulateReadableStream, smoothStream, streamObject, streamText, tool, wrapLanguageModel };
|