2 Answers
- Newest
- Most votes
- Most comments
1
Thank you for providing the code details. When we try to InvokeModel
, we should use the endpoint bedrock-runtime.us-east-1.amazonaws.com
(missing -runtime
here). Therefore, the InvokeModel
request is recognized.
More information in this document: https://docs.aws.amazon.com/bedrock/latest/userguide/endpointsTable.html
answered 8 months ago
This is it, the runtime endpoint was incorrect. Thanks!
0
Hi,
You should make sure you have the latest version of boto3 installed on the environment you are running these tests on.
For e.g.
- I installed the boto3 1.28.58 on my EC2 instance in a python3 virtual environment [The 1.28.58 is the latest version as of 02-Oct-2023]
- Provided the instance role a permission to access the Bedrock API (similar to the SageMaker Role [https://docs.aws.amazon.com/bedrock/latest/userguide/api-setup.html])
- Executed the code snippet provided on the AWS documentation, adjusted the prompts/parameters as per needs [https://docs.aws.amazon.com/bedrock/latest/userguide/api-setup.html]
I received an output from Bedrock based on the above steps.
Also, it is best to check the boto3 version in your current runtime by using print(boto3.__version__)
and compare if this version corresponds to the latest which includes Bedrock.
answered 8 months ago
Relevant content
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 months ago
This was the prompt that worked for me
Human: Who is abraham lincoln? Assistant:
syntax :
Human: <Your Prompt> Assistant: