Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,10 +13,10 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
"""A tool that does nothing yet
|
| 15 |
Args:
|
| 16 |
-
arg1: the first argument
|
| 17 |
-
arg2: the second argument
|
| 18 |
"""
|
| 19 |
-
return "
|
| 20 |
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -24,6 +24,12 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 24 |
Args:
|
| 25 |
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
| 26 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
try:
|
| 28 |
# Create timezone object
|
| 29 |
tz = pytz.timezone(timezone)
|
|
@@ -36,7 +42,8 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 36 |
|
| 37 |
final_answer = FinalAnswerTool()
|
| 38 |
|
| 39 |
-
# If the agent does not answer, the model is overloaded, please use another model or the following
|
|
|
|
| 40 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 41 |
|
| 42 |
model = HfApiModel(
|
|
@@ -55,7 +62,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 55 |
|
| 56 |
agent = CodeAgent(
|
| 57 |
model=model,
|
| 58 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 59 |
max_steps=6,
|
| 60 |
verbosity_level=1,
|
| 61 |
grammar=None,
|
|
|
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
"""A tool that does nothing yet
|
| 15 |
Args:
|
| 16 |
+
arg1: the first argument is the name of any country in the world
|
| 17 |
+
arg2: the second argument is an integer that represent a number of cities in the country
|
| 18 |
"""
|
| 19 |
+
return "List the arg2 number cities in the stated country in arg1"
|
| 20 |
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 24 |
Args:
|
| 25 |
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
| 26 |
"""
|
| 27 |
+
@tool
|
| 28 |
+
def get_city_image(arg3: str) -> str:
|
| 29 |
+
"""A tool that fetches the statedd city name and draw them.
|
| 30 |
+
Args:
|
| 31 |
+
arg3: A string representing a valid city name (e.g., 'Lagos').
|
| 32 |
+
"""
|
| 33 |
try:
|
| 34 |
# Create timezone object
|
| 35 |
tz = pytz.timezone(timezone)
|
|
|
|
| 42 |
|
| 43 |
final_answer = FinalAnswerTool()
|
| 44 |
|
| 45 |
+
# If the agent does not answer, the model is overloaded, please use another model or the following
|
| 46 |
+
#Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 47 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 48 |
|
| 49 |
model = HfApiModel(
|
|
|
|
| 62 |
|
| 63 |
agent = CodeAgent(
|
| 64 |
model=model,
|
| 65 |
+
tools=[final_answer, image_generation_tool], ## add your tools here (don't remove final answer)
|
| 66 |
max_steps=6,
|
| 67 |
verbosity_level=1,
|
| 68 |
grammar=None,
|