@ai-sdk/amazon-bedrock 4.0.70 → 4.0.71
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 +9 -0
- package/dist/anthropic/index.js +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/convert-to-bedrock-chat-messages.ts +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/amazon-bedrock",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.71",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@smithy/eventstream-codec": "^4.0.1",
|
|
39
39
|
"@smithy/util-utf8": "^4.0.0",
|
|
40
40
|
"aws4fetch": "^1.0.20",
|
|
41
|
-
"@ai-sdk/anthropic": "3.0.
|
|
41
|
+
"@ai-sdk/anthropic": "3.0.52",
|
|
42
42
|
"@ai-sdk/provider": "3.0.8",
|
|
43
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
43
|
+
"@ai-sdk/provider-utils": "4.0.17"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "20.17.24",
|
|
@@ -5,7 +5,11 @@ import {
|
|
|
5
5
|
SharedV3ProviderMetadata,
|
|
6
6
|
UnsupportedFunctionalityError,
|
|
7
7
|
} from '@ai-sdk/provider';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
convertToBase64,
|
|
10
|
+
parseProviderOptions,
|
|
11
|
+
stripFileExtension,
|
|
12
|
+
} from '@ai-sdk/provider-utils';
|
|
9
13
|
import {
|
|
10
14
|
BEDROCK_DOCUMENT_MIME_TYPES,
|
|
11
15
|
BEDROCK_IMAGE_MIME_TYPES,
|
|
@@ -138,7 +142,9 @@ export async function convertToBedrockChatMessages(
|
|
|
138
142
|
bedrockContent.push({
|
|
139
143
|
document: {
|
|
140
144
|
format: getBedrockDocumentFormat(part.mediaType),
|
|
141
|
-
name: part.filename
|
|
145
|
+
name: part.filename
|
|
146
|
+
? stripFileExtension(part.filename)
|
|
147
|
+
: generateDocumentName(),
|
|
142
148
|
source: { bytes: convertToBase64(part.data) },
|
|
143
149
|
...(enableCitations && {
|
|
144
150
|
citations: { enabled: true },
|