SHAMIL SHAHBAZ AWAN commited on
Update app.py
Browse files19 unmodified lines20212223232425267 unmodified lines34353637383940414230 unmodified lines737475767773747576787980818283848519 unmodified lines """ Use Tavily API to fetch real-time suggestions based on location and need. """ query = f"Provide affordable internet providers or satellite internet services for rural areas near {location}, especially for low-income families." query = f"Provide internet connectivity options for rural areas near {location}, especially affordable providers." try: # Execute the query using TavilyClient7 unmodified lines """ Use the Groq model to enhance and organize the suggestions. """ if suggestions == "No suggestions available.": return "It seems like we couldn't find any suggestions. Try asking in a different way or checking with local ISPs." groq_client = Groq(api_key=GROQ_API_KEY) try:30 unmodified lines st.write("Raw Suggestions from Tavily:") st.write(tavily_suggestions)
# Check if the response is empty before passing to Groq if tavily_suggestions != "No suggestions available.": # Enhance the response using Groq enhanced_suggestions = enhance_with_groq(tavily_suggestions) st.subheader("Enhanced Suggestions:") st.write(enhanced_suggestions) # Enhance the response using Groq enhanced_suggestions = enhance_with_groq(tavily_suggestions) st.subheader("Enhanced Suggestions:") st.write(enhanced_suggestions) else: st.warning("No suggestions available. Try refining your query.") else: st.warning("Please enter your location to get recommendations.")app.py+12-5