Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
-
from llama_index.tools.wikipedia import WikipediaToolSpec
|
| 8 |
#from llama_index.agent.openai import OpenAIAgent
|
| 9 |
|
| 10 |
from Gradio_UI import GradioUI
|
|
@@ -21,12 +21,6 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 21 |
return "What magic will you build ?"
|
| 22 |
|
| 23 |
|
| 24 |
-
tool_spec = WikipediaToolSpec()
|
| 25 |
-
|
| 26 |
-
#agent = OpenAIAgent.from_tools(tool_spec.to_tool_list())
|
| 27 |
-
|
| 28 |
-
#agent.chat("Who is Ben Afflecks spouse?")
|
| 29 |
-
|
| 30 |
|
| 31 |
@tool
|
| 32 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -65,7 +59,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 65 |
|
| 66 |
agent = CodeAgent(
|
| 67 |
model=model,
|
| 68 |
-
tools=[final_answer, get_current_time_in_timezone, image_generation_tool
|
| 69 |
max_steps=6,
|
| 70 |
verbosity_level=1,
|
| 71 |
grammar=None,
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
+
#from llama_index.tools.wikipedia import WikipediaToolSpec
|
| 8 |
#from llama_index.agent.openai import OpenAIAgent
|
| 9 |
|
| 10 |
from Gradio_UI import GradioUI
|
|
|
|
| 21 |
return "What magic will you build ?"
|
| 22 |
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
@tool
|
| 26 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 59 |
|
| 60 |
agent = CodeAgent(
|
| 61 |
model=model,
|
| 62 |
+
tools=[final_answer, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
|
| 63 |
max_steps=6,
|
| 64 |
verbosity_level=1,
|
| 65 |
grammar=None,
|