Skip to content

Fix client naming in dev-guide #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev-guide/credential-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
)
```
```
6 changes: 3 additions & 3 deletions dev-guide/region.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -31,12 +31,12 @@ 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,
)
)
```

This uses the value of `AWS_REGION`, falling back to `us-east-1` if the variable isn't found in the environment.
This uses the value of `AWS_REGION`, falling back to `us-east-1` if the variable isn't found in the environment.
4 changes: 2 additions & 2 deletions dev-guide/service-clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.
+ 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.
10 changes: 5 additions & 5 deletions dev-guide/simple-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.

Expand All @@ -38,11 +38,11 @@ Also imported is the `asyncio` package, which is used to manage the asynchronous

## Creating the Amazon Bedrock Runtime client<a name="simple-app-create-client"></a>

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",
Expand Down Expand Up @@ -146,4 +146,4 @@ async def app_run():

if __name__ == "__main__":
asyncio.run(app_run())
```
```