Find answers from the community

Home
Members
Jayanth
J
Jayanth
Offline, last seen 2 months ago
Joined September 25, 2024
llm = Bedrock(model="anthropic.claude-3-sonnet-20240229-v1:0")
messages = [
ChatMessage(role="system", content="You are a pirate with a colorful personality"),
ChatMessage(role="user", content="Tell me a story"),
]
llm.chat(messages=[
ChatMessage(role="system", content="You are a pirate with a colorful personality"),
ChatMessage(role="user", content="Tell me a story"),
])

The above code is throwing the below error
File "C:\Users\Jay\OneDrive\coding_projects\RAG_AWS_Neptune\venv\Lib\site-packages\llama_index\llms\bedrock\utils.py", line 157, in get_request_body
if len(prompt) > 0 and prompt[0]["role"] == "system":
~~~~~^^^^^^^^
TypeError: string indices must be integers, not 'str'

This happens for both 'chat' and 'complete' method
2 comments
S
L
I am facing an issue with KnowledgeGraphIndex.from_documents
Can anyone please help me?
4 comments
J
W