Skip to content

Commit 17f5a18

Browse files
committed
removed region declaration
1 parent 7944fe8 commit 17f5a18

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

python/example_code/bedrock/hello_bedrock.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,22 @@ def list_foundation_models(bedrock_client):
3838

3939

4040
def main():
41-
"""Entry point for the example. Change region to the region
42-
that you want to use."""
43-
44-
region = "us-east-1"
41+
"""Entry point for the example. Uses the AWS SDK for Python (Boto3)
42+
to create an Amazon Bedrock client. Then lists the available Bedrock models
43+
in the region set in the callers profile and credentials.
44+
"""
45+
46+
bedrock_client = boto3.client(service_name="bedrock")
4547

46-
bedrock_client = boto3.client(service_name="bedrock", region_name=region)
47-
4848
fm_models = list_foundation_models(bedrock_client)
4949
for model in fm_models:
5050
print(f"Model: {model['modelName']}")
5151
print(json.dumps(model, indent=2))
5252
print("---------------------------\n")
53-
53+
5454
logger.info("Done.")
5555

56+
5657
if __name__ == "__main__":
5758
main()
5859

0 commit comments

Comments
 (0)