From bba32a19d244d99bfdc71716b10206cb01365bf1 Mon Sep 17 00:00:00 2001 From: Mike Plachta Date: Mon, 24 Feb 2025 16:20:15 -0800 Subject: [PATCH] Fix for OCR tool data missing in the imports --- crewai_tools/__init__.py | 1 + crewai_tools/tools/__init__.py | 1 + crewai_tools/tools/ocr_tool/README.md | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crewai_tools/__init__.py b/crewai_tools/__init__.py index 4d2ea7e1..12ca19a9 100644 --- a/crewai_tools/__init__.py +++ b/crewai_tools/__init__.py @@ -25,6 +25,7 @@ MultiOnTool, MySQLSearchTool, NL2SQLTool, + OCRTool, PatronusEvalTool, PatronusLocalEvaluatorTool, PatronusPredefinedCriteriaEvalTool, diff --git a/crewai_tools/tools/__init__.py b/crewai_tools/tools/__init__.py index 4a9786fe..bdc19406 100644 --- a/crewai_tools/tools/__init__.py +++ b/crewai_tools/tools/__init__.py @@ -28,6 +28,7 @@ from .multion_tool.multion_tool import MultiOnTool from .mysql_search_tool.mysql_search_tool import MySQLSearchTool from .nl2sql.nl2sql_tool import NL2SQLTool +from .ocr_tool.ocr_tool import OCRTool from .patronus_eval_tool import ( PatronusEvalTool, PatronusLocalEvaluatorTool, diff --git a/crewai_tools/tools/ocr_tool/README.md b/crewai_tools/tools/ocr_tool/README.md index f5375ca1..d7a43c23 100644 --- a/crewai_tools/tools/ocr_tool/README.md +++ b/crewai_tools/tools/ocr_tool/README.md @@ -5,7 +5,9 @@ This tool performs Optical Character Recognition (OCR) on images using supported LLMs. It can extract text from both local image files and images available via URLs. The tool leverages the LLM's vision capabilities to provide accurate text extraction from images. ## Installation -Install the crewai_tools package + +Install the crewai_tools package: + ```shell pip install 'crewai[tools]' ``` @@ -14,6 +16,7 @@ pip install 'crewai[tools]' Any LLM that supports the `vision` feature should work. It must accept image_url as a user message. The tool has been tested with: + - OpenAI's `gpt-4o` - Gemini's `gemini/gemini-1.5-pro` @@ -38,5 +41,6 @@ def researcher(self) -> Agent: ``` The tool accepts either a local file path or a URL to the image: + - For local files, provide the absolute or relative path - For remote images, provide the complete URL starting with 'http' or 'https'