stanfordnlp / dspy

DSPy: The framework for programming—not prompting—foundation models
https://dspy-docs.vercel.app/
MIT License
16.68k stars 1.29k forks source link

Support for AWS Credentials Input in dspy.Bedrock #1360

Open joanacmesquitaf opened 1 month ago

joanacmesquitaf commented 1 month ago

I would like to request support for providing AWS credentials directly as input parameters in the dspy.Bedrock function

Current Behavior:

Currently, the dspy.Bedrock function supports setting the AWS region and Profile but does not allow for AWS credentials (access key and secret access key) to be provided directly. The only method available is to use an AWS profile through the profile_name option, which assumes credentials are managed via the AWS credentials file.

Desired Behavior:

To enhance flexibility and use cases, I propose adding parameters to the dspy.Bedrock function that accept AWS credentials directly. This would allow users to specify:

aws_access_key_id aws_secret_access_key

Thank you

arnavsinghvi11 commented 4 weeks ago

Hi @joanacmesquitaf , feel free to add a PR to dspy.Bedrock as needed.

Additionally, this can also be configured by setting environment variables. Relevant example in this issue

joanacmesquitaf commented 3 weeks ago

Hello,

Just opened a PR: https://github.com/stanfordnlp/dspy/pull/1421

I was trying to use it within a Databricks cluster with AWS credentials configured. The configured AWS credentials dont have access to Bedrock. I trying setting new AWS credentials using environment variables as you suggested but the configured AWS credentials are being used instead of the new AWS credentials in the environment variables. The only solution seems passing the new AWS credentials as input to the classes.

Thank you