Skip to content
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

Example is missing a value for the key variable 'config' #6854

Open
aderantcurt opened this issue Jan 29, 2025 · 1 comment
Open

Example is missing a value for the key variable 'config' #6854

aderantcurt opened this issue Jan 29, 2025 · 1 comment
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. documentation This is a problem with documentation. p2 This is a standard priority issue

Comments

@aderantcurt
Copy link

Describe the issue

In the example syntax, in this line:

const client = new BedrockRuntimeClient(config);

The value config is never defined.

It would be helpful to understand what that is and how it needs to be set up.

Links

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-runtime/command/InvokeModelCommand/

@aderantcurt aderantcurt added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Jan 29, 2025
@zshzbh zshzbh self-assigned this Jan 29, 2025
@zshzbh zshzbh added p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 29, 2025
@zshzbh
Copy link
Contributor

zshzbh commented Jan 29, 2025

Hey @aderantcurt ,

Thanks for the feedback!

There's couple ways to setup config and that's why we use config in the doc. However, most of the AWS SDKs and tools support common settings from two primary sources (beyond the code itself):

For example if you want to setup region for a specific service, there's 3 ways to set it up-

  1. In a client class constructor

    The basic config would include region and credentials -
{
  region: "us-east-1",  // Required
}

For advanced configuration you can include requestHandler

{
  region: "us-east-1",
  credentials: defaultProvider(),
  maxAttempts: 3,                    // Retry configuration
  requestHandler: {
    connectionTimeout: 5000,         // Connection timeout in ms
    socketTimeout: 5000             // Socket timeout in ms
  },
  endpoint: "https://custom-endpoint", // Optional custom endpoint
  logger: console,                    // Optional custom logger
  retryMode: "standard",             // Retry mode (standard/adaptive)
}
  1. Use an environment variable
  2. Use a shared config file

It is precisely because there are many different ways to set up the config that we have highly abbreviated all the configuration as 'config'

@zshzbh zshzbh added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. documentation This is a problem with documentation. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants