@ai-sdk/amazon-bedrock
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -442,25 +442,27 @@ "use strict"; | ||
const createBedrockRuntimeClient = () => { | ||
const config = { | ||
region: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.region, | ||
settingName: "region", | ||
environmentVariableName: "AWS_REGION", | ||
description: "AWS region" | ||
}), | ||
credentials: { | ||
accessKeyId: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.accessKeyId, | ||
settingName: "accessKeyId", | ||
environmentVariableName: "AWS_ACCESS_KEY_ID", | ||
description: "AWS access key ID" | ||
var _a; | ||
return new import_client_bedrock_runtime2.BedrockRuntimeClient( | ||
(_a = options.bedrockOptions) != null ? _a : { | ||
region: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.region, | ||
settingName: "region", | ||
environmentVariableName: "AWS_REGION", | ||
description: "AWS region" | ||
}), | ||
secretAccessKey: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.secretAccessKey, | ||
settingName: "secretAccessKey", | ||
environmentVariableName: "AWS_SECRET_ACCESS_KEY", | ||
description: "AWS secret access key" | ||
}) | ||
credentials: { | ||
accessKeyId: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.accessKeyId, | ||
settingName: "accessKeyId", | ||
environmentVariableName: "AWS_ACCESS_KEY_ID", | ||
description: "AWS access key ID" | ||
}), | ||
secretAccessKey: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.secretAccessKey, | ||
settingName: "secretAccessKey", | ||
environmentVariableName: "AWS_SECRET_ACCESS_KEY", | ||
description: "AWS secret access key" | ||
}) | ||
} | ||
} | ||
}; | ||
return new import_client_bedrock_runtime2.BedrockRuntimeClient(config); | ||
); | ||
}; | ||
@@ -467,0 +469,0 @@ const createChatModel = (modelId, settings = {}) => new BedrockChatLanguageModel(modelId, settings, { |
@@ -0,3 +1,3 @@ | ||
import { BedrockRuntimeClient, BedrockRuntimeClientConfig } from '@aws-sdk/client-bedrock-runtime'; | ||
import { LanguageModelV1 } from '@ai-sdk/provider'; | ||
import { BedrockRuntimeClient } from '@aws-sdk/client-bedrock-runtime'; | ||
@@ -35,2 +35,8 @@ type BedrockChatModelId = 'amazon.titan-tg1-large' | 'amazon.titan-text-express-v1' | 'anthropic.claude-v2:1' | 'anthropic.claude-3-sonnet-20240229-v1:0' | 'anthropic.claude-3-5-sonnet-20240620-v1:0' | 'anthropic.claude-3-haiku-20240307-v1:0' | 'anthropic.claude-3-opus-20240229-v1:0' | 'cohere.command-r-v1:0' | 'cohere.command-r-plus-v1:0' | 'meta.llama2-13b-chat-v1' | 'meta.llama2-70b-chat-v1' | 'meta.llama3-8b-instruct-v1:0' | 'meta.llama3-70b-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' | (string & {}); | ||
secretAccessKey?: string; | ||
/** | ||
* Complete Bedrock configuration for setting advanced authentication and | ||
* other options. When this is provided, the region, accessKeyId, and | ||
* secretAccessKey settings are ignored. | ||
*/ | ||
bedrockOptions?: BedrockRuntimeClientConfig; | ||
generateId?: () => string; | ||
@@ -37,0 +43,0 @@ } |
@@ -442,25 +442,27 @@ "use strict"; | ||
const createBedrockRuntimeClient = () => { | ||
const config = { | ||
region: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.region, | ||
settingName: "region", | ||
environmentVariableName: "AWS_REGION", | ||
description: "AWS region" | ||
}), | ||
credentials: { | ||
accessKeyId: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.accessKeyId, | ||
settingName: "accessKeyId", | ||
environmentVariableName: "AWS_ACCESS_KEY_ID", | ||
description: "AWS access key ID" | ||
var _a; | ||
return new import_client_bedrock_runtime2.BedrockRuntimeClient( | ||
(_a = options.bedrockOptions) != null ? _a : { | ||
region: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.region, | ||
settingName: "region", | ||
environmentVariableName: "AWS_REGION", | ||
description: "AWS region" | ||
}), | ||
secretAccessKey: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.secretAccessKey, | ||
settingName: "secretAccessKey", | ||
environmentVariableName: "AWS_SECRET_ACCESS_KEY", | ||
description: "AWS secret access key" | ||
}) | ||
credentials: { | ||
accessKeyId: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.accessKeyId, | ||
settingName: "accessKeyId", | ||
environmentVariableName: "AWS_ACCESS_KEY_ID", | ||
description: "AWS access key ID" | ||
}), | ||
secretAccessKey: (0, import_provider_utils2.loadSetting)({ | ||
settingValue: options.secretAccessKey, | ||
settingName: "secretAccessKey", | ||
environmentVariableName: "AWS_SECRET_ACCESS_KEY", | ||
description: "AWS secret access key" | ||
}) | ||
} | ||
} | ||
}; | ||
return new import_client_bedrock_runtime2.BedrockRuntimeClient(config); | ||
); | ||
}; | ||
@@ -467,0 +469,0 @@ const createChatModel = (modelId, settings = {}) => new BedrockChatLanguageModel(modelId, settings, { |
{ | ||
"name": "@ai-sdk/amazon-bedrock", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
110443
1480