// @lc-docs-hide-cell
// Deno requires these imports, and way of loading env vars.
// we don't want to expose in the docs.
// Below this cell we have a typescript markdown codeblock with
// the node code.
import "@aws-sdk/credential-provider-node";
import "@smithy/protocol-http";
import "@aws-crypto/sha256-js";
import "@smithy/protocol-http";
import "@smithy/signature-v4";
import "@smithy/eventstream-codec";
import "@smithy/util-utf8";
import "@aws-sdk/types";
import { Bedrock } from "@langchain/community/llms/bedrock"
import { getEnvironmentVariable } from "@langchain/core/utils/env";
const llm = new Bedrock({
model: "anthropic.claude-v2",
region: "us-east-1",
// endpointUrl: "custom.amazonaws.com",
credentials: {
accessKeyId: getEnvironmentVariable("BEDROCK_AWS_ACCESS_KEY_ID"),
secretAccessKey: getEnvironmentVariable("BEDROCK_AWS_SECRET_ACCESS_KEY"),
},
temperature: 0,
maxTokens: undefined,
maxRetries: 2,
// other params...
})