Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors: BedrockEncoder #293

Open
kurtismassey opened this issue May 20, 2024 · 0 comments
Open

Errors: BedrockEncoder #293

kurtismassey opened this issue May 20, 2024 · 0 comments

Comments

@kurtismassey
Copy link
Contributor

kurtismassey commented May 20, 2024

Thank you for releasing the BedrockEncoder integration! Just having a couple of issues with the release

ValueError: No access_key_id provided

The BedrockEncoder currently uses "access_key_id", "secret_access_key" and "AWS_REGION" as the default environment variables would it be possible to update to the AWS Environment variables format of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION

ValueError: No AWS_SESSION_TOKEN provided

The session token is optional/not required for IAM users but is currently enforced through a ValueError raise in the get_env_variable method - current workaround is providing an empty string

An error occurred (ExpiredTokenException) when calling the InvokeModel operation: The security token included in the request is expired

As the encoder is initialised with the session token if using the router in an application after uptime of an hour or specified time the token will expire and the Encoder and RouteLayer has to be recreated with a new token - it would be good to dynamically get the session token or utilise boto3.Session.client without explicitly setting the session token in the client

        self.session = session or boto3.Session()
        if self.session.get_credentials() is None:
            raise ValueError("Could not get AWS session")
        self.region = region or self.session.region_name
        if self.region is None:
            raise ValueError("No AWS region provided")
        try:
            self.client = self.session.client(
                service_name="bedrock-runtime", region_name=str(self.region)
            )
kurtismassey added a commit to kurtismassey/semantic-router that referenced this issue May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant