ag2ai / ag2

AG2 (formerly AutoGen): The Open-Source AgentOS. Join us at: https://discord.gg/pAbnFJrkgZ
https://ag2.ai
Apache License 2.0
715 stars 72 forks source link

[Bug]: Code doesn't work on AWS Lambda function when deployed with attached Role to access bedrock service. #84

Open irshadc opened 4 days ago

irshadc commented 4 days ago

Describe the bug

Current approach hard-coded with accessing bedrock-runtime client to use session with access_credentials. We need to handle a case where it can pick client with attached IAM role to managed service. (boto3.client)

Steps to reproduce

Simply deploy sample code using lambda function. Attach a role to Lambda function which has access to Bedrock Invoke. No access credentials to be generated and attached in environment, as this is unsecure approach in comparision.

Model Used

bedrock service, haiku model

Expected Behavior

Code should connect with bedrock deployed models without need to pass access credential.

Screenshots and logs

No response

Additional Information

No response

irshadc commented 4 days ago

Added this pull requests.:#85[Updated bedrock.py to handle case...]

marklysze commented 2 days ago

Thanks @irshadc! I'll look through #85 and help get it through.