Files
crewAI/docs/v1.15.1/ar/tools/file-document/ocrtool.mdx
João Moura 6491f5a663
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
[docs-freeze] docs: snapshot and changelog for v1.15.1 (#6367)
2026-06-27 03:50:32 -03:00

89 lines
2.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: أداة OCR
description: تستخرج `OCRTool` النص من الصور المحلية أو عناوين URL للصور باستخدام نموذج LLM مزود بالرؤية.
icon: image
mode: "wide"
---
# `OCRTool`
## الوصف
استخراج النص من الصور (مسار محلي أو عنوان URL). تستخدم نموذج LLM مزوداً بالرؤية عبر واجهة LLM الخاصة بـ CrewAI.
## التثبيت
لا حاجة لتثبيت إضافي بخلاف `crewai-tools`. تأكد من أن النموذج المحدد يدعم الرؤية.
## المعاملات
### معاملات التشغيل
- `image_path_url` (str, مطلوب): مسار صورة محلية أو عنوان URL بروتوكول HTTP(S).
## أمثلة
### الاستخدام المباشر
```python Code
from crewai_tools import OCRTool
print(OCRTool().run(image_path_url="/tmp/receipt.png"))
```
### مع وكيل
```python Code
from crewai import Agent, Task, Crew
from crewai_tools import OCRTool
ocr = OCRTool()
agent = Agent(
role="OCR",
goal="Extract text",
tools=[ocr],
)
task = Task(
description="Extract text from https://example.com/invoice.jpg",
expected_output="All detected text in plain text",
agent=agent,
)
crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
```
## ملاحظات
- تأكد من أن النموذج المحدد يدعم مدخلات الصور.
- للصور الكبيرة، فكر في تصغير الحجم لتقليل استهلاك الرموز.
- يمكنك تمرير نسخة LLM محددة للأداة (مثل `LLM(model="gpt-4o")`) إذا لزم الأمر، وفقاً لتوجيهات README.
## مثال
```python Code
from crewai import Agent, Task, Crew
from crewai_tools import OCRTool
tool = OCRTool()
agent = Agent(
role="OCR Specialist",
goal="Extract text from images",
backstory="Visionenabled analyst",
tools=[tool],
verbose=True,
)
task = Task(
description="Extract text from https://example.com/receipt.png",
expected_output="All detected text in plain text",
agent=agent,
)
crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
```