Skip to content

Conversation

@nityam2002
Copy link

chat_models: conditionally include inferenceConfig & system for Bedrock Converse

  • Build a candidate inferenceConfig; only send it if any of maxTokens, temperature, topP, or non-empty stopSequences are set.
  • Include system only when it’s a non-empty array in both ConverseCommand and ConverseStreamCommand.
  • Prevents Bedrock ValidationException about overriding inferenceConfig/system at runtime.

Fixes #9310

@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

⚠️ No Changeset found

Latest commit: bc0bbac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @nityam2002 for the contribution. Can we have some unit tests for this to ensure we don't regress in the future?

@nityam2002
Copy link
Author

@christian-bromann added it!

…ng in ChatBedrockConverse

**chat_models:** conditionally include `inferenceConfig` & `system` for Bedrock Converse

* Build a candidate `inferenceConfig`; only send it if any of `maxTokens`, `temperature`, `topP`, or non-empty `stopSequences` are set.
* Include `system` only when it’s a non-empty array in both `ConverseCommand` and `ConverseStreamCommand`.
* Prevents Bedrock `ValidationException` about overriding `inferenceConfig`/`system` at runtime.
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.

ChatBedrockConverse: passing empty inferenceConfig object and empty system array causes Bedrock ValidationException when using Prompt Management

2 participants