Sitemap

How to solve Bedrock Converse API ‘BedrockRunTime’ object has no attribute error?

Jul 1, 2024

Human-written

Amazon Bedrock has released a new API for calling different models available within Bedrock called — ‘Converse API’. Before the release of this API, developers used either InvokeModel or InvokeModelWithResponseStream API for using the LLMs in Bedrock.

I use Amazon Sagemaker to work on notebooks for LLM projects. Hence you will see images of Jupyter notebook cells. If you follow the guidelines in AWS documentation to try out the Converse API, you may run into the below error

Press enter or click to view image in full size
Converse API call error

You can solve that in 2 steps.

1/ uninstall existing boto installations

2/ re-install boto3 ≥ 1.34 version and restarting the kernal

Press enter or click to view image in full size
step1:

Restart the kernel, run the cells again, Voila,

Press enter or click to view image in full size
working converse api

--

--

Aswathy Prasad
Aswathy Prasad

Written by Aswathy Prasad

AWS Solutions Architect | Engineer | interested in quirky stories | writes about experiences, learnings and feelings |afraid of uselessness

No responses yet