Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -236,7 +236,7 @@ from langchain_community.document_loaders import PyMuPDFLoader
|
|
236 |
from docx import Document as DocxDocument
|
237 |
import openpyxl
|
238 |
|
239 |
-
class AnalyseAttachmentTool:
|
240 |
"""
|
241 |
A tool for analyzing various attachment types (PY, PDF, TXT, DOCX, XLSX)
|
242 |
and extracting their text content.
|
@@ -311,7 +311,7 @@ from io import BytesIO
|
|
311 |
# Define image analysis tool
|
312 |
import requests
|
313 |
|
314 |
-
class ImageAnalysisTool:
|
315 |
"""
|
316 |
A tool for analyzing images using a hosted Hugging Face model.
|
317 |
"""
|
@@ -420,7 +420,7 @@ class BasicAgent:
|
|
420 |
|
421 |
# Custom tools - ensure these classes are defined and imported
|
422 |
self.video_transcription_tool = VideoTranscriptionTool()
|
423 |
-
self.
|
424 |
self.analyse_attachment_tool = AnalyseAttachmentTool() # Renamed for clarity
|
425 |
self.code_llama_tool = CodeLlamaTool() # Ensure this class is defined/imported
|
426 |
|
@@ -439,7 +439,7 @@ If the answer is a comma-separated list, apply the above rules for each element
|
|
439 |
tools=[
|
440 |
self.search_tool, # Use the initialized DuckDuckGoSearchTool instance
|
441 |
self.visit_webpage_tool,
|
442 |
-
self.
|
443 |
],
|
444 |
model=self.model, # Use self.model
|
445 |
max_steps=10,
|
|
|
236 |
from docx import Document as DocxDocument
|
237 |
import openpyxl
|
238 |
|
239 |
+
class AnalyseAttachmentTool(Tool):
|
240 |
"""
|
241 |
A tool for analyzing various attachment types (PY, PDF, TXT, DOCX, XLSX)
|
242 |
and extracting their text content.
|
|
|
311 |
# Define image analysis tool
|
312 |
import requests
|
313 |
|
314 |
+
class ImageAnalysisTool(Tool):
|
315 |
"""
|
316 |
A tool for analyzing images using a hosted Hugging Face model.
|
317 |
"""
|
|
|
420 |
|
421 |
# Custom tools - ensure these classes are defined and imported
|
422 |
self.video_transcription_tool = VideoTranscriptionTool()
|
423 |
+
self.image_analysis_tool = ImageAnalysisTool() # Renamed for clarity
|
424 |
self.analyse_attachment_tool = AnalyseAttachmentTool() # Renamed for clarity
|
425 |
self.code_llama_tool = CodeLlamaTool() # Ensure this class is defined/imported
|
426 |
|
|
|
439 |
tools=[
|
440 |
self.search_tool, # Use the initialized DuckDuckGoSearchTool instance
|
441 |
self.visit_webpage_tool,
|
442 |
+
self.image_analysis_tool
|
443 |
],
|
444 |
model=self.model, # Use self.model
|
445 |
max_steps=10,
|