diff --git a/dev-guide/credential-providers.md b/dev-guide/credential-providers.md index 9d19ce7..a9da9a5 100644 --- a/dev-guide/credential-providers.md +++ b/dev-guide/credential-providers.md @@ -25,10 +25,10 @@ Not all credential providers are supported yet by the experimental Amazon Bedroc To use a specific credentials identity resolver, set the `aws_credentials_identity_resolver` property on the service client's `Config` object to an instance of the credentials identity resolver class you want to use. The following example specifically uses the `EnvironmentCredentialsResolver()`, which fetches credentials from the standard environment variables `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN`. ``` - service_client = BedrockRuntime( + service_client = BedrockRuntimeClient( config=Config( aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), region = "us-east-1", ) ) -``` \ No newline at end of file +``` diff --git a/dev-guide/region.md b/dev-guide/region.md index 6136a22..8540751 100644 --- a/dev-guide/region.md +++ b/dev-guide/region.md @@ -10,7 +10,7 @@ Most resources reside in a specific AWS Region and you must supply the correct R The Region is specified by setting the `region` property of the `Config` object to a string giving the name of the Region. For example, to specify the region `us-east-1` when creating an Amazon Bedrock Runtime client: ``` - service_client = BedrockRuntime( + service_client = BedrockRuntimeClient( config=Config( aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), region = "us-east-1", @@ -31,7 +31,7 @@ import os ... region = os.getenv('AWS_REGION', default="us-east-1") -service_client = BedrockRuntime( +service_client = BedrockRuntimeClient( config=Config( aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), region = region, @@ -39,4 +39,4 @@ service_client = BedrockRuntime( ) ``` -This uses the value of `AWS_REGION`, falling back to `us-east-1` if the variable isn't found in the environment. \ No newline at end of file +This uses the value of `AWS_REGION`, falling back to `us-east-1` if the variable isn't found in the environment. diff --git a/dev-guide/service-clients.md b/dev-guide/service-clients.md index b98549f..770ab1a 100644 --- a/dev-guide/service-clients.md +++ b/dev-guide/service-clients.md @@ -3,7 +3,7 @@ To make a request to an AWS service, you first instantiate a client for that service. You can configure common settings for service clients such as timeouts, the HTTP client, and retry configuration. To create a client for Amazon Bedrock Runtime: ``` - service_client = BedrockRuntime( + service_client = BedrockRuntimeClient( config=Config( aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), region = "us-east-1", @@ -22,4 +22,4 @@ The SDK has a series of places (or sources) that it checks in order to find a va + For details on setting environment variables, see [environment variables](https://docs.aws.amazon.com/sdkref/latest/guide/environment-variables.html) in the *AWS SDKs and Tools Reference Guide*. 1. Any default value provided by the SDK source code itself is used last. - + Some properties, such as Region, don't have a default. You must specify them either explicitly in code or in an environment setting. If the SDK can't resolve required configuration, API requests can fail at runtime. \ No newline at end of file + + Some properties, such as Region, don't have a default. You must specify them either explicitly in code or in an environment setting. If the SDK can't resolve required configuration, API requests can fail at runtime. diff --git a/dev-guide/simple-app.md b/dev-guide/simple-app.md index d89cccb..9420a5d 100644 --- a/dev-guide/simple-app.md +++ b/dev-guide/simple-app.md @@ -7,7 +7,7 @@ This chapter features a short example that asks the Amazon Titan Text Express ge The first thing our program does is import the service and the types we need from it: ``` -from aws_sdk_bedrock_runtime.client import BedrockRuntime, ConverseInput +from aws_sdk_bedrock_runtime.client import BedrockRuntimeClient, ConverseInput from aws_sdk_bedrock_runtime.models import Message, ContentBlockText, StopReason from aws_sdk_bedrock_runtime.config import Config @@ -18,7 +18,7 @@ import asyncio This imports the following from the Bedrock client: -1. `BedrockRuntime`, which is the class representing the Amazon Bedrock Runtime client. +1. `BedrockRuntimeClient`, which is the class representing the Amazon Bedrock Runtime client. 1. The `ConverseInput` class, which is used to specify the input values when calling the client's `converse()` function. @@ -38,11 +38,11 @@ Also imported is the `asyncio` package, which is used to manage the asynchronous ## Creating the Amazon Bedrock Runtime client -To create the Amazon Bedrock Runtime client, create a `BedrockRuntime` instance using a `Config` object providing the AWS Region to use. In this example, a credentials identity resolver is provided that uses the standard AWS [access keys in environment variables](https://docs.aws.amazon.com/sdkref/latest/guide/access-users.html) are used to specify credentials. +To create the Amazon Bedrock Runtime client, create a `BedrockRuntimeClient` instance using a `Config` object providing the AWS Region to use. In this example, a credentials identity resolver is provided that uses the standard AWS [access keys in environment variables](https://docs.aws.amazon.com/sdkref/latest/guide/access-users.html) are used to specify credentials. ``` def get_service_client(): - service_client = BedrockRuntime( + service_client = BedrockRuntimeClient( config=Config( aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), region = "us-east-1", @@ -146,4 +146,4 @@ async def app_run(): if __name__ == "__main__": asyncio.run(app_run()) -``` \ No newline at end of file +```