Skip to content

Commit

Permalink
Fix to issue #3295 related to Anthropic bedrock (#3298)
Browse files Browse the repository at this point in the history
* Fix to consider session token in request

* Formatted

---------

Co-authored-by: Chi Wang <[email protected]>
  • Loading branch information
makkzone and sonichi authored Aug 9, 2024
1 parent 1971f85 commit fb788c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autogen/oai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fb788c3

Please sign in to comment.