Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RagTool hallucinated README code? #184

Open
danielgen opened this issue Jan 14, 2025 · 0 comments
Open

RagTool hallucinated README code? #184

danielgen opened this issue Jan 14, 2025 · 0 comments

Comments

@danielgen
Copy link

danielgen commented Jan 14, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant