Spaces:
Runtime error
Runtime error
Upload 11 files
Browse files- athletic_performance.py +15 -14
athletic_performance.py
CHANGED
|
@@ -971,28 +971,29 @@ def get_ai_sports_coaching_analysis(jump_height_cm, user_height_cm, gender, favo
|
|
| 971 |
# Format favorite sports list
|
| 972 |
sports_list = ", ".join(favorite_sports) if favorite_sports else "None specified"
|
| 973 |
|
| 974 |
-
prompt = f"""
|
| 975 |
|
| 976 |
-
ATHLETE
|
| 977 |
- Gender: {gender}
|
| 978 |
- Height: {user_height_cm} cm
|
| 979 |
- Jump Height: {jump_height_cm:.2f} cm
|
| 980 |
-
-
|
| 981 |
-
- Flight Time: {flight_time_str} seconds
|
| 982 |
-
- Peak Power Output: {peak_power_str} watts
|
| 983 |
-
- Rate of Force Development: {rfd_str}
|
| 984 |
-
- Favorite Sports: {sports_list}
|
| 985 |
|
| 986 |
-
|
| 987 |
-
Please provide a comprehensive analysis with exactly these two sections:
|
| 988 |
|
| 989 |
-
|
| 990 |
-
|
|
|
|
|
|
|
|
|
|
| 991 |
|
| 992 |
-
|
| 993 |
-
|
|
|
|
|
|
|
|
|
|
| 994 |
|
| 995 |
-
|
| 996 |
|
| 997 |
# Prepare the API request - try Gemini 1.5 Pro as fallback
|
| 998 |
url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro:generateContent"
|
|
|
|
| 971 |
# Format favorite sports list
|
| 972 |
sports_list = ", ".join(favorite_sports) if favorite_sports else "None specified"
|
| 973 |
|
| 974 |
+
prompt = f"""You are a sports coach. Based on this athlete's jump performance, provide a simple analysis:
|
| 975 |
|
| 976 |
+
ATHLETE DATA:
|
| 977 |
- Gender: {gender}
|
| 978 |
- Height: {user_height_cm} cm
|
| 979 |
- Jump Height: {jump_height_cm:.2f} cm
|
| 980 |
+
- Sports: {sports_list}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 981 |
|
| 982 |
+
PROVIDE EXACTLY THIS FORMAT:
|
|
|
|
| 983 |
|
| 984 |
+
**PERCENTILE RANKINGS:**
|
| 985 |
+
- Basketball: [number]th percentile
|
| 986 |
+
- Volleyball: [number]th percentile
|
| 987 |
+
- Swimming: [number]th percentile
|
| 988 |
+
(Only include the sports from their list: {sports_list})
|
| 989 |
|
| 990 |
+
**IMPROVEMENT TIPS:**
|
| 991 |
+
1. [One simple sentence about technique]
|
| 992 |
+
2. [One simple sentence about training]
|
| 993 |
+
3. [One simple sentence about strength/power]
|
| 994 |
+
4. [One simple sentence about specific skill]
|
| 995 |
|
| 996 |
+
Keep it simple for beginner athletes. Use basic English. No long explanations."""
|
| 997 |
|
| 998 |
# Prepare the API request - try Gemini 1.5 Pro as fallback
|
| 999 |
url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro:generateContent"
|