Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,28 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
|
@@ -69,7 +91,8 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 69 |
|
| 70 |
agent = CodeAgent(
|
| 71 |
model=model,
|
| 72 |
-
tools=[final_answer, image_generation_tool, DuckDuckGoSearchTool()], ## add your tools here (don't remove final answer)
|
|
|
|
| 73 |
max_steps=20,
|
| 74 |
verbosity_level=1,
|
| 75 |
grammar=None,
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
+
@tool
|
| 11 |
+
def futuristic_profession_predictor(name: str) -> str:
|
| 12 |
+
"""Predicts the person's profession in the year 2050 based on their name.
|
| 13 |
+
|
| 14 |
+
Args:
|
| 15 |
+
name: The name of the person.
|
| 16 |
+
"""
|
| 17 |
+
professions = [
|
| 18 |
+
"Quantum Data Alchemist",
|
| 19 |
+
"Neural Interface Designer",
|
| 20 |
+
"AI-Powered Philosopher",
|
| 21 |
+
"Martian Agriculture Specialist",
|
| 22 |
+
"Virtual Reality Psychologist",
|
| 23 |
+
"Holographic Content Creator",
|
| 24 |
+
"Synthetic Biology Engineer",
|
| 25 |
+
"Time Travel Consultant",
|
| 26 |
+
"Cybersecurity Shaman"
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
prediction = random.choice(professions)
|
| 30 |
+
return f"In the year 2050, {name} will be a {prediction}!"
|
| 31 |
+
|
| 32 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 33 |
@tool
|
| 34 |
def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
|
|
|
| 91 |
|
| 92 |
agent = CodeAgent(
|
| 93 |
model=model,
|
| 94 |
+
#tools=[final_answer, image_generation_tool, DuckDuckGoSearchTool()], ## add your tools here (don't remove final answer)
|
| 95 |
+
tools = [final_answer, futuristic_profession_predictor],
|
| 96 |
max_steps=20,
|
| 97 |
verbosity_level=1,
|
| 98 |
grammar=None,
|