Upload app.py
Browse files962 unmodified lines96396496596696696796896997017 unmodified lines98898999099099199299399499599699799899910001001991992993100499410069959969972 unmodified lines100010011002101510161003100410191005100610072 unmodified lines10101011101210281013101410311015101610171035101810371019102010211022962 unmodified lines status: str, prize_min: int, prize_max: int, challenge_type: str, track: str,
sort_by: str, sort_order: str
) -> Tuple[str, str]:
# ...input validation, parsing...
start_time = time.time()
try:
skills = [skill.strip() for skill in skills_input.split(',') if skill.strip()]
user_profile = UserProfile(
skills=skills,17 unmodified lines insights = intelligence_engine.get_user_insights(user_profile)
recommendations = recommendations_data["recommendations"]
insights_data = recommendations_data["insights"]
real_challenges = await intelligence_engine.fetch_real_challenges(
user_profile=user_profile,
query=interests,
limit=50,
status=status,
prize_min=prize_min,
prize_max=prize_max,
challenge_type=challenge_type,
track=track,
sort_by=sort_by,
sort_order=sort_order,
)
# Format results with enhanced styling
if recommendations:
# Success header with data source info
data_source_emoji = "🔥" if "REAL" in insights_data['data_source'] else "⚡"
recommendations_html = f"""
<div style='background:linear-gradient(135deg,#00b894,#00a085);color:white;padding:20px;border-radius:12px;margin-bottom:25px;text-align:center;box-shadow:0 8px 25px rgba(0,184,148,0.3);'>
<div style='font-size:2.5em;margin-bottom:10px;'>{data_source_emoji}</div>2 unmodified lines <div style='opacity:0.9;font-size:0.9em;margin-top:5px;'>Source: {insights_data['data_source']}</div>
</div>
"""
# Add formatted challenge cards
for challenge in recommendations:
recommendations_html += format_challenge_card(challenge)
else:
recommendations_html = """
<div style='background:linear-gradient(135deg,#fdcb6e,#e17055);color:white;padding:25px;border-radius:12px;text-align:center;box-shadow:0 8px 25px rgba(253,203,110,0.3);'>2 unmodified lines <div style='opacity:0.9;font-size:1em;'>Try adjusting your skills, experience level, or interests for better results</div>
</div>
"""
# Generate insights panel
insights_html = format_insights_panel(insights)
processing_time = round(time.time() - start_time, 3)
print(f"✅ ULTIMATE request completed successfully in {processing_time}s")
print(f"📊 Returned {len(recommendations)} recommendations with comprehensive insights\n")
return recommendations_html, insights_html
except Exception as e:
error_msg = f"""
<div style='background:linear-gradient(135deg,#e17055,#d63031);color:white;padding:25px;border-radius:12px;text-align:center;box-shadow:0 8px 25px rgba(225,112,85,0.3);'>app.py+4-22