Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,38 @@ import pytz
|
|
5 |
import yaml
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
from tools.ocr import ocr_tool
|
8 |
-
|
9 |
|
10 |
from Gradio_UI import GradioUI
|
11 |
|
12 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
@tool
|
16 |
def ocr_tool(image_path: str) -> str:
|
|
|
5 |
import yaml
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
from tools.ocr import ocr_tool
|
8 |
+
from tools.reconcile import reconcile_documents
|
9 |
|
10 |
from Gradio_UI import GradioUI
|
11 |
|
12 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
13 |
|
14 |
+
@tool
|
15 |
+
def reconcile_documents(text1:str, text2:str)
|
16 |
+
"""Compares two text documents and identifies differences using LLM analysis.
|
17 |
+
Args:
|
18 |
+
text1: First document text
|
19 |
+
text2: Second document text
|
20 |
+
"""
|
21 |
+
prompt = f"""Perform detailed comparison of these two documents:
|
22 |
+
|
23 |
+
Document 1:
|
24 |
+
{text1}
|
25 |
+
|
26 |
+
Document 2:
|
27 |
+
{text2}
|
28 |
+
|
29 |
+
Identify and list:
|
30 |
+
1. Numerical discrepancies
|
31 |
+
2. Missing information
|
32 |
+
3. Formatting differences
|
33 |
+
4. Semantic contradictions
|
34 |
+
|
35 |
+
Final verdict: Are these documents substantially equivalent?"""
|
36 |
+
|
37 |
+
return f"Comparison request queued: {prompt[:200]}..." # Actual comparison done through agent
|
38 |
+
|
39 |
+
|
40 |
|
41 |
@tool
|
42 |
def ocr_tool(image_path: str) -> str:
|