@ai-sdk/amazon-bedrock 1.1.6 → 2.0.1
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/dist/index.d.mts +27 -5
- package/dist/index.d.ts +27 -5
- package/dist/index.js +421 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +433 -119
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/amazon-bedrock
|
|
2
2
|
|
|
3
|
+
## 2.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2e898b4]
|
|
8
|
+
- @ai-sdk/provider-utils@2.1.8
|
|
9
|
+
|
|
10
|
+
## 2.0.0
|
|
11
|
+
|
|
12
|
+
### Major Changes
|
|
13
|
+
|
|
14
|
+
- 3ff4ef8: feat (provider/amazon-bedrock): remove dependence on AWS SDK Bedrock client library
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [3ff4ef8]
|
|
19
|
+
- @ai-sdk/provider-utils@2.1.7
|
|
20
|
+
|
|
3
21
|
## 1.1.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProviderV1, LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider';
|
|
2
|
-
import {
|
|
2
|
+
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
3
|
|
|
4
4
|
type BedrockChatModelId = 'amazon.titan-tg1-large' | 'amazon.titan-text-express-v1' | 'anthropic.claude-v2' | 'anthropic.claude-v2:1' | 'anthropic.claude-instant-v1' | 'anthropic.claude-3-5-sonnet-20240620-v1:0' | 'anthropic.claude-3-5-sonnet-20241022-v2:0' | 'anthropic.claude-3-5-haiku-20241022-v1:0' | 'anthropic.claude-3-sonnet-20240229-v1:0' | 'anthropic.claude-3-haiku-20240307-v1:0' | 'anthropic.claude-3-opus-20240229-v1:0' | 'cohere.command-text-v14' | 'cohere.command-light-text-v14' | 'cohere.command-r-v1:0' | 'cohere.command-r-plus-v1:0' | 'meta.llama3-70b-instruct-v1:0' | 'meta.llama3-8b-instruct-v1:0' | 'meta.llama3-1-405b-instruct-v1:0' | 'meta.llama3-1-70b-instruct-v1:0' | 'meta.llama3-1-8b-instruct-v1:0' | 'meta.llama3-2-11b-instruct-v1:0' | 'meta.llama3-2-1b-instruct-v1:0' | 'meta.llama3-2-3b-instruct-v1:0' | 'meta.llama3-2-90b-instruct-v1:0' | 'mistral.mistral-7b-instruct-v0:2' | 'mistral.mixtral-8x7b-instruct-v0:1' | 'mistral.mistral-large-2402-v1:0' | 'mistral.mistral-small-2402-v1:0' | 'amazon.titan-text-express-v1' | 'amazon.titan-text-lite-v1' | (string & {});
|
|
5
5
|
interface BedrockChatSettings {
|
|
@@ -26,16 +26,38 @@ interface BedrockEmbeddingSettings {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
interface AmazonBedrockProviderSettings {
|
|
29
|
+
/**
|
|
30
|
+
The AWS region to use for the Bedrock provider. Defaults to the value of the
|
|
31
|
+
`AWS_REGION` environment variable.
|
|
32
|
+
*/
|
|
29
33
|
region?: string;
|
|
34
|
+
/**
|
|
35
|
+
The AWS access key ID to use for the Bedrock provider. Defaults to the value of the
|
|
36
|
+
*/
|
|
30
37
|
accessKeyId?: string;
|
|
38
|
+
/**
|
|
39
|
+
The AWS secret access key to use for the Bedrock provider. Defaults to the value of the
|
|
40
|
+
`AWS_SECRET_ACCESS_KEY` environment variable.
|
|
41
|
+
*/
|
|
31
42
|
secretAccessKey?: string;
|
|
43
|
+
/**
|
|
44
|
+
The AWS session token to use for the Bedrock provider. Defaults to the value of the
|
|
45
|
+
`AWS_SESSION_TOKEN` environment variable.
|
|
46
|
+
*/
|
|
32
47
|
sessionToken?: string;
|
|
33
48
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
49
|
+
Base URL for the Bedrock API calls.
|
|
50
|
+
*/
|
|
51
|
+
baseURL?: string;
|
|
52
|
+
/**
|
|
53
|
+
Custom headers to include in the requests.
|
|
37
54
|
*/
|
|
38
|
-
|
|
55
|
+
headers?: Record<string, string>;
|
|
56
|
+
/**
|
|
57
|
+
Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
58
|
+
or to provide a custom fetch implementation for e.g. testing.
|
|
59
|
+
*/
|
|
60
|
+
fetch?: FetchFunction;
|
|
39
61
|
generateId?: () => string;
|
|
40
62
|
}
|
|
41
63
|
interface AmazonBedrockProvider extends ProviderV1 {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProviderV1, LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider';
|
|
2
|
-
import {
|
|
2
|
+
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
3
|
|
|
4
4
|
type BedrockChatModelId = 'amazon.titan-tg1-large' | 'amazon.titan-text-express-v1' | 'anthropic.claude-v2' | 'anthropic.claude-v2:1' | 'anthropic.claude-instant-v1' | 'anthropic.claude-3-5-sonnet-20240620-v1:0' | 'anthropic.claude-3-5-sonnet-20241022-v2:0' | 'anthropic.claude-3-5-haiku-20241022-v1:0' | 'anthropic.claude-3-sonnet-20240229-v1:0' | 'anthropic.claude-3-haiku-20240307-v1:0' | 'anthropic.claude-3-opus-20240229-v1:0' | 'cohere.command-text-v14' | 'cohere.command-light-text-v14' | 'cohere.command-r-v1:0' | 'cohere.command-r-plus-v1:0' | 'meta.llama3-70b-instruct-v1:0' | 'meta.llama3-8b-instruct-v1:0' | 'meta.llama3-1-405b-instruct-v1:0' | 'meta.llama3-1-70b-instruct-v1:0' | 'meta.llama3-1-8b-instruct-v1:0' | 'meta.llama3-2-11b-instruct-v1:0' | 'meta.llama3-2-1b-instruct-v1:0' | 'meta.llama3-2-3b-instruct-v1:0' | 'meta.llama3-2-90b-instruct-v1:0' | 'mistral.mistral-7b-instruct-v0:2' | 'mistral.mixtral-8x7b-instruct-v0:1' | 'mistral.mistral-large-2402-v1:0' | 'mistral.mistral-small-2402-v1:0' | 'amazon.titan-text-express-v1' | 'amazon.titan-text-lite-v1' | (string & {});
|
|
5
5
|
interface BedrockChatSettings {
|
|
@@ -26,16 +26,38 @@ interface BedrockEmbeddingSettings {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
interface AmazonBedrockProviderSettings {
|
|
29
|
+
/**
|
|
30
|
+
The AWS region to use for the Bedrock provider. Defaults to the value of the
|
|
31
|
+
`AWS_REGION` environment variable.
|
|
32
|
+
*/
|
|
29
33
|
region?: string;
|
|
34
|
+
/**
|
|
35
|
+
The AWS access key ID to use for the Bedrock provider. Defaults to the value of the
|
|
36
|
+
*/
|
|
30
37
|
accessKeyId?: string;
|
|
38
|
+
/**
|
|
39
|
+
The AWS secret access key to use for the Bedrock provider. Defaults to the value of the
|
|
40
|
+
`AWS_SECRET_ACCESS_KEY` environment variable.
|
|
41
|
+
*/
|
|
31
42
|
secretAccessKey?: string;
|
|
43
|
+
/**
|
|
44
|
+
The AWS session token to use for the Bedrock provider. Defaults to the value of the
|
|
45
|
+
`AWS_SESSION_TOKEN` environment variable.
|
|
46
|
+
*/
|
|
32
47
|
sessionToken?: string;
|
|
33
48
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
49
|
+
Base URL for the Bedrock API calls.
|
|
50
|
+
*/
|
|
51
|
+
baseURL?: string;
|
|
52
|
+
/**
|
|
53
|
+
Custom headers to include in the requests.
|
|
37
54
|
*/
|
|
38
|
-
|
|
55
|
+
headers?: Record<string, string>;
|
|
56
|
+
/**
|
|
57
|
+
Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
58
|
+
or to provide a custom fetch implementation for e.g. testing.
|
|
59
|
+
*/
|
|
60
|
+
fetch?: FetchFunction;
|
|
39
61
|
generateId?: () => string;
|
|
40
62
|
}
|
|
41
63
|
interface AmazonBedrockProvider extends ProviderV1 {
|