crewAI-tools
crewAI-tools copied to clipboard
Error: string indices must be integers, not 'str' When agent attempts to use LlamaIndexTool.from_query_engine
# Attempt to initialize query_tool
query_tool = LlamaIndexTool.from_query_engine(
query_engine,
name="Knowledge Graph Tool",
description="Use this tool to answer the user query.",
)
chatAgent = Agent(
... other config ...
tools=[query_tool]
)
2024-08-29T13:32:02.389-04:00
Action: Knowledge Graph Tool
2024-08-29T13:32:03.132-04:00 Action Input: {"query": "bhp343"}
2024-08-29T13:32:03.132-04:00 I encountered an error while trying to use the tool. This was the error: string indices must be integers, not 'str'.
The agent works correctly without setting the tool. When i add the tool list to the agent config with the llamaindex tool it gives this error and does not use the tool.
llama-index==0.10.58 crewai==0.41.1 crewai_tools==0.4.26 langchain_aws==0.1.13
I rolled back crewai, crewai_tools, langchain_aws, and llama-index a few versions and was able to get the tool to work.