diff --git a/autogen/oai/client.py b/autogen/oai/client.py index 4cc7c697f738..fb13afdfcc63 100644 --- a/autogen/oai/client.py +++ b/autogen/oai/client.py @@ -457,10 +457,13 @@ def _configure_azure_openai(self, config: Dict[str, Any], openai_config: Dict[st def _configure_openai_config_for_bedrock(self, config: Dict[str, Any], openai_config: Dict[str, Any]) -> None: """Update openai_config with AWS credentials from config.""" required_keys = ["aws_access_key", "aws_secret_key", "aws_region"] - + optional_keys = ["aws_session_token"] for key in required_keys: if key in config: openai_config[key] = config[key] + for key in optional_keys: + if key in config: + openai_config[key] = config[key] def _register_default_client(self, config: Dict[str, Any], openai_config: Dict[str, Any]) -> None: """Create a client with the given config to override openai_config,