@ai-sdk/amazon-bedrock 1.1.5 → 2.0.0

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 3ff4ef8: feat (provider/amazon-bedrock): remove dependence on AWS SDK Bedrock client library
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [3ff4ef8]
12
+ - @ai-sdk/provider-utils@2.1.7
13
+
14
+ ## 1.1.6
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [d89c3b9]
19
+ - @ai-sdk/provider@1.0.7
20
+ - @ai-sdk/provider-utils@2.1.6
21
+
3
22
  ## 1.1.5
4
23
 
5
24
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ProviderV1, LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider';
2
- import { BedrockRuntimeClientConfig } from '@aws-sdk/client-bedrock-runtime';
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
- * Complete Bedrock configuration for setting advanced authentication and
35
- * other options. When this is provided, the region, accessKeyId, and
36
- * secretAccessKey settings are ignored.
49
+ Base URL for the Bedrock API calls.
50
+ */
51
+ baseURL?: string;
52
+ /**
53
+ Custom headers to include in the requests.
37
54
  */
38
- bedrockOptions?: BedrockRuntimeClientConfig;
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 { BedrockRuntimeClientConfig } from '@aws-sdk/client-bedrock-runtime';
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
- * Complete Bedrock configuration for setting advanced authentication and
35
- * other options. When this is provided, the region, accessKeyId, and
36
- * secretAccessKey settings are ignored.
49
+ Base URL for the Bedrock API calls.
50
+ */
51
+ baseURL?: string;
52
+ /**
53
+ Custom headers to include in the requests.
37
54
  */
38
- bedrockOptions?: BedrockRuntimeClientConfig;
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 {