Skip to content

A programming framework for agentic AI

Fix to issue #3295 related to Anthropic bedrock (#3298)

Manojkumar Kotakondafb788c37d207
diff --git a/autogen/oai/client.py b/autogen/oai/client.py
index 4cc7c697f..fb13afdfc 100644
--- a/autogen/oai/client.py
+++ b/autogen/oai/client.py
@@ -457,10 +457,13 @@ class OpenAIWrapper:
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,