Find answers from the community

Updated 2 months ago

Bedrock.init() got an unexpected keyword argument 'aws_region_name'

Hello, I'm getting below error when I try to run this in docker
aws_session_token is not provided, but error is for aws_region_name
How I can fix the problem ? Thanks

llm = Bedrock(
^^^^^^^^
TypeError: Bedrock.init() got an unexpected keyword argument 'aws_region_name'

Plain Text
from llama_index.llms import Bedrock
import os
from dotenv import load_dotenv
load_dotenv()

llm = Bedrock(
    model="amazon.titan-text-express-v1",
    aws_access_key_id=os.getenv('AWS_ACCESS_KEY_ID'),
    aws_secret_access_key=os.getenv('AWS_SECRET_ACCESS_KEY'),
    aws_region_name="us-west-2",
)

resp = llm.complete("Paul Graham is ")
J
L
3 comments
@Logan M any recommendation about this issue ?
I have no idea -- I've never used bedrock before
I can point you towards the source code though. Maybe you can spot the issue and make a PR? ❤️
https://github.com/run-llama/llama_index/blob/main/llama_index/llms/bedrock.py#L58
Add a reply
Sign up and join the conversation on Discord