Commint 3d
Browse files
app.py
CHANGED
|
@@ -6,7 +6,8 @@ import pandas as pd
|
|
| 6 |
|
| 7 |
from PIL import Image
|
| 8 |
from typing import Optional, Tuple, Any
|
| 9 |
-
from smolagents import CodeAgent,
|
|
|
|
| 10 |
from smolagents.tools import Tool
|
| 11 |
|
| 12 |
# (Keep Constants as is)
|
|
@@ -32,8 +33,6 @@ class BasicAgent:
|
|
| 32 |
def __init__(self):
|
| 33 |
print("BasicAgent initializing...")
|
| 34 |
|
| 35 |
-
duckduckgo=DuckDuckGoSearchTool()
|
| 36 |
-
visit_page=VisitWebpageTool()
|
| 37 |
final_answer=FinalAnswerTool()
|
| 38 |
|
| 39 |
model = AzureOpenAIServerModel(
|
|
@@ -45,9 +44,10 @@ class BasicAgent:
|
|
| 45 |
|
| 46 |
self.smart_agent = CodeAgent(
|
| 47 |
model=model,
|
| 48 |
-
tools=[
|
| 49 |
-
additional_authorized_imports=["pandas"],
|
| 50 |
-
max_steps=
|
|
|
|
| 51 |
)
|
| 52 |
print("BasicAgent initialized.")
|
| 53 |
|
|
|
|
| 6 |
|
| 7 |
from PIL import Image
|
| 8 |
from typing import Optional, Tuple, Any
|
| 9 |
+
from smolagents import CodeAgent,FinalAnswerTool,InferenceClientModel,tool,AzureOpenAIServerModel
|
| 10 |
+
from tools import wiki_search,web_search,get_current_time_in_timezone,visit_webpage,calculator_add,ocr,parse_excel,arxiv_search,
|
| 11 |
from smolagents.tools import Tool
|
| 12 |
|
| 13 |
# (Keep Constants as is)
|
|
|
|
| 33 |
def __init__(self):
|
| 34 |
print("BasicAgent initializing...")
|
| 35 |
|
|
|
|
|
|
|
| 36 |
final_answer=FinalAnswerTool()
|
| 37 |
|
| 38 |
model = AzureOpenAIServerModel(
|
|
|
|
| 44 |
|
| 45 |
self.smart_agent = CodeAgent(
|
| 46 |
model=model,
|
| 47 |
+
tools=[wiki_search,web_search,get_current_time_in_timezone,visit_webpage,calculator_add,ocr,parse_excel,arxiv_search,final_answer],
|
| 48 |
+
additional_authorized_imports=["pandas","bs4"],
|
| 49 |
+
max_steps=5,
|
| 50 |
+
verbisity_level=1
|
| 51 |
)
|
| 52 |
print("BasicAgent initialized.")
|
| 53 |
|