turns out claude responses can be empty if you are sending completed messages sequence. I monkey patched an interceptor there.
otherwise:-
File ~/.local/lib/python3.10/site-packages/llama_index/llms/bedrock/utils.py:150, in AnthropicProvider.get_text_from_response(self, response)
149 def get_text_from_response(self, response: dict) -> str:
--> 150 return response["content"][0]["text"]
IndexError: list index out of range
should probably have some secondstage validation.
temporary money patch fixed:
import llama_index.llms.bedrock.utils
def f(self, response):
if len(response["content"]) > 0:
return response["content"][0]["text"]
else:
return ''
llama_index.llms.bedrock.utils.AnthropicProvider.get_text_from_response = f