ai 3.3.31 → 3.3.32
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 +56 -2
- package/dist/index.d.ts +56 -2
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/rsc/dist/index.d.ts +7 -1
- package/rsc/dist/rsc-server.d.mts +7 -1
- package/rsc/dist/rsc-server.mjs +2 -0
- package/rsc/dist/rsc-server.mjs.map +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
@@ -706,6 +706,12 @@ Optional telemetry configuration (experimental).
|
|
706
706
|
*/
|
707
707
|
experimental_telemetry?: TelemetrySettings;
|
708
708
|
/**
|
709
|
+
Additional provider-specific metadata. They are passed through
|
710
|
+
to the provider from the AI SDK and enable provider-specific
|
711
|
+
functionality that can be fully encapsulated in the provider.
|
712
|
+
*/
|
713
|
+
experimental_providerMetadata?: ProviderMetadata;
|
714
|
+
/**
|
709
715
|
* Internal. For test use only. May change without notice.
|
710
716
|
*/
|
711
717
|
_internal?: {
|
@@ -762,6 +768,12 @@ Optional telemetry configuration (experimental).
|
|
762
768
|
*/
|
763
769
|
experimental_telemetry?: TelemetrySettings;
|
764
770
|
/**
|
771
|
+
Additional provider-specific metadata. They are passed through
|
772
|
+
to the provider from the AI SDK and enable provider-specific
|
773
|
+
functionality that can be fully encapsulated in the provider.
|
774
|
+
*/
|
775
|
+
experimental_providerMetadata?: ProviderMetadata;
|
776
|
+
/**
|
765
777
|
* Internal. For test use only. May change without notice.
|
766
778
|
*/
|
767
779
|
_internal?: {
|
@@ -806,6 +818,12 @@ Optional telemetry configuration (experimental).
|
|
806
818
|
*/
|
807
819
|
experimental_telemetry?: TelemetrySettings;
|
808
820
|
/**
|
821
|
+
Additional provider-specific metadata. They are passed through
|
822
|
+
to the provider from the AI SDK and enable provider-specific
|
823
|
+
functionality that can be fully encapsulated in the provider.
|
824
|
+
*/
|
825
|
+
experimental_providerMetadata?: ProviderMetadata;
|
826
|
+
/**
|
809
827
|
* Internal. For test use only. May change without notice.
|
810
828
|
*/
|
811
829
|
_internal?: {
|
@@ -836,6 +854,12 @@ Optional telemetry configuration (experimental).
|
|
836
854
|
*/
|
837
855
|
experimental_telemetry?: TelemetrySettings;
|
838
856
|
/**
|
857
|
+
Additional provider-specific metadata. They are passed through
|
858
|
+
to the provider from the AI SDK and enable provider-specific
|
859
|
+
functionality that can be fully encapsulated in the provider.
|
860
|
+
*/
|
861
|
+
experimental_providerMetadata?: ProviderMetadata;
|
862
|
+
/**
|
839
863
|
* Internal. For test use only. May change without notice.
|
840
864
|
*/
|
841
865
|
_internal?: {
|
@@ -1033,6 +1057,12 @@ Optional telemetry configuration (experimental).
|
|
1033
1057
|
*/
|
1034
1058
|
experimental_telemetry?: TelemetrySettings;
|
1035
1059
|
/**
|
1060
|
+
Additional provider-specific metadata. They are passed through
|
1061
|
+
to the provider from the AI SDK and enable provider-specific
|
1062
|
+
functionality that can be fully encapsulated in the provider.
|
1063
|
+
*/
|
1064
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1065
|
+
/**
|
1036
1066
|
Callback that is called when the LLM response and the final object validation are finished.
|
1037
1067
|
*/
|
1038
1068
|
onFinish?: OnFinishCallback<OBJECT>;
|
@@ -1094,6 +1124,12 @@ Optional telemetry configuration (experimental).
|
|
1094
1124
|
*/
|
1095
1125
|
experimental_telemetry?: TelemetrySettings;
|
1096
1126
|
/**
|
1127
|
+
Additional provider-specific metadata. They are passed through
|
1128
|
+
to the provider from the AI SDK and enable provider-specific
|
1129
|
+
functionality that can be fully encapsulated in the provider.
|
1130
|
+
*/
|
1131
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1132
|
+
/**
|
1097
1133
|
Callback that is called when the LLM response and the final object validation are finished.
|
1098
1134
|
*/
|
1099
1135
|
onFinish?: OnFinishCallback<Array<ELEMENT>>;
|
@@ -1129,6 +1165,12 @@ Optional telemetry configuration (experimental).
|
|
1129
1165
|
*/
|
1130
1166
|
experimental_telemetry?: TelemetrySettings;
|
1131
1167
|
/**
|
1168
|
+
Additional provider-specific metadata. They are passed through
|
1169
|
+
to the provider from the AI SDK and enable provider-specific
|
1170
|
+
functionality that can be fully encapsulated in the provider.
|
1171
|
+
*/
|
1172
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1173
|
+
/**
|
1132
1174
|
Callback that is called when the LLM response and the final object validation are finished.
|
1133
1175
|
*/
|
1134
1176
|
onFinish?: OnFinishCallback<JSONValue>;
|
@@ -1434,7 +1476,7 @@ If set and supported by the model, calls will generate deterministic results.
|
|
1434
1476
|
@returns
|
1435
1477
|
A result object that contains the generated text, the results of the tool calls, and additional information.
|
1436
1478
|
*/
|
1437
|
-
declare function generateText<TOOLS extends Record<string, CoreTool>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, headers, maxAutomaticRoundtrips, maxToolRoundtrips, experimental_telemetry: telemetry, _internal: { generateId, currentDate, }, ...settings }: CallSettings & Prompt & {
|
1479
|
+
declare function generateText<TOOLS extends Record<string, CoreTool>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, headers, maxAutomaticRoundtrips, maxToolRoundtrips, experimental_telemetry: telemetry, experimental_providerMetadata: providerMetadata, _internal: { generateId, currentDate, }, ...settings }: CallSettings & Prompt & {
|
1438
1480
|
/**
|
1439
1481
|
The language model to use.
|
1440
1482
|
*/
|
@@ -1469,6 +1511,12 @@ By default, it's set to 0, which will disable the feature.
|
|
1469
1511
|
*/
|
1470
1512
|
experimental_telemetry?: TelemetrySettings;
|
1471
1513
|
/**
|
1514
|
+
Additional provider-specific metadata. They are passed through
|
1515
|
+
to the provider from the AI SDK and enable provider-specific
|
1516
|
+
functionality that can be fully encapsulated in the provider.
|
1517
|
+
*/
|
1518
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1519
|
+
/**
|
1472
1520
|
* Internal. For test use only. May change without notice.
|
1473
1521
|
*/
|
1474
1522
|
_internal?: {
|
@@ -1732,7 +1780,7 @@ If set and supported by the model, calls will generate deterministic results.
|
|
1732
1780
|
@return
|
1733
1781
|
A result object for accessing different stream types and additional information.
|
1734
1782
|
*/
|
1735
|
-
declare function streamText<TOOLS extends Record<string, CoreTool>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, headers, maxToolRoundtrips, experimental_telemetry: telemetry, experimental_toolCallStreaming: toolCallStreaming, onChunk, onFinish, _internal: { now, generateId, currentDate, }, ...settings }: CallSettings & Prompt & {
|
1783
|
+
declare function streamText<TOOLS extends Record<string, CoreTool>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, headers, maxToolRoundtrips, experimental_telemetry: telemetry, experimental_providerMetadata: providerMetadata, experimental_toolCallStreaming: toolCallStreaming, onChunk, onFinish, _internal: { now, generateId, currentDate, }, ...settings }: CallSettings & Prompt & {
|
1736
1784
|
/**
|
1737
1785
|
The language model to use.
|
1738
1786
|
*/
|
@@ -1763,6 +1811,12 @@ Optional telemetry configuration (experimental).
|
|
1763
1811
|
*/
|
1764
1812
|
experimental_telemetry?: TelemetrySettings;
|
1765
1813
|
/**
|
1814
|
+
Additional provider-specific metadata. They are passed through
|
1815
|
+
to the provider from the AI SDK and enable provider-specific
|
1816
|
+
functionality that can be fully encapsulated in the provider.
|
1817
|
+
*/
|
1818
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1819
|
+
/**
|
1766
1820
|
Enable streaming of tool call deltas as they are generated. Disabled by default.
|
1767
1821
|
*/
|
1768
1822
|
experimental_toolCallStreaming?: boolean;
|
package/dist/index.d.ts
CHANGED
@@ -706,6 +706,12 @@ Optional telemetry configuration (experimental).
|
|
706
706
|
*/
|
707
707
|
experimental_telemetry?: TelemetrySettings;
|
708
708
|
/**
|
709
|
+
Additional provider-specific metadata. They are passed through
|
710
|
+
to the provider from the AI SDK and enable provider-specific
|
711
|
+
functionality that can be fully encapsulated in the provider.
|
712
|
+
*/
|
713
|
+
experimental_providerMetadata?: ProviderMetadata;
|
714
|
+
/**
|
709
715
|
* Internal. For test use only. May change without notice.
|
710
716
|
*/
|
711
717
|
_internal?: {
|
@@ -762,6 +768,12 @@ Optional telemetry configuration (experimental).
|
|
762
768
|
*/
|
763
769
|
experimental_telemetry?: TelemetrySettings;
|
764
770
|
/**
|
771
|
+
Additional provider-specific metadata. They are passed through
|
772
|
+
to the provider from the AI SDK and enable provider-specific
|
773
|
+
functionality that can be fully encapsulated in the provider.
|
774
|
+
*/
|
775
|
+
experimental_providerMetadata?: ProviderMetadata;
|
776
|
+
/**
|
765
777
|
* Internal. For test use only. May change without notice.
|
766
778
|
*/
|
767
779
|
_internal?: {
|
@@ -806,6 +818,12 @@ Optional telemetry configuration (experimental).
|
|
806
818
|
*/
|
807
819
|
experimental_telemetry?: TelemetrySettings;
|
808
820
|
/**
|
821
|
+
Additional provider-specific metadata. They are passed through
|
822
|
+
to the provider from the AI SDK and enable provider-specific
|
823
|
+
functionality that can be fully encapsulated in the provider.
|
824
|
+
*/
|
825
|
+
experimental_providerMetadata?: ProviderMetadata;
|
826
|
+
/**
|
809
827
|
* Internal. For test use only. May change without notice.
|
810
828
|
*/
|
811
829
|
_internal?: {
|
@@ -836,6 +854,12 @@ Optional telemetry configuration (experimental).
|
|
836
854
|
*/
|
837
855
|
experimental_telemetry?: TelemetrySettings;
|
838
856
|
/**
|
857
|
+
Additional provider-specific metadata. They are passed through
|
858
|
+
to the provider from the AI SDK and enable provider-specific
|
859
|
+
functionality that can be fully encapsulated in the provider.
|
860
|
+
*/
|
861
|
+
experimental_providerMetadata?: ProviderMetadata;
|
862
|
+
/**
|
839
863
|
* Internal. For test use only. May change without notice.
|
840
864
|
*/
|
841
865
|
_internal?: {
|
@@ -1033,6 +1057,12 @@ Optional telemetry configuration (experimental).
|
|
1033
1057
|
*/
|
1034
1058
|
experimental_telemetry?: TelemetrySettings;
|
1035
1059
|
/**
|
1060
|
+
Additional provider-specific metadata. They are passed through
|
1061
|
+
to the provider from the AI SDK and enable provider-specific
|
1062
|
+
functionality that can be fully encapsulated in the provider.
|
1063
|
+
*/
|
1064
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1065
|
+
/**
|
1036
1066
|
Callback that is called when the LLM response and the final object validation are finished.
|
1037
1067
|
*/
|
1038
1068
|
onFinish?: OnFinishCallback<OBJECT>;
|
@@ -1094,6 +1124,12 @@ Optional telemetry configuration (experimental).
|
|
1094
1124
|
*/
|
1095
1125
|
experimental_telemetry?: TelemetrySettings;
|
1096
1126
|
/**
|
1127
|
+
Additional provider-specific metadata. They are passed through
|
1128
|
+
to the provider from the AI SDK and enable provider-specific
|
1129
|
+
functionality that can be fully encapsulated in the provider.
|
1130
|
+
*/
|
1131
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1132
|
+
/**
|
1097
1133
|
Callback that is called when the LLM response and the final object validation are finished.
|
1098
1134
|
*/
|
1099
1135
|
onFinish?: OnFinishCallback<Array<ELEMENT>>;
|
@@ -1129,6 +1165,12 @@ Optional telemetry configuration (experimental).
|
|
1129
1165
|
*/
|
1130
1166
|
experimental_telemetry?: TelemetrySettings;
|
1131
1167
|
/**
|
1168
|
+
Additional provider-specific metadata. They are passed through
|
1169
|
+
to the provider from the AI SDK and enable provider-specific
|
1170
|
+
functionality that can be fully encapsulated in the provider.
|
1171
|
+
*/
|
1172
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1173
|
+
/**
|
1132
1174
|
Callback that is called when the LLM response and the final object validation are finished.
|
1133
1175
|
*/
|
1134
1176
|
onFinish?: OnFinishCallback<JSONValue>;
|
@@ -1434,7 +1476,7 @@ If set and supported by the model, calls will generate deterministic results.
|
|
1434
1476
|
@returns
|
1435
1477
|
A result object that contains the generated text, the results of the tool calls, and additional information.
|
1436
1478
|
*/
|
1437
|
-
declare function generateText<TOOLS extends Record<string, CoreTool>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, headers, maxAutomaticRoundtrips, maxToolRoundtrips, experimental_telemetry: telemetry, _internal: { generateId, currentDate, }, ...settings }: CallSettings & Prompt & {
|
1479
|
+
declare function generateText<TOOLS extends Record<string, CoreTool>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, headers, maxAutomaticRoundtrips, maxToolRoundtrips, experimental_telemetry: telemetry, experimental_providerMetadata: providerMetadata, _internal: { generateId, currentDate, }, ...settings }: CallSettings & Prompt & {
|
1438
1480
|
/**
|
1439
1481
|
The language model to use.
|
1440
1482
|
*/
|
@@ -1469,6 +1511,12 @@ By default, it's set to 0, which will disable the feature.
|
|
1469
1511
|
*/
|
1470
1512
|
experimental_telemetry?: TelemetrySettings;
|
1471
1513
|
/**
|
1514
|
+
Additional provider-specific metadata. They are passed through
|
1515
|
+
to the provider from the AI SDK and enable provider-specific
|
1516
|
+
functionality that can be fully encapsulated in the provider.
|
1517
|
+
*/
|
1518
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1519
|
+
/**
|
1472
1520
|
* Internal. For test use only. May change without notice.
|
1473
1521
|
*/
|
1474
1522
|
_internal?: {
|
@@ -1732,7 +1780,7 @@ If set and supported by the model, calls will generate deterministic results.
|
|
1732
1780
|
@return
|
1733
1781
|
A result object for accessing different stream types and additional information.
|
1734
1782
|
*/
|
1735
|
-
declare function streamText<TOOLS extends Record<string, CoreTool>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, headers, maxToolRoundtrips, experimental_telemetry: telemetry, experimental_toolCallStreaming: toolCallStreaming, onChunk, onFinish, _internal: { now, generateId, currentDate, }, ...settings }: CallSettings & Prompt & {
|
1783
|
+
declare function streamText<TOOLS extends Record<string, CoreTool>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, headers, maxToolRoundtrips, experimental_telemetry: telemetry, experimental_providerMetadata: providerMetadata, experimental_toolCallStreaming: toolCallStreaming, onChunk, onFinish, _internal: { now, generateId, currentDate, }, ...settings }: CallSettings & Prompt & {
|
1736
1784
|
/**
|
1737
1785
|
The language model to use.
|
1738
1786
|
*/
|
@@ -1763,6 +1811,12 @@ Optional telemetry configuration (experimental).
|
|
1763
1811
|
*/
|
1764
1812
|
experimental_telemetry?: TelemetrySettings;
|
1765
1813
|
/**
|
1814
|
+
Additional provider-specific metadata. They are passed through
|
1815
|
+
to the provider from the AI SDK and enable provider-specific
|
1816
|
+
functionality that can be fully encapsulated in the provider.
|
1817
|
+
*/
|
1818
|
+
experimental_providerMetadata?: ProviderMetadata;
|
1819
|
+
/**
|
1766
1820
|
Enable streaming of tool call deltas as they are generated. Disabled by default.
|
1767
1821
|
*/
|
1768
1822
|
experimental_toolCallStreaming?: boolean;
|
package/dist/index.js
CHANGED
@@ -1852,6 +1852,7 @@ async function generateObject({
|
|
1852
1852
|
abortSignal,
|
1853
1853
|
headers,
|
1854
1854
|
experimental_telemetry: telemetry,
|
1855
|
+
experimental_providerMetadata: providerMetadata,
|
1855
1856
|
_internal: {
|
1856
1857
|
generateId: generateId3 = originalGenerateId,
|
1857
1858
|
currentDate = () => /* @__PURE__ */ new Date()
|
@@ -1916,7 +1917,7 @@ async function generateObject({
|
|
1916
1917
|
let rawResponse;
|
1917
1918
|
let response;
|
1918
1919
|
let logprobs;
|
1919
|
-
let
|
1920
|
+
let resultProviderMetadata;
|
1920
1921
|
switch (mode) {
|
1921
1922
|
case "json": {
|
1922
1923
|
const validatedPrompt = validatePrompt({
|
@@ -1974,6 +1975,7 @@ async function generateObject({
|
|
1974
1975
|
...prepareCallSettings(settings),
|
1975
1976
|
inputFormat,
|
1976
1977
|
prompt: promptMessages,
|
1978
|
+
providerMetadata,
|
1977
1979
|
abortSignal,
|
1978
1980
|
headers
|
1979
1981
|
});
|
@@ -2018,7 +2020,7 @@ async function generateObject({
|
|
2018
2020
|
warnings = generateResult.warnings;
|
2019
2021
|
rawResponse = generateResult.rawResponse;
|
2020
2022
|
logprobs = generateResult.logprobs;
|
2021
|
-
|
2023
|
+
resultProviderMetadata = generateResult.providerMetadata;
|
2022
2024
|
response = generateResult.responseData;
|
2023
2025
|
break;
|
2024
2026
|
}
|
@@ -2078,6 +2080,7 @@ async function generateObject({
|
|
2078
2080
|
...prepareCallSettings(settings),
|
2079
2081
|
inputFormat,
|
2080
2082
|
prompt: promptMessages,
|
2083
|
+
providerMetadata,
|
2081
2084
|
abortSignal,
|
2082
2085
|
headers
|
2083
2086
|
});
|
@@ -2123,7 +2126,7 @@ async function generateObject({
|
|
2123
2126
|
warnings = generateResult.warnings;
|
2124
2127
|
rawResponse = generateResult.rawResponse;
|
2125
2128
|
logprobs = generateResult.logprobs;
|
2126
|
-
|
2129
|
+
resultProviderMetadata = generateResult.providerMetadata;
|
2127
2130
|
response = generateResult.responseData;
|
2128
2131
|
break;
|
2129
2132
|
}
|
@@ -2175,7 +2178,7 @@ async function generateObject({
|
|
2175
2178
|
headers: rawResponse == null ? void 0 : rawResponse.headers
|
2176
2179
|
},
|
2177
2180
|
logprobs,
|
2178
|
-
providerMetadata
|
2181
|
+
providerMetadata: resultProviderMetadata
|
2179
2182
|
});
|
2180
2183
|
}
|
2181
2184
|
});
|
@@ -2333,6 +2336,7 @@ async function streamObject({
|
|
2333
2336
|
abortSignal,
|
2334
2337
|
headers,
|
2335
2338
|
experimental_telemetry: telemetry,
|
2339
|
+
experimental_providerMetadata: providerMetadata,
|
2336
2340
|
onFinish,
|
2337
2341
|
_internal: {
|
2338
2342
|
generateId: generateId3 = originalGenerateId2,
|
@@ -2413,6 +2417,7 @@ async function streamObject({
|
|
2413
2417
|
prompt: validatedPrompt,
|
2414
2418
|
modelSupportsImageUrls: model.supportsImageUrls
|
2415
2419
|
}),
|
2420
|
+
providerMetadata,
|
2416
2421
|
abortSignal,
|
2417
2422
|
headers
|
2418
2423
|
};
|
@@ -2454,6 +2459,7 @@ async function streamObject({
|
|
2454
2459
|
prompt: validatedPrompt,
|
2455
2460
|
modelSupportsImageUrls: model.supportsImageUrls
|
2456
2461
|
}),
|
2462
|
+
providerMetadata,
|
2457
2463
|
abortSignal,
|
2458
2464
|
headers
|
2459
2465
|
};
|
@@ -3016,6 +3022,7 @@ async function generateText({
|
|
3016
3022
|
maxAutomaticRoundtrips = 0,
|
3017
3023
|
maxToolRoundtrips = maxAutomaticRoundtrips,
|
3018
3024
|
experimental_telemetry: telemetry,
|
3025
|
+
experimental_providerMetadata: providerMetadata,
|
3019
3026
|
_internal: {
|
3020
3027
|
generateId: generateId3 = originalGenerateId3,
|
3021
3028
|
currentDate = () => /* @__PURE__ */ new Date()
|
@@ -3113,6 +3120,7 @@ async function generateText({
|
|
3113
3120
|
...callSettings,
|
3114
3121
|
inputFormat: currentInputFormat,
|
3115
3122
|
prompt: promptMessages,
|
3123
|
+
providerMetadata,
|
3116
3124
|
abortSignal,
|
3117
3125
|
headers
|
3118
3126
|
});
|
@@ -3684,6 +3692,7 @@ async function streamText({
|
|
3684
3692
|
headers,
|
3685
3693
|
maxToolRoundtrips = 0,
|
3686
3694
|
experimental_telemetry: telemetry,
|
3695
|
+
experimental_providerMetadata: providerMetadata,
|
3687
3696
|
experimental_toolCallStreaming: toolCallStreaming = false,
|
3688
3697
|
onChunk,
|
3689
3698
|
onFinish,
|
@@ -3770,6 +3779,7 @@ async function streamText({
|
|
3770
3779
|
...prepareCallSettings(settings),
|
3771
3780
|
inputFormat: promptType,
|
3772
3781
|
prompt: promptMessages2,
|
3782
|
+
providerMetadata,
|
3773
3783
|
abortSignal,
|
3774
3784
|
headers
|
3775
3785
|
})
|