import streamlit as st lawyer_db = [ {"id": 1, "name": "Rajesh Kumar", "specialty": "Criminal", "experience": "11-20 years", "cost_range": "High", "location": "Jabalpur", "rating": 4.8, "description": "Specializes in IPC cases, has successfully defended in multiple murder trials."}, {"id": 2, "name": "Priya Sharma", "specialty": "Family", "experience": "6-10 years", "cost_range": "Medium", "location": "Bhopal", "rating": 4.5, "description": "Expert in divorce cases and child custody battles under Hindu Marriage Act."}, {"id": 3, "name": "Amit Patel", "specialty": "Corporate", "experience": "20+ years", "cost_range": "Very High", "location": "Indore", "rating": 4.9, "description": "Handled major mergers and acquisitions, expert in Company Law and SEBI regulations."}, {"id": 4, "name": "Neha Gupta", "specialty": "Immigration", "experience": "0-5 years", "cost_range": "Low", "location": "Gwalior", "rating": 4.2, "description": "Specializes in student visas and work permits for IT professionals."}, {"id": 5, "name": "Vikram Singh", "specialty": "Criminal", "experience": "11-20 years", "cost_range": "Medium", "location": "Bhopal", "rating": 4.7, "description": "Former public prosecutor, expert in cybercrime cases under IT Act."}, {"id": 6, "name": "Anita Desai", "specialty": "Family", "experience": "20+ years", "cost_range": "High", "location": "Indore", "rating": 4.6, "description": "Specializes in inter-faith marriages and Special Marriage Act cases."}, {"id": 7, "name": "Sanjay Mehta", "specialty": "Corporate", "experience": "11-20 years", "cost_range": "High", "location": "Jabalpur", "rating": 4.5, "description": "Expert in Intellectual Property Rights and patent law."}, {"id": 8, "name": "Kavita Reddy", "specialty": "Immigration", "experience": "6-10 years", "cost_range": "Medium", "location": "Bhopal", "rating": 4.3, "description": "Specializes in NRI property disputes and OCI card issues."}, {"id": 9, "name": "Arjun Malhotra", "specialty": "Criminal", "experience": "20+ years", "cost_range": "Very High", "location": "Indore", "rating": 4.9, "description": "Renowned for handling high-profile corruption cases under Prevention of Corruption Act."}, {"id": 10, "name": "Deepa Joshi", "specialty": "Family", "experience": "0-5 years", "cost_range": "Low", "location": "Gwalior", "rating": 4.1, "description": "Focuses on domestic violence cases under Protection of Women from Domestic Violence Act."}, {"id": 11, "name": "Rahul Verma", "specialty": "Corporate", "experience": "6-10 years", "cost_range": "Medium", "location": "Jabalpur", "rating": 4.4, "description": "Specializes in startup law and venture capital regulations."}, {"id": 12, "name": "Sunita Agarwal", "specialty": "Immigration", "experience": "11-20 years", "cost_range": "High", "location": "Bhopal", "rating": 4.7, "description": "Expert in handling complex deportation cases and appeals."}, {"id": 13, "name": "Kiran Bedi", "specialty": "Criminal", "experience": "20+ years", "cost_range": "Very High", "location": "Indore", "rating": 4.8, "description": "Former IPS officer, specializes in police brutality and human rights violation cases."}, {"id": 14, "name": "Vivek Chauhan", "specialty": "Family", "experience": "11-20 years", "cost_range": "High", "location": "Gwalior", "rating": 4.6, "description": "Expert in adoption cases and surrogacy law in India."}, {"id": 15, "name": "Meera Saxena", "specialty": "Corporate", "experience": "20+ years", "cost_range": "Very High", "location": "Jabalpur", "rating": 4.9, "description": "Specializes in banking law and financial regulations, handled major NPAs cases."}, {"id": 16, "name": "Alok Nath", "specialty": "Immigration", "experience": "6-10 years", "cost_range": "Medium", "location": "Bhopal", "rating": 4.3, "description": "Expert in handling asylum cases and refugee status applications."}, {"id": 17, "name": "Pooja Bhatt", "specialty": "Criminal", "experience": "0-5 years", "cost_range": "Low", "location": "Indore", "rating": 4.2, "description": "Specializes in juvenile justice cases under Juvenile Justice Act."}, {"id": 18, "name": "Rohit Sharma", "specialty": "Family", "experience": "11-20 years", "cost_range": "High", "location": "Gwalior", "rating": 4.7, "description": "Expert in handling LGBTQ+ rights cases and same-sex partnership issues."}, {"id": 19, "name": "Nandini Roy", "specialty": "Corporate", "experience": "6-10 years", "cost_range": "Medium", "location": "Jabalpur", "rating": 4.5, "description": "Specializes in environmental law and corporate social responsibility cases."}, {"id": 20, "name": "Ajay Devgan", "specialty": "Immigration", "experience": "20+ years", "cost_range": "Very High", "location": "Bhopal", "rating": 4.8, "description": "Expert in handling complex citizenship cases and constitutional challenges."}, {"id": 21, "name": "Ravi Shankar", "specialty": "Criminal", "experience": "6-10 years", "cost_range": "Medium", "location": "Jabalpur", "rating": 4.4, "description": "Specializes in white-collar crimes and economic offenses."}, {"id": 22, "name": "Anjali Kapoor", "specialty": "Family", "experience": "20+ years", "cost_range": "Very High", "location": "Bhopal", "rating": 4.8, "description": "Expert in high-net-worth divorce cases and property disputes."}, {"id": 23, "name": "Suresh Patel", "specialty": "Corporate", "experience": "0-5 years", "cost_range": "Low", "location": "Indore", "rating": 4.0, "description": "Focuses on startup incorporation and compliance issues."}, {"id": 24, "name": "Preeti Singhania", "specialty": "Immigration", "experience": "11-20 years", "cost_range": "High", "location": "Gwalior", "rating": 4.6, "description": "Specializes in business immigration and investor visas."}, {"id": 25, "name": "Arun Jaitley", "specialty": "Criminal", "experience": "20+ years", "cost_range": "Very High", "location": "Jabalpur", "rating": 4.9, "description": "Renowned for handling high-profile criminal cases and constitutional matters."}, {"id": 26, "name": "Shalini Mishra", "specialty": "Family", "experience": "6-10 years", "cost_range": "Medium", "location": "Indore", "rating": 4.3, "description": "Specializes in child rights and juvenile law."}, {"id": 27, "name": "Vijay Mallya", "specialty": "Corporate", "experience": "11-20 years", "cost_range": "High", "location": "Bhopal", "rating": 4.7, "description": "Expert in corporate restructuring and insolvency cases."}, {"id": 28, "name": "Aarti Chabria", "specialty": "Immigration", "experience": "0-5 years", "cost_range": "Low", "location": "Jabalpur", "rating": 4.1, "description": "Focuses on family-based immigration and naturalization cases."}, {"id": 29, "name": "Ranveer Kapoor", "specialty": "Criminal", "experience": "6-10 years", "cost_range": "Medium", "location": "Gwalior", "rating": 4.4, "description": "Specializes in drug-related offenses and NDPS Act cases."}, {"id": 30, "name": "Sneha Agarwal", "specialty": "Family", "experience": "11-20 years", "cost_range": "High", "location": "Bhopal", "rating": 4.6, "description": "Expert in handling complex custody battles and international family law cases."}, {"id": 31, "name": "Raj Malhotra", "specialty": "Corporate", "experience": "20+ years", "cost_range": "Very High", "location": "Indore", "rating": 4.9, "description": "Specializes in cross-border transactions and international trade law."}, {"id": 32, "name": "Zoya Khan", "specialty": "Immigration", "experience": "6-10 years", "cost_range": "Medium", "location": "Jabalpur", "rating": 4.3, "description": "Expert in handling visa appeals and deportation defense cases."}, {"id": 33, "name": "Aryan Khanna", "specialty": "Criminal", "experience": "0-5 years", "cost_range": "Low", "location": "Bhopal", "rating": 4.0, "description": "Focuses on petty crimes and first-time offender cases."}, {"id": 34, "name": "Ishaan Sharma", "specialty": "Family", "experience": "20+ years", "cost_range": "Very High", "location": "Gwalior", "rating": 4.8, "description": "Renowned for handling high-profile divorce cases involving public figures."}, {"id": 35, "name": "Aditi Rao", "specialty": "Corporate", "experience": "11-20 years", "cost_range": "High", "location": "Indore", "rating": 4.7, "description": "Specializes in corporate governance and compliance issues."}, {"id": 36, "name": "Kabir Singh", "specialty": "Immigration", "experience": "20+ years", "cost_range": "Very High", "location": "Jabalpur", "rating": 4.9, "description": "Expert in complex immigration litigation and federal court appeals."}, {"id": 37, "name": "Neha Dhupia", "specialty": "Criminal", "experience": "11-20 years", "cost_range": "High", "location": "Bhopal", "rating": 4.6, "description": "Specializes in cyber law and online fraud cases."}, {"id": 38, "name": "Rajat Kapoor", "specialty": "Family", "experience": "0-5 years", "cost_range": "Low", "location": "Indore", "rating": 4.1, "description": "Focuses on family mediation and collaborative divorce processes."}, {"id": 39, "name": "Dia Mirza", "specialty": "Corporate", "experience": "6-10 years", "cost_range": "Medium", "location": "Gwalior", "rating": 4.4, "description": "Specializes in entertainment law and intellectual property rights in media."}, {"id": 40, "name": "Farhan Akhtar", "specialty": "Immigration", "experience": "11-20 years", "cost_range": "High", "location": "Bhopal", "rating": 4.7, "description": "Expert in handling employment-based immigration and labor certification cases."} ] def search_lawyers(category, cost_range, experience, location): print(f"Searching for - Category: {category}, Cost Range: {cost_range}, Experience: {experience}, Location: {location}") def find_matches(specialty_match, cost_match, experience_match, location_match): return [ lawyer for lawyer in lawyer_db if (specialty_match == "any" or lawyer["specialty"] == category) and (cost_match == "any" or lawyer["cost_range"] == cost_range) and (experience_match == "any" or lawyer["experience"] == experience) and (location_match == "any" or lawyer["location"] == location) ] # Try exact match matching_lawyers = find_matches(category, cost_range, experience, location) # Relax location if not matching_lawyers: matching_lawyers = find_matches(category, cost_range, experience, "any") print("Relaxed location criteria") # Relax cost range if not matching_lawyers: matching_lawyers = find_matches(category, "any", experience, "any") print("Relaxed cost range criteria") # Relax experience if not matching_lawyers: matching_lawyers = find_matches(category, "any", "any", "any") print("Relaxed experience criteria") # Relax specialty (return all lawyers if no matches found) if not matching_lawyers: matching_lawyers = find_matches("any", "any", "any", "any") print("Relaxed all criteria") print(f"Total matches found: {len(matching_lawyers)}") return matching_lawyers def on_click_toggle(): st.session_state.update({ "selected_model": "gpt-4o" if st.session_state["selected_model"] == "gpt-3.5-turbo-16k" else "gpt-3.5-turbo-16k" })