You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use RagTool and it is not working as intended:
This is from the README:
from crewai_tools.tools.rag_tool import RagTool
# Example: Loading from a file
rag_tool = RagTool().from_file('path/to/your/file.txt')
# Example: Loading from a directory
rag_tool = RagTool().from_directory('path/to/your/directory')
# Example: Loading from a web page
rag_tool = RagTool().from_web_page('https://example.com')
however from crewai_tools.tools.rag_tool does not even exist, as you can see from the path, and none of the methods above seem to be defined.
What is the intended use?
Does one need to .add() manually?
EDIT: I got it to work like so:
@cached_property
def rag_tool(self) -> RagTool:
tool = RagTool()
pdfs_dir = Path(__file__).parent.parent.parent / 'pdfs'
for pdf_file in pdfs_dir.glob('*.pdf'):
tool.add(str(pdf_file))
return tool
The text was updated successfully, but these errors were encountered:
I am trying to use RagTool and it is not working as intended:
This is from the README:
however
from crewai_tools.tools.rag_tool
does not even exist, as you can see from the path, and none of the methods above seem to be defined.What is the intended use?
Does one need to .add() manually?
EDIT: I got it to work like so:
The text was updated successfully, but these errors were encountered: