Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,20 +85,19 @@ def determine_user_preference(user_input: str) -> bool:
|
|
| 85 |
|
| 86 |
|
| 87 |
@tool
|
| 88 |
-
def get_lifestyle_recommendations(age: int,user_input: str) -> str:
|
| 89 |
"""Fetches lifestyle recommendations based on age.
|
| 90 |
Args:
|
| 91 |
age: The calculated age of the user.
|
| 92 |
user_input: The user's input as natural language.
|
| 93 |
Returns:
|
| 94 |
-
A summary of lifestyle recommendations.
|
| 95 |
"""
|
| 96 |
if determine_user_preference(user_input):
|
| 97 |
-
|
| 98 |
else:
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
return recommendations
|
| 102 |
|
| 103 |
# 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:
|
| 104 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
|
| 85 |
|
| 86 |
|
| 87 |
@tool
|
| 88 |
+
def get_lifestyle_recommendations(age: int, user_input: str) -> str:
|
| 89 |
"""Fetches lifestyle recommendations based on age.
|
| 90 |
Args:
|
| 91 |
age: The calculated age of the user.
|
| 92 |
user_input: The user's input as natural language.
|
| 93 |
Returns:
|
| 94 |
+
A summary of lifestyle recommendations as a string.
|
| 95 |
"""
|
| 96 |
if determine_user_preference(user_input):
|
| 97 |
+
return get_lifestyle_recommendations_web(age) # Web search
|
| 98 |
else:
|
| 99 |
+
return get_lifestyle_recommendations_offline(age) # Offline dataset
|
| 100 |
+
|
|
|
|
| 101 |
|
| 102 |
# 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:
|
| 103 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|