Spaces:
Configuration error
Configuration error
oremaz
commited on
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -10,6 +10,12 @@ from llama_index.core.query_engine import RetrieverQueryEngine
|
|
| 10 |
from llama_index.readers.file import PDFReader, DocxReader, CSVReader, ImageReader
|
| 11 |
import os
|
| 12 |
from typing import List, Dict, Any
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# LLM definitions
|
| 15 |
multimodal_llm = HuggingFaceInferenceAPI(
|
|
@@ -217,12 +223,6 @@ analysis_agent = FunctionAgent(
|
|
| 217 |
can_handoff_to=["CodeAgent", "ResearchAgent"]
|
| 218 |
)
|
| 219 |
|
| 220 |
-
from llama_index.readers.web import SimpleWebPageReader
|
| 221 |
-
from llama_index.core.tools.ondemand_loader_tool import OnDemandLoaderTool
|
| 222 |
-
from llama_index.tools.arxiv import ArxivToolSpec
|
| 223 |
-
import duckduckgo_search as ddg
|
| 224 |
-
import re
|
| 225 |
-
from typing import List
|
| 226 |
|
| 227 |
class IntelligentSourceRouter:
|
| 228 |
def __init__(self):
|
|
@@ -350,8 +350,6 @@ research_agent = FunctionAgent(
|
|
| 350 |
)
|
| 351 |
|
| 352 |
|
| 353 |
-
from llama_index.core.agent.workflow import ReActAgent
|
| 354 |
-
|
| 355 |
def execute_python_code(code: str) -> str:
|
| 356 |
try:
|
| 357 |
safe_globals = {
|
|
|
|
| 10 |
from llama_index.readers.file import PDFReader, DocxReader, CSVReader, ImageReader
|
| 11 |
import os
|
| 12 |
from typing import List, Dict, Any
|
| 13 |
+
from llama_index.readers.web import SimpleWebPageReader
|
| 14 |
+
from llama_index.core.tools.ondemand_loader_tool import OnDemandLoaderTool
|
| 15 |
+
from llama_index.tools.arxiv import ArxivToolSpec
|
| 16 |
+
import duckduckgo_search as ddg
|
| 17 |
+
import re
|
| 18 |
+
from llama_index.core.agent.workflow import ReActAgent
|
| 19 |
|
| 20 |
# LLM definitions
|
| 21 |
multimodal_llm = HuggingFaceInferenceAPI(
|
|
|
|
| 223 |
can_handoff_to=["CodeAgent", "ResearchAgent"]
|
| 224 |
)
|
| 225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
|
| 227 |
class IntelligentSourceRouter:
|
| 228 |
def __init__(self):
|
|
|
|
| 350 |
)
|
| 351 |
|
| 352 |
|
|
|
|
|
|
|
| 353 |
def execute_python_code(code: str) -> str:
|
| 354 |
try:
|
| 355 |
safe_globals = {
|