mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
fix(llm): set AWS credentials in config.toml (#10351)
This commit is contained in:
@@ -183,3 +183,13 @@ class LLMConfig(BaseModel):
|
||||
# Azure issue: https://github.com/All-Hands-AI/OpenHands/issues/7755
|
||||
if self.model.startswith('azure') and self.api_version is None:
|
||||
self.api_version = '2024-12-01-preview'
|
||||
|
||||
# Set AWS credentials as environment variables for LiteLLM Bedrock
|
||||
if self.aws_access_key_id:
|
||||
os.environ['AWS_ACCESS_KEY_ID'] = self.aws_access_key_id.get_secret_value()
|
||||
if self.aws_secret_access_key:
|
||||
os.environ['AWS_SECRET_ACCESS_KEY'] = (
|
||||
self.aws_secret_access_key.get_secret_value()
|
||||
)
|
||||
if self.aws_region_name:
|
||||
os.environ['AWS_REGION_NAME'] = self.aws_region_name
|
||||
|
||||
Reference in New Issue
Block a user