ai 3.0.33 → 3.0.35
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/dist/index.d.mts +53 -26
- package/dist/index.d.ts +53 -26
- package/dist/index.js +38 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/rsc/dist/index.d.ts +287 -9
- package/rsc/dist/rsc-server.d.mts +287 -9
- package/rsc/dist/rsc-server.mjs +599 -2
- package/rsc/dist/rsc-server.mjs.map +1 -1
package/dist/index.mjs
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
// core/generate-object/generate-object.ts
|
2
|
-
import {
|
3
|
-
NoTextGeneratedError
|
4
|
-
} from "@ai-sdk/provider";
|
2
|
+
import { NoObjectGeneratedError } from "@ai-sdk/provider";
|
5
3
|
import { safeParseJSON } from "@ai-sdk/provider-utils";
|
6
4
|
|
7
5
|
// core/generate-text/token-usage.ts
|
@@ -394,7 +392,7 @@ async function experimental_generateObject({
|
|
394
392
|
});
|
395
393
|
});
|
396
394
|
if (generateResult.text === void 0) {
|
397
|
-
throw new
|
395
|
+
throw new NoObjectGeneratedError();
|
398
396
|
}
|
399
397
|
result = generateResult.text;
|
400
398
|
finishReason = generateResult.finishReason;
|
@@ -420,7 +418,7 @@ async function experimental_generateObject({
|
|
420
418
|
})
|
421
419
|
);
|
422
420
|
if (generateResult.text === void 0) {
|
423
|
-
throw new
|
421
|
+
throw new NoObjectGeneratedError();
|
424
422
|
}
|
425
423
|
result = generateResult.text;
|
426
424
|
finishReason = generateResult.finishReason;
|
@@ -455,7 +453,7 @@ async function experimental_generateObject({
|
|
455
453
|
);
|
456
454
|
const functionArgs = (_b = (_a = generateResult.toolCalls) == null ? void 0 : _a[0]) == null ? void 0 : _b.args;
|
457
455
|
if (functionArgs === void 0) {
|
458
|
-
throw new
|
456
|
+
throw new NoObjectGeneratedError();
|
459
457
|
}
|
460
458
|
result = functionArgs;
|
461
459
|
finishReason = generateResult.finishReason;
|
@@ -1552,6 +1550,26 @@ function tool(tool2) {
|
|
1552
1550
|
return tool2;
|
1553
1551
|
}
|
1554
1552
|
|
1553
|
+
// core/types/errors.ts
|
1554
|
+
import {
|
1555
|
+
APICallError as APICallError2,
|
1556
|
+
EmptyResponseBodyError,
|
1557
|
+
InvalidArgumentError as InvalidArgumentError2,
|
1558
|
+
InvalidDataContentError as InvalidDataContentError2,
|
1559
|
+
InvalidPromptError as InvalidPromptError2,
|
1560
|
+
InvalidResponseDataError,
|
1561
|
+
InvalidToolArgumentsError as InvalidToolArgumentsError2,
|
1562
|
+
JSONParseError,
|
1563
|
+
LoadAPIKeyError,
|
1564
|
+
NoObjectGeneratedError as NoObjectGeneratedError2,
|
1565
|
+
NoSuchToolError as NoSuchToolError3,
|
1566
|
+
RetryError as RetryError2,
|
1567
|
+
ToolCallParseError,
|
1568
|
+
TypeValidationError,
|
1569
|
+
UnsupportedFunctionalityError,
|
1570
|
+
UnsupportedJSONSchemaError
|
1571
|
+
} from "@ai-sdk/provider";
|
1572
|
+
|
1555
1573
|
// shared/stream-parts.ts
|
1556
1574
|
var textStreamPart = {
|
1557
1575
|
code: "0",
|
@@ -2940,6 +2958,7 @@ function streamToResponse(res, response, init) {
|
|
2940
2958
|
}
|
2941
2959
|
export {
|
2942
2960
|
AIStream,
|
2961
|
+
APICallError2 as APICallError,
|
2943
2962
|
AWSBedrockAnthropicMessagesStream,
|
2944
2963
|
AWSBedrockAnthropicStream,
|
2945
2964
|
AWSBedrockCohereStream,
|
@@ -2948,19 +2967,34 @@ export {
|
|
2948
2967
|
AnthropicStream,
|
2949
2968
|
AssistantResponse,
|
2950
2969
|
CohereStream,
|
2970
|
+
EmptyResponseBodyError,
|
2951
2971
|
GenerateObjectResult,
|
2952
2972
|
GenerateTextResult,
|
2953
2973
|
GoogleGenerativeAIStream,
|
2954
2974
|
HuggingFaceStream,
|
2955
2975
|
InkeepStream,
|
2976
|
+
InvalidArgumentError2 as InvalidArgumentError,
|
2977
|
+
InvalidDataContentError2 as InvalidDataContentError,
|
2978
|
+
InvalidPromptError2 as InvalidPromptError,
|
2979
|
+
InvalidResponseDataError,
|
2980
|
+
InvalidToolArgumentsError2 as InvalidToolArgumentsError,
|
2981
|
+
JSONParseError,
|
2956
2982
|
LangChainStream,
|
2983
|
+
LoadAPIKeyError,
|
2957
2984
|
MistralStream,
|
2985
|
+
NoObjectGeneratedError2 as NoObjectGeneratedError,
|
2986
|
+
NoSuchToolError3 as NoSuchToolError,
|
2958
2987
|
OpenAIStream,
|
2959
2988
|
ReplicateStream,
|
2989
|
+
RetryError2 as RetryError,
|
2960
2990
|
StreamData,
|
2961
2991
|
StreamObjectResult,
|
2962
2992
|
StreamTextResult,
|
2963
2993
|
StreamingTextResponse,
|
2994
|
+
ToolCallParseError,
|
2995
|
+
TypeValidationError,
|
2996
|
+
UnsupportedFunctionalityError,
|
2997
|
+
UnsupportedJSONSchemaError,
|
2964
2998
|
convertDataContentToBase64String,
|
2965
2999
|
convertDataContentToUint8Array,
|
2966
3000
|
createCallbacksTransformer,
|