Spaces:
Sleeping
Sleeping
Update tool.py
Browse files
tool.py
CHANGED
|
@@ -24,6 +24,7 @@ class SimpleTool(Tool):
|
|
| 24 |
"low fodmap"
|
| 25 |
],
|
| 26 |
"default": "none",
|
|
|
|
| 27 |
"description": "Select dietary restriction from the available options."
|
| 28 |
},
|
| 29 |
"laziness": {
|
|
@@ -34,7 +35,7 @@ class SimpleTool(Tool):
|
|
| 34 |
}
|
| 35 |
output_type = "string"
|
| 36 |
|
| 37 |
-
def forward(self, ingredients: str, diet: str = "none", laziness: Optional[int] = 5) -> str:
|
| 38 |
"""
|
| 39 |
Gets a recipe suggestion based on provided ingredients, dietary preference,
|
| 40 |
and your laziness level (1=active chef, 10=super lazy). After finding a recipe, it
|
|
@@ -55,7 +56,7 @@ class SimpleTool(Tool):
|
|
| 55 |
"none", "vegetarian", "vegan", "gluten free", "ketogenic",
|
| 56 |
"paleo", "pescetarian", "whole30", "halal", "low fodmap"
|
| 57 |
}
|
| 58 |
-
if diet not in valid_diets:
|
| 59 |
return f"Invalid diet option. Please choose from: {', '.join(sorted(valid_diets))}"
|
| 60 |
|
| 61 |
import os
|
|
|
|
| 24 |
"low fodmap"
|
| 25 |
],
|
| 26 |
"default": "none",
|
| 27 |
+
"nullable": True,
|
| 28 |
"description": "Select dietary restriction from the available options."
|
| 29 |
},
|
| 30 |
"laziness": {
|
|
|
|
| 35 |
}
|
| 36 |
output_type = "string"
|
| 37 |
|
| 38 |
+
def forward(self, ingredients: str, diet: Optional[str] = "none", laziness: Optional[int] = 5) -> str:
|
| 39 |
"""
|
| 40 |
Gets a recipe suggestion based on provided ingredients, dietary preference,
|
| 41 |
and your laziness level (1=active chef, 10=super lazy). After finding a recipe, it
|
|
|
|
| 56 |
"none", "vegetarian", "vegan", "gluten free", "ketogenic",
|
| 57 |
"paleo", "pescetarian", "whole30", "halal", "low fodmap"
|
| 58 |
}
|
| 59 |
+
if diet and diet not in valid_diets:
|
| 60 |
return f"Invalid diet option. Please choose from: {', '.join(sorted(valid_diets))}"
|
| 61 |
|
| 62 |
import os
|