Skip to content

feat(aws): add bedrockApiKey, bedrockApiSecret, bedrockApiSessionToken to ChatBedrockConverse#10288

Merged
Hunter Lovell (hntrl) merged 1 commit intomainfrom
hunter/bedrock-api-key
Mar 12, 2026
Merged

feat(aws): add bedrockApiKey, bedrockApiSecret, bedrockApiSessionToken to ChatBedrockConverse#10288
Hunter Lovell (hntrl) merged 1 commit intomainfrom
hunter/bedrock-api-key

Conversation

@hntrl
Copy link
Member

Summary

Add bedrockApiKey, bedrockApiSecret, and bedrockApiSessionToken fields to ChatBedrockConverse, matching the Python langchain-aws ChatBedrockConverse.bedrock_api_key / bedrock_api_secret pattern.

This makes it easier to pass AWS credentials directly to the Bedrock client without constructing a credentials object manually, and automatically picks up the BEDROCK_AWS_ACCESS_KEY_ID, BEDROCK_AWS_SECRET_ACCESS_KEY, and BEDROCK_AWS_SESSION_TOKEN environment variables.

Changes

@langchain/aws

src/chat_models.ts

  • Added bedrockApiKey, bedrockApiSecret, and bedrockApiSessionToken to ChatBedrockConverseInput interface and class fields
  • Updated constructor credential resolution order: explicit credentials > bedrockApiKey/bedrockApiSecret > defaultProvider()
  • Registered new fields in lc_secrets for proper serialization redaction

src/tests/chat_models.test.ts

  • Added 7 unit tests covering constructor usage, env var fallback, priority over default provider, string model shorthand, and lc_secrets inclusion

@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: 3dd123d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@langchain/aws Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hntrl Hunter Lovell (hntrl) merged commit 93e6180 into main Mar 12, 2026
20 checks passed
@hntrl Hunter Lovell (hntrl) deleted the hunter/bedrock-api-key branch March 12, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant