Spaces:
Sleeping
Sleeping
adjust vision web browser
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel,load_tool, tool
|
| 2 |
-
from smolagents
|
| 3 |
import datetime
|
| 4 |
import requests
|
| 5 |
import pytz
|
|
@@ -10,9 +10,6 @@ from tools.final_answer import FinalAnswerTool
|
|
| 10 |
|
| 11 |
from Gradio_UI import GradioUI
|
| 12 |
|
| 13 |
-
|
| 14 |
-
print(vision_web_browser)
|
| 15 |
-
|
| 16 |
@tool
|
| 17 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 18 |
"""A tool that fetches the current local time in a specified timezone.
|
|
@@ -51,15 +48,17 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 51 |
|
| 52 |
agent = CodeAgent(
|
| 53 |
model=model,
|
| 54 |
-
tools=[final_answer, get_current_time_in_timezone, web_search
|
|
|
|
| 55 |
max_steps=6,
|
| 56 |
verbosity_level=1,
|
| 57 |
grammar=None,
|
| 58 |
planning_interval=None,
|
| 59 |
name=None,
|
| 60 |
description=None,
|
| 61 |
-
prompt_templates=prompt_templates,
|
| 62 |
)
|
|
|
|
| 63 |
|
| 64 |
|
| 65 |
GradioUI(agent).launch()
|
|
|
|
| 1 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel,load_tool, tool
|
| 2 |
+
from smolagents import vision_web_browser as vwb
|
| 3 |
import datetime
|
| 4 |
import requests
|
| 5 |
import pytz
|
|
|
|
| 10 |
|
| 11 |
from Gradio_UI import GradioUI
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
@tool
|
| 14 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 15 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
|
| 48 |
|
| 49 |
agent = CodeAgent(
|
| 50 |
model=model,
|
| 51 |
+
tools=[final_answer, get_current_time_in_timezone, web_search,
|
| 52 |
+
vwb.go_back, vwb.close_popups, vwb.search_item_ctr_f], ## add your tools here (don't remove final answer)
|
| 53 |
max_steps=6,
|
| 54 |
verbosity_level=1,
|
| 55 |
grammar=None,
|
| 56 |
planning_interval=None,
|
| 57 |
name=None,
|
| 58 |
description=None,
|
| 59 |
+
prompt_templates=prompt_templates + vwb.helium_instructions,
|
| 60 |
)
|
| 61 |
+
agent.python_executor("from helium import *")
|
| 62 |
|
| 63 |
|
| 64 |
GradioUI(agent).launch()
|