@ai-sdk/amazon-bedrock 5.0.101 → 5.0.102

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.
@@ -1,99 +1,102 @@
1
- import { ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
2
- import { FetchFunction } from '@ai-sdk/provider-utils';
3
-
1
+ import { LanguageModelV4, ProviderV4 } from "@ai-sdk/provider";
2
+ import { FetchFunction } from "@ai-sdk/provider-utils";
3
+ //#region src/amazon-bedrock-sigv4-fetch.d.ts
4
4
  interface AmazonBedrockCredentials {
5
- region: string;
6
- accessKeyId: string;
7
- secretAccessKey: string;
8
- sessionToken?: string;
5
+ region: string;
6
+ accessKeyId: string;
7
+ secretAccessKey: string;
8
+ sessionToken?: string;
9
9
  }
10
-
10
+ //#endregion
11
+ //#region src/mantle/bedrock-mantle-options.d.ts
11
12
  type BedrockMantleChatModelId = 'openai.gpt-oss-20b' | 'openai.gpt-oss-120b' | 'openai.gpt-oss-safeguard-20b' | 'openai.gpt-oss-safeguard-120b' | (string & {});
12
13
  type BedrockMantleResponsesModelId = 'openai.gpt-oss-20b' | 'openai.gpt-oss-120b' | (string & {});
13
14
  type BedrockMantleModelId = BedrockMantleChatModelId | BedrockMantleResponsesModelId;
14
-
15
+ //#endregion
16
+ //#region src/mantle/bedrock-mantle-provider.d.ts
15
17
  interface BedrockMantleProvider extends ProviderV4 {
16
- /**
17
- * Creates a model for text generation using the Chat Completions API.
18
- * Chat Completions has the broadest model support on Mantle.
19
- */
20
- (modelId: BedrockMantleChatModelId): LanguageModelV4;
21
- /**
22
- * Creates a model for text generation using the Chat Completions API.
23
- */
24
- languageModel(modelId: BedrockMantleChatModelId): LanguageModelV4;
25
- /**
26
- * Creates a model for text generation using the Chat Completions API.
27
- */
28
- chat(modelId: BedrockMantleChatModelId): LanguageModelV4;
29
- /**
30
- * Creates a model for text generation using the Responses API.
31
- * Not all Mantle models support this API. Notably, gpt-oss-safeguard models
32
- * are Chat-only.
33
- */
34
- responses(modelId: BedrockMantleResponsesModelId): LanguageModelV4;
35
- /**
36
- * @deprecated Mantle does not support embedding models.
37
- */
38
- textEmbeddingModel(modelId: string): never;
18
+ /**
19
+ * Creates a model for text generation using the Chat Completions API.
20
+ * Chat Completions has the broadest model support on Mantle.
21
+ */
22
+ (modelId: BedrockMantleChatModelId): LanguageModelV4;
23
+ /**
24
+ * Creates a model for text generation using the Chat Completions API.
25
+ */
26
+ languageModel(modelId: BedrockMantleChatModelId): LanguageModelV4;
27
+ /**
28
+ * Creates a model for text generation using the Chat Completions API.
29
+ */
30
+ chat(modelId: BedrockMantleChatModelId): LanguageModelV4;
31
+ /**
32
+ * Creates a model for text generation using the Responses API.
33
+ * Not all Mantle models support this API. Notably, gpt-oss-safeguard models
34
+ * are Chat-only.
35
+ */
36
+ responses(modelId: BedrockMantleResponsesModelId): LanguageModelV4;
37
+ /**
38
+ * @deprecated Mantle does not support embedding models.
39
+ */
40
+ textEmbeddingModel(modelId: string): never;
39
41
  }
40
42
  interface BedrockMantleProviderSettings {
41
- /**
42
- * The AWS region to use for the Bedrock Mantle endpoint. Defaults to the value of the
43
- * `AWS_REGION` environment variable.
44
- */
45
- region?: string;
46
- /**
47
- * API key for authenticating requests using Bearer token authentication.
48
- * When provided, this will be used instead of AWS SigV4 authentication.
49
- * Defaults to the value of the `AWS_BEARER_TOKEN_BEDROCK` environment variable.
50
- */
51
- apiKey?: string;
52
- /**
53
- * The AWS access key ID to use for SigV4 authentication. Defaults to the value of the
54
- * `AWS_ACCESS_KEY_ID` environment variable.
55
- */
56
- accessKeyId?: string;
57
- /**
58
- * The AWS secret access key to use for SigV4 authentication. Defaults to the value of the
59
- * `AWS_SECRET_ACCESS_KEY` environment variable.
60
- */
61
- secretAccessKey?: string;
62
- /**
63
- * The AWS session token to use for SigV4 authentication. Defaults to the value of the
64
- * `AWS_SESSION_TOKEN` environment variable.
65
- */
66
- sessionToken?: string;
67
- /**
68
- * Base URL for the Bedrock Mantle API calls.
69
- */
70
- baseURL?: string;
71
- /**
72
- * Custom headers to include in the requests.
73
- */
74
- headers?: Record<string, string | undefined>;
75
- /**
76
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
77
- * or to provide a custom fetch implementation for e.g. testing.
78
- */
79
- fetch?: FetchFunction;
80
- /**
81
- * The AWS credential provider to use for SigV4 authentication to get dynamic
82
- * credentials similar to the AWS SDK. Setting a provider here will cause its
83
- * credential values to be used instead of the `accessKeyId`, `secretAccessKey`,
84
- * and `sessionToken` settings.
85
- */
86
- credentialProvider?: () => PromiseLike<Omit<AmazonBedrockCredentials, 'region'>>;
43
+ /**
44
+ * The AWS region to use for the Bedrock Mantle endpoint. Defaults to the value of the
45
+ * `AWS_REGION` environment variable.
46
+ */
47
+ region?: string;
48
+ /**
49
+ * API key for authenticating requests using Bearer token authentication.
50
+ * When provided, this will be used instead of AWS SigV4 authentication.
51
+ * Defaults to the value of the `AWS_BEARER_TOKEN_BEDROCK` environment variable.
52
+ */
53
+ apiKey?: string;
54
+ /**
55
+ * The AWS access key ID to use for SigV4 authentication. Defaults to the value of the
56
+ * `AWS_ACCESS_KEY_ID` environment variable.
57
+ */
58
+ accessKeyId?: string;
59
+ /**
60
+ * The AWS secret access key to use for SigV4 authentication. Defaults to the value of the
61
+ * `AWS_SECRET_ACCESS_KEY` environment variable.
62
+ */
63
+ secretAccessKey?: string;
64
+ /**
65
+ * The AWS session token to use for SigV4 authentication. Defaults to the value of the
66
+ * `AWS_SESSION_TOKEN` environment variable.
67
+ */
68
+ sessionToken?: string;
69
+ /**
70
+ * Base URL for the Bedrock Mantle API calls.
71
+ */
72
+ baseURL?: string;
73
+ /**
74
+ * Custom headers to include in the requests.
75
+ */
76
+ headers?: Record<string, string | undefined>;
77
+ /**
78
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
79
+ * or to provide a custom fetch implementation for e.g. testing.
80
+ */
81
+ fetch?: FetchFunction;
82
+ /**
83
+ * The AWS credential provider to use for SigV4 authentication to get dynamic
84
+ * credentials similar to the AWS SDK. Setting a provider here will cause its
85
+ * credential values to be used instead of the `accessKeyId`, `secretAccessKey`,
86
+ * and `sessionToken` settings.
87
+ */
88
+ credentialProvider?: () => PromiseLike<Omit<AmazonBedrockCredentials, 'region'>>;
87
89
  }
88
90
  /**
89
91
  * Create an Amazon Bedrock Mantle provider instance.
90
92
  * This provider uses the OpenAI-compatible Mantle API for models that are
91
93
  * only available through the Mantle endpoint (e.g. openai.gpt-oss-20b).
92
94
  */
93
- declare function createBedrockMantle(options?: BedrockMantleProviderSettings): BedrockMantleProvider;
95
+ export declare function createBedrockMantle(options?: BedrockMantleProviderSettings): BedrockMantleProvider;
94
96
  /**
95
97
  * Default Bedrock Mantle provider instance.
96
98
  */
97
- declare const bedrockMantle: BedrockMantleProvider;
98
-
99
- export { type BedrockMantleModelId, type BedrockMantleProvider, type BedrockMantleProviderSettings, bedrockMantle, createBedrockMantle };
99
+ export declare const bedrockMantle: BedrockMantleProvider;
100
+ //#endregion
101
+ export type { BedrockMantleModelId, BedrockMantleProvider, BedrockMantleProviderSettings };
102
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/amazon-bedrock-sigv4-fetch.ts","../../src/mantle/bedrock-mantle-options.ts","../../src/mantle/bedrock-mantle-provider.ts"],"mappings":";;;UAUiB;EACf;EACA;EACA;EACA;;;;KCdU;KAOA;KAKA,uBACR,2BACA;;;UCaa,8BAA8B;;;;;GAK5C,SAAS,2BAA2B;;;;EAKrC,cAAc,SAAS,2BAA2B;;;;EAKlD,KAAK,SAAS,2BAA2B;;;;;;EAOzC,UAAU,SAAS,gCAAgC;;;;EAKnD,mBAAmB;;UAGJ;;;;;EAKf;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;EAKA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;;;;;;EAQR,2BAA2B,YACzB,KAAK;;;;;;;wBASO,oBACd,UAAS,gCACR;;;;qBAqKU,eAAa"}
@@ -1,99 +1,102 @@
1
- import { ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
2
- import { FetchFunction } from '@ai-sdk/provider-utils';
3
-
1
+ import { LanguageModelV4, ProviderV4 } from "@ai-sdk/provider";
2
+ import { FetchFunction } from "@ai-sdk/provider-utils";
3
+ //#region src/amazon-bedrock-sigv4-fetch.d.ts
4
4
  interface AmazonBedrockCredentials {
5
- region: string;
6
- accessKeyId: string;
7
- secretAccessKey: string;
8
- sessionToken?: string;
5
+ region: string;
6
+ accessKeyId: string;
7
+ secretAccessKey: string;
8
+ sessionToken?: string;
9
9
  }
10
-
10
+ //#endregion
11
+ //#region src/mantle/bedrock-mantle-options.d.ts
11
12
  type BedrockMantleChatModelId = 'openai.gpt-oss-20b' | 'openai.gpt-oss-120b' | 'openai.gpt-oss-safeguard-20b' | 'openai.gpt-oss-safeguard-120b' | (string & {});
12
13
  type BedrockMantleResponsesModelId = 'openai.gpt-oss-20b' | 'openai.gpt-oss-120b' | (string & {});
13
14
  type BedrockMantleModelId = BedrockMantleChatModelId | BedrockMantleResponsesModelId;
14
-
15
+ //#endregion
16
+ //#region src/mantle/bedrock-mantle-provider.d.ts
15
17
  interface BedrockMantleProvider extends ProviderV4 {
16
- /**
17
- * Creates a model for text generation using the Chat Completions API.
18
- * Chat Completions has the broadest model support on Mantle.
19
- */
20
- (modelId: BedrockMantleChatModelId): LanguageModelV4;
21
- /**
22
- * Creates a model for text generation using the Chat Completions API.
23
- */
24
- languageModel(modelId: BedrockMantleChatModelId): LanguageModelV4;
25
- /**
26
- * Creates a model for text generation using the Chat Completions API.
27
- */
28
- chat(modelId: BedrockMantleChatModelId): LanguageModelV4;
29
- /**
30
- * Creates a model for text generation using the Responses API.
31
- * Not all Mantle models support this API. Notably, gpt-oss-safeguard models
32
- * are Chat-only.
33
- */
34
- responses(modelId: BedrockMantleResponsesModelId): LanguageModelV4;
35
- /**
36
- * @deprecated Mantle does not support embedding models.
37
- */
38
- textEmbeddingModel(modelId: string): never;
18
+ /**
19
+ * Creates a model for text generation using the Chat Completions API.
20
+ * Chat Completions has the broadest model support on Mantle.
21
+ */
22
+ (modelId: BedrockMantleChatModelId): LanguageModelV4;
23
+ /**
24
+ * Creates a model for text generation using the Chat Completions API.
25
+ */
26
+ languageModel(modelId: BedrockMantleChatModelId): LanguageModelV4;
27
+ /**
28
+ * Creates a model for text generation using the Chat Completions API.
29
+ */
30
+ chat(modelId: BedrockMantleChatModelId): LanguageModelV4;
31
+ /**
32
+ * Creates a model for text generation using the Responses API.
33
+ * Not all Mantle models support this API. Notably, gpt-oss-safeguard models
34
+ * are Chat-only.
35
+ */
36
+ responses(modelId: BedrockMantleResponsesModelId): LanguageModelV4;
37
+ /**
38
+ * @deprecated Mantle does not support embedding models.
39
+ */
40
+ textEmbeddingModel(modelId: string): never;
39
41
  }
40
42
  interface BedrockMantleProviderSettings {
41
- /**
42
- * The AWS region to use for the Bedrock Mantle endpoint. Defaults to the value of the
43
- * `AWS_REGION` environment variable.
44
- */
45
- region?: string;
46
- /**
47
- * API key for authenticating requests using Bearer token authentication.
48
- * When provided, this will be used instead of AWS SigV4 authentication.
49
- * Defaults to the value of the `AWS_BEARER_TOKEN_BEDROCK` environment variable.
50
- */
51
- apiKey?: string;
52
- /**
53
- * The AWS access key ID to use for SigV4 authentication. Defaults to the value of the
54
- * `AWS_ACCESS_KEY_ID` environment variable.
55
- */
56
- accessKeyId?: string;
57
- /**
58
- * The AWS secret access key to use for SigV4 authentication. Defaults to the value of the
59
- * `AWS_SECRET_ACCESS_KEY` environment variable.
60
- */
61
- secretAccessKey?: string;
62
- /**
63
- * The AWS session token to use for SigV4 authentication. Defaults to the value of the
64
- * `AWS_SESSION_TOKEN` environment variable.
65
- */
66
- sessionToken?: string;
67
- /**
68
- * Base URL for the Bedrock Mantle API calls.
69
- */
70
- baseURL?: string;
71
- /**
72
- * Custom headers to include in the requests.
73
- */
74
- headers?: Record<string, string | undefined>;
75
- /**
76
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
77
- * or to provide a custom fetch implementation for e.g. testing.
78
- */
79
- fetch?: FetchFunction;
80
- /**
81
- * The AWS credential provider to use for SigV4 authentication to get dynamic
82
- * credentials similar to the AWS SDK. Setting a provider here will cause its
83
- * credential values to be used instead of the `accessKeyId`, `secretAccessKey`,
84
- * and `sessionToken` settings.
85
- */
86
- credentialProvider?: () => PromiseLike<Omit<AmazonBedrockCredentials, 'region'>>;
43
+ /**
44
+ * The AWS region to use for the Bedrock Mantle endpoint. Defaults to the value of the
45
+ * `AWS_REGION` environment variable.
46
+ */
47
+ region?: string;
48
+ /**
49
+ * API key for authenticating requests using Bearer token authentication.
50
+ * When provided, this will be used instead of AWS SigV4 authentication.
51
+ * Defaults to the value of the `AWS_BEARER_TOKEN_BEDROCK` environment variable.
52
+ */
53
+ apiKey?: string;
54
+ /**
55
+ * The AWS access key ID to use for SigV4 authentication. Defaults to the value of the
56
+ * `AWS_ACCESS_KEY_ID` environment variable.
57
+ */
58
+ accessKeyId?: string;
59
+ /**
60
+ * The AWS secret access key to use for SigV4 authentication. Defaults to the value of the
61
+ * `AWS_SECRET_ACCESS_KEY` environment variable.
62
+ */
63
+ secretAccessKey?: string;
64
+ /**
65
+ * The AWS session token to use for SigV4 authentication. Defaults to the value of the
66
+ * `AWS_SESSION_TOKEN` environment variable.
67
+ */
68
+ sessionToken?: string;
69
+ /**
70
+ * Base URL for the Bedrock Mantle API calls.
71
+ */
72
+ baseURL?: string;
73
+ /**
74
+ * Custom headers to include in the requests.
75
+ */
76
+ headers?: Record<string, string | undefined>;
77
+ /**
78
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
79
+ * or to provide a custom fetch implementation for e.g. testing.
80
+ */
81
+ fetch?: FetchFunction;
82
+ /**
83
+ * The AWS credential provider to use for SigV4 authentication to get dynamic
84
+ * credentials similar to the AWS SDK. Setting a provider here will cause its
85
+ * credential values to be used instead of the `accessKeyId`, `secretAccessKey`,
86
+ * and `sessionToken` settings.
87
+ */
88
+ credentialProvider?: () => PromiseLike<Omit<AmazonBedrockCredentials, 'region'>>;
87
89
  }
88
90
  /**
89
91
  * Create an Amazon Bedrock Mantle provider instance.
90
92
  * This provider uses the OpenAI-compatible Mantle API for models that are
91
93
  * only available through the Mantle endpoint (e.g. openai.gpt-oss-20b).
92
94
  */
93
- declare function createBedrockMantle(options?: BedrockMantleProviderSettings): BedrockMantleProvider;
95
+ export declare function createBedrockMantle(options?: BedrockMantleProviderSettings): BedrockMantleProvider;
94
96
  /**
95
97
  * Default Bedrock Mantle provider instance.
96
98
  */
97
- declare const bedrockMantle: BedrockMantleProvider;
98
-
99
- export { type BedrockMantleModelId, type BedrockMantleProvider, type BedrockMantleProviderSettings, bedrockMantle, createBedrockMantle };
99
+ export declare const bedrockMantle: BedrockMantleProvider;
100
+ //#endregion
101
+ export type { BedrockMantleModelId, BedrockMantleProvider, BedrockMantleProviderSettings };
102
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/amazon-bedrock-sigv4-fetch.ts","../../src/mantle/bedrock-mantle-options.ts","../../src/mantle/bedrock-mantle-provider.ts"],"mappings":";;;UAUiB;EACf;EACA;EACA;EACA;;;;KCdU;KAOA;KAKA,uBACR,2BACA;;;UCaa,8BAA8B;;;;;GAK5C,SAAS,2BAA2B;;;;EAKrC,cAAc,SAAS,2BAA2B;;;;EAKlD,KAAK,SAAS,2BAA2B;;;;;;EAOzC,UAAU,SAAS,gCAAgC;;;;EAKnD,mBAAmB;;UAGJ;;;;;EAKf;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;EAKA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;;;;;;EAQR,2BAA2B,YACzB,KAAK;;;;;;;wBASO,oBACd,UAAS,gCACR;;;;qBAqKU,eAAa"}