diff --git a/crewai_tools/tools/llamaindex_tool/llamaindex_tool.py b/crewai_tools/tools/llamaindex_tool/llamaindex_tool.py index 61a7479..ba26058 100644 --- a/crewai_tools/tools/llamaindex_tool/llamaindex_tool.py +++ b/crewai_tools/tools/llamaindex_tool/llamaindex_tool.py @@ -18,6 +18,10 @@ def _run( from llama_index.core.tools import BaseTool as LlamaBaseTool tool = cast(LlamaBaseTool, self.llama_index_tool) + + if self.result_as_answer: + return tool(*args, **kwargs).content + return tool(*args, **kwargs) @classmethod