Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,37 +20,6 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
20 |
"""
|
21 |
return "What magic will you build ?"
|
22 |
|
23 |
-
def generate_recipe(calories: int, diet: str = "normal") -> str:
|
24 |
-
"""Genera una receta basada en la cantidad de calorías y la dieta preferida.
|
25 |
-
|
26 |
-
Args:
|
27 |
-
calories: La cantidad de calorías deseadas en la receta.
|
28 |
-
diet: El tipo de dieta (normal, vegano, keto, alto en proteínas, etc.).
|
29 |
-
|
30 |
-
Returns:
|
31 |
-
Una receta generada según los parámetros.
|
32 |
-
"""
|
33 |
-
recipes = {
|
34 |
-
"normal": [
|
35 |
-
f"Ensalada César con pollo ({calories} kcal)",
|
36 |
-
f"Pasta con salsa de tomate y albóndigas ({calories} kcal)"
|
37 |
-
],
|
38 |
-
"vegano": [
|
39 |
-
f"Tofu salteado con vegetales y arroz integral ({calories} kcal)",
|
40 |
-
f"Ensalada de quinoa con aguacate y garbanzos ({calories} kcal)"
|
41 |
-
],
|
42 |
-
"keto": [
|
43 |
-
f"Salmón a la plancha con espárragos y mantequilla ({calories} kcal)",
|
44 |
-
f"Huevos revueltos con aguacate y queso ({calories} kcal)"
|
45 |
-
],
|
46 |
-
"proteínas": [
|
47 |
-
f"Pollo a la plancha con batata y brócoli ({calories} kcal)",
|
48 |
-
f"Batido de proteínas con plátano y mantequilla de maní ({calories} kcal)"
|
49 |
-
]
|
50 |
-
}
|
51 |
-
|
52 |
-
return random.choice(recipes.get(diet, recipes["normal"]))
|
53 |
-
|
54 |
@tool
|
55 |
def get_current_time_in_timezone(timezone: str) -> str:
|
56 |
"""A tool that fetches the current local time in a specified timezone.
|
@@ -68,6 +37,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
68 |
|
69 |
|
70 |
final_answer = FinalAnswerTool()
|
|
|
71 |
|
72 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
73 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
20 |
"""
|
21 |
return "What magic will you build ?"
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
@tool
|
24 |
def get_current_time_in_timezone(timezone: str) -> str:
|
25 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
37 |
|
38 |
|
39 |
final_answer = FinalAnswerTool()
|
40 |
+
generate_recipe = RecipeGeneratorTool()
|
41 |
|
42 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
43 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|