Skip to content

[Bug] Unnecessary Claude error when secret not explicitly passed #5612

@sroy-forr

Description

@sroy-forr

Description

AWS credentials are used from env variables. It's not necessary to pass them as a param, although good to have. There's no point throwing an error when it's not explicitly passed, while everything is working without it.

"AWS credentials not found. Please either set the AWS_BEDROCK_API_KEY or AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables."

Steps to Reproduce

from agno.models.aws import Claude
instance = Claude(
            id=id,
            max_tokens=max_tokens,
            temperature=temp,
        )

AWS secret and access variables are marked as Optional but still throws this error. Credentials are generally used through env variables.

ERROR    AWS credentials not found. Please either set the AWS_BEDROCK_API_KEY or AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables.

Agent Configuration (if applicable)

No response

Expected Behavior

If we are using an env, we need not pass AWS secret keys explicitly. It is working but unnecessarily throwing an error.

Below image shows an error but the connection is successful. It's asking me to pass secrets explicitly.

Image

Actual Behavior

Throwing this error while everything is working fine through env variables.

Screenshots or Logs (if applicable)

No response

Environment

Agno 2.2.7

Possible Solutions (optional)

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions