File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
python/example_code/bedrock Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -38,21 +38,22 @@ def list_foundation_models(bedrock_client):
3838
3939
4040def 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+
5657if __name__ == "__main__" :
5758 main ()
5859
You can’t perform that action at this time.
0 commit comments