docs: Specify environment variables for BedrockConverse (#32194)

This commit is contained in:
Jacob Lee 2025-07-22 14:37:47 -07:00 committed by GitHub
parent 6aeda24a07
commit 0f39155f62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,7 +51,31 @@
"\n",
"### Credentials\n",
"\n",
"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)."
"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",
"\n",
"Alternatively, `ChatBedrockConverse` will read from the following environment variables by default:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0f65be92",
"metadata": {},
"outputs": [],
"source": [
"# os.environ[\"AWS_ACCESS_KEY_ID\"] = \"...\"\n",
"# os.environ[\"AWS_SECRET_ACCESS_KEY\"] = \"...\"\n",
"\n",
"# Not required unless using temporary credentials.\n",
"# os.environ[\"AWS_SESSION_TOKEN\"] = \"...\""
]
},
{
"cell_type": "markdown",
"id": "3baad5a9",
"metadata": {},
"source": [
"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)."
]
},
{
@ -114,6 +138,10 @@
"\n",
"llm = ChatBedrockConverse(\n",
" model_id=\"anthropic.claude-3-5-sonnet-20240620-v1:0\",\n",
" # region_name=...,\n",
" # aws_access_key_id=...,\n",
" # aws_secret_access_key=...,\n",
" # aws_session_token=...,\n",
" # temperature=...,\n",
" # max_tokens=...,\n",
" # other params...\n",