Spaces:
Sleeping
Sleeping
Download app.py from StSAdmin/SofTouch-Chatbot: direct link, hf CLI and curl.
- Browser
- Download file 9.63 kB
-
https://huggingface.co/spaces/StSAdmin/SofTouch-Chatbot/resolve/refs%2Fpr%2F13/app.py
- Command line
-
hf download hf://spaces/StSAdmin/SofTouch-Chatbot@refs/pr/13/app.py
-
curl -L -o app.py https://huggingface.co/spaces/StSAdmin/SofTouch-Chatbot/resolve/refs%2Fpr%2F13/app.py
9.63 kB
| import gradio as gr | |
| from sentence_transformers import SentenceTransformer, util | |
| # Load semantic similarity model | |
| model = SentenceTransformer('all-MiniLM-L6-v2') | |
| ## Custom theme params (matches current website colors) | |
| #sts_theme = gr.themes.Default( | |
| # primary_hue="blue", | |
| # secondary_hue="orange", | |
| # neutral_hue="gray" | |
| #).set( | |
| # # VALID parameters (no chatbot-specific overrides) | |
| # button_primary_background_fill="#FF6B00", # Orange | |
| # button_primary_text_color="#FFFFFF", # White text | |
| # button_primary_background_fill_hover="#E05D00", # Darker orange | |
| ## body_background_fill="#E9ECEF", # Light gray (main bg) | |
| ## body_background_fill_dark="#E9ECEF", # Force light mode | |
| # block_background_fill="#FFFFFF", # Message bubbles | |
| # border_color_primary="#0056B3" # Dark blue borders | |
| #) | |
| # SofTouch Systems FAQs | |
| faq_data = { | |
| "Who is SofTouch Systems?": "Derek Moyes founded SofTouch Systems in 1993 as a sole-proprietorship in San Antonio, Texas. Today, SofTouch Systems has an extensive list of customers, including home users, non-profits, and small & medium businesses.", | |
| "What is SofTouch Systems?": "SofTouch Systems is a Managed Service Provider (MSP) offering IT support, cybersecurity, backups, and expert consulting for businesses and nonprofits.", | |
| "What services do you offer?": "We offer managed IT services, cybersecurity, cloud consulting, server management, data backups, compliance support, and more.", | |
| "Do you support remote workers?": "Yes, we offer secure remote access, VPN setup, and remote IT support for distributed teams.", | |
| "How do I get help from your team?": "You can reach support via email at support@sofTouchSystems.com or by calling 1-800-555-1234.", | |
| "Can you monitor our network 24/7?": "Absolutely. We offer continuous network monitoring and real-time threat alerts.", | |
| "Do you provide on-site support?": "Yes, we provide both remote and on-site support depending on your business needs.", | |
| "Do you offer backup and disaster recovery services?": "Yes, we offer cloud, local, and hybrid backups, plus full disaster recovery planning.", | |
| "What industries do you specialize in?": "We work with small to mid-sized businesses and nonprofits, especially across Central and South Texas.", | |
| "Can you help us migrate to the cloud?": "Yes, we manage cloud migrations to AWS, Azure, Google Workspace, and private cloud platforms.", | |
| "Do you offer monthly service contracts?": "Yes, we offer flexible managed IT service plans based on your business size and needs.", | |
| "What does a managed service provider do?": "We proactively manage and secure your IT systems so you can focus on running your business.", | |
| "Do you offer cybersecurity assessments?": "Yes, we offer comprehensive cybersecurity audits and recommendations for improvement.", | |
| "Can you manage our email systems?": "Yes, we provide secure and reliable email hosting and management services.", | |
| "How often do you perform updates and patches?": "We patch systems regularly, usually weekly, and critical updates are handled immediately.", | |
| "What is your response time for emergencies?": "We respond to emergencies within 1 hour, and most issues are resolved same-day.", | |
| "Can you support Apple/Mac devices?": "Yes, we support both Windows and Apple environments.", | |
| "Do you manage printers and other devices?": "Yes, we can manage printers, scanners, and other networked devices.", | |
| "Do you offer firewall setup and management?": "Yes, we install and manage business-grade firewalls and advanced threat protection.", | |
| "Can you help with password management?": "Yes, we offer password policy enforcement and integrate password manager solutions.", | |
| "How do you protect against ransomware?": "We use endpoint protection, backup redundancy, and real-time threat detection.", | |
| "What happens if our internet goes down?": "We help you set up failover connections and local network resilience options.", | |
| "Do you help with IT compliance?": "Yes, we support HIPAA, PCI-DSS, and general IT compliance frameworks.", | |
| "Can you set up Microsoft 365 or Google Workspace?": "Yes, we offer licensing, setup, migration, and management for both platforms.", | |
| "How do I request a service call?": "You can email, call, or use our customer portal to request service anytime.", | |
| "Do you offer antivirus software?": "Yes, we provide managed antivirus and endpoint protection as part of our packages.", | |
| "Can you help us reduce IT costs?": "Yes, we optimize systems and consolidate services to cut unnecessary expenses.", | |
| "Do you help with technology planning?": "Absolutely. We provide long-term IT roadmapping and infrastructure planning.", | |
| "What is the onboarding process like?": "We do a full audit, deploy monitoring tools, and start support within 1–2 weeks.", | |
| "Do you offer data encryption?": "Yes, we implement encryption for devices, cloud storage, and data in transit.", | |
| "Can we keep our current hardware?": "Yes, we assess your equipment and integrate it where possible to save costs.", | |
| "What makes you different from other MSPs?": "We're veteran-owned, Texas-based, and known for fast response and friendly service.", | |
| "Do you train employees on cybersecurity?": "Yes, we offer phishing simulations and security awareness training.", | |
| "What’s included in your managed services?": "Monitoring, help desk, patches, backups, security, and strategic advice.", | |
| "Can you integrate third-party apps or CRMs?": "Yes, we work with CRMs, ERPs, and other business platforms.", | |
| "Do you offer VoIP phone system support?": "Yes, we can help with VoIP setup, support, and vendor coordination.", | |
| "Can you help us set up secure remote desktop access?": "Yes, we use tools like RDP over VPN and encrypted remote agents.", | |
| "Do you offer documentation for our systems?": "Yes, we provide IT documentation so you always know what’s in place.", | |
| "What kind of reports will I get?": "You’ll receive monthly reports on uptime, patches, security events, and more.", | |
| "Is there a contract required?": "We offer both contract and no-contract month-to-month options.", | |
| "How fast can we get started?": "We can start with a discovery call immediately and usually onboard within 5–10 business days.", | |
| "Do you offer IT strategy consulting?": "Yes, we help align your tech decisions with your business goals.", | |
| "Can you help with business continuity planning?": "Absolutely. We create BCPs tailored to your specific risk profile.", | |
| "Do you offer mobile device management?": "Yes, we secure and monitor business smartphones, tablets, and laptops.", | |
| "What’s your pricing structure like?": "We offer fixed monthly pricing, tiered service plans, and pay-as-you-go support.", | |
| "Do you work with nonprofits?": "Yes, we serve many nonprofits and offer discounted rates for 501(c)(3) organizations.", | |
| "Do you help with internet setup?": "Yes, we assist with ISP selection, router/firewall setup, and cabling.", | |
| "Can you help us prevent phishing attacks?": "Yes, we use anti-phishing tools, filtering, and user training.", | |
| "Will we have a dedicated point of contact?": "Yes, every client gets an account manager and dedicated tech lead.", | |
| "Do you support cloud storage?": "Yes, we manage OneDrive, Google Drive, Dropbox, and other cloud platforms.", | |
| "How do you back up email?": "We provide email archiving, daily backups, and retention policy management." | |
| } | |
| # Precompute embeddings for questions | |
| faq_questions = list(faq_data.keys()) | |
| faq_embeddings = model.encode(faq_questions, convert_to_tensor=True) | |
| import difflib | |
| def chatbot(message, history): | |
| # Convert input to lowercase for better matching | |
| user_input = message.lower() | |
| # Extract the list of questions | |
| questions = list(faq_data.keys()) | |
| # Use difflib to find closest match | |
| closest_match = difflib.get_close_matches(user_input, questions, n=1, cutoff=0.5) | |
| if closest_match: | |
| matched_question = closest_match[0] | |
| return faq_data[matched_question] | |
| else: | |
| return "I'm still learning. Try asking about our services, support, cybersecurity, or backups." | |
| iface = gr.ChatInterface( | |
| fn=chatbot, | |
| title="VELMA© - Virtual Engagement Liaison & Messaging Assistant", | |
| description="Try asking about our services, support, cybersecurity, or backups.", | |
| type="messages", | |
| css=""" | |
| .gradio-container { | |
| background: #e9ecef !important; | |
| border-radius: 8px !important; | |
| } | |
| .chatbot { | |
| display: flex !important; | |
| flex-direction: column !important; | |
| gap: 8px !important; | |
| } | |
| .user-message { | |
| padding: 10px 16px !important; | |
| margin: 4px 0 !important; | |
| border-radius: 18px 18px 0 18px !important; | |
| background: #0056b3 !important; | |
| color: white !important; | |
| max-width: 80%; | |
| align-self: flex-end; | |
| } | |
| .bot-message { | |
| padding: 10px 16px !important; | |
| margin: 4px 0 !important; | |
| border-radius: 18px 18px 18px 0 !important; | |
| background: white !important; | |
| border: 1px solid #ddd !important; | |
| max-width: 80%; | |
| align-self: flex-start; | |
| } | |
| .submit-button { | |
| background: #ff6b00 !important; | |
| color: white !important; | |
| } | |
| .submit-button:hover { | |
| background: #e05d00 !important; | |
| } | |
| """, | |
| allow_screenshot=False, | |
| theme=gr.themes.Soft() # Optional: Start with a clean theme | |
| ) | |
| iface.launch(share=True) |