File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/botocore/client.py:888, in BaseClient.getattr(self, item)
885 if event_response is not None:
886 return event_response
--> 888 raise AttributeError(
889 f"'{self.class.name}' object has no attribute '{item}'"
890 )
AttributeError: 'Bedrock' object has no attribute 'invoke'
from langchain.llms import Bedrock
boto3_bedrock = boto3.client( service_name="bedrock", region_name="us-west-2", endpoint_url="https://bedrock.us-west-2.amazonaws.com", aws_access_key_id="**", aws_secret_access_key="****" )
parameters_bedrock = { "max_tokens_to_sample": 450,
"stop_sequences":STOP,
}
berock_llm = Bedrock(model_id="anthropic.claude-v2", client=boto3_bedrock, model_kwargs=parameters_bedrock) #
berock_llm = Bedrock(model_id="anthropic.claude-v2",region_name="us-west-2",
endpoint_url="https://bedrock.us-west-2.amazonaws.com",
credentials_profile_name="default")
berock_llm("hi there")
---> 75 boto3_bedrock.invoke("hi there")
File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/botocore/client.py:888, in BaseClient.getattr(self, item) 885 if event_response is not None: 886 return event_response --> 888 raise AttributeError( 889 f"'{self.class.name}' object has no attribute '{item}'" 890 )
AttributeError: 'Bedrock' object has no attribute 'invoke'