Skip to content

Commit 0f39155

Browse files
authored
docs: Specify environment variables for BedrockConverse (#32194)
1 parent 6aeda24 commit 0f39155

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

docs/docs/integrations/chat/bedrock.ipynb

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,31 @@
5151
"\n",
5252
"### Credentials\n",
5353
"\n",
54-
"Head to the [AWS docs](https://docs.aws.amazon.com/bedrock/latest/userguide/setting-up.html) to sign up to AWS and setup your credentials. You'll also need to turn on model access for your account, which you can do by following [these instructions](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html)."
54+
"Head to the [AWS docs](https://docs.aws.amazon.com/bedrock/latest/userguide/setting-up.html) to sign up to AWS and setup your credentials.\n",
55+
"\n",
56+
"Alternatively, `ChatBedrockConverse` will read from the following environment variables by default:"
57+
]
58+
},
59+
{
60+
"cell_type": "code",
61+
"execution_count": null,
62+
"id": "0f65be92",
63+
"metadata": {},
64+
"outputs": [],
65+
"source": [
66+
"# os.environ[\"AWS_ACCESS_KEY_ID\"] = \"...\"\n",
67+
"# os.environ[\"AWS_SECRET_ACCESS_KEY\"] = \"...\"\n",
68+
"\n",
69+
"# Not required unless using temporary credentials.\n",
70+
"# os.environ[\"AWS_SESSION_TOKEN\"] = \"...\""
71+
]
72+
},
73+
{
74+
"cell_type": "markdown",
75+
"id": "3baad5a9",
76+
"metadata": {},
77+
"source": [
78+
"You'll also need to turn on model access for your account, which you can do by following [these instructions](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html)."
5579
]
5680
},
5781
{
@@ -114,6 +138,10 @@
114138
"\n",
115139
"llm = ChatBedrockConverse(\n",
116140
" model_id=\"anthropic.claude-3-5-sonnet-20240620-v1:0\",\n",
141+
" # region_name=...,\n",
142+
" # aws_access_key_id=...,\n",
143+
" # aws_secret_access_key=...,\n",
144+
" # aws_session_token=...,\n",
117145
" # temperature=...,\n",
118146
" # max_tokens=...,\n",
119147
" # other params...\n",

0 commit comments

Comments
 (0)