Upload app.py
Browse files962 unmodified lines96396496596696796896917 unmodified lines98798898999099199299399499599699799899910001001100210031004100510061007100810092 unmodified lines101210131014101510161017101810191020102110222 unmodified lines1025102610271028102910301031103210331034103510361037103810391040962 unmodified linesstatus: str, prize_min: int, prize_max: int, challenge_type: str, track: str,sort_by: str, sort_order: str) -> Tuple[str, str]:# ...input validation, parsing...skills = [skill.strip() for skill in skills_input.split(',') if skill.strip()]user_profile = UserProfile(skills=skills,17 unmodified linesinsights = 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 stylingif recommendations:# Success header with data source infodata_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 cardsfor 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 panelinsights_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_htmlexcept 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);'>962 unmodified lines96396496596696796896997017 unmodified lines9889899909919929939949959969972 unmodified lines100010011002100310041005100610072 unmodified lines1010101110121013101410151016101710181019102010211022962 unmodified linesstatus: str, prize_min: int, prize_max: int, challenge_type: str, track: str,sort_by: str, sort_order: str) -> Tuple[str, str]:start_time = time.time()try:skills = [skill.strip() for skill in skills_input.split(',') if skill.strip()]user_profile = UserProfile(skills=skills,17 unmodified linesinsights = intelligence_engine.get_user_insights(user_profile)recommendations = recommendations_data["recommendations"]insights_data = recommendations_data["insights"]# Format results with enhanced stylingif recommendations: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>"""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 panelinsights_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_htmlexcept 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