Spaces:
Runtime error
Runtime error
Download knowledge_base.py from siddani93/AIFAQSystem: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/siddani93/AIFAQSystem/resolve/main/knowledge_base.py
- Command line
-
hf download hf://spaces/siddani93/AIFAQSystem/knowledge_base.py
-
curl -L -o knowledge_base.py https://huggingface.co/spaces/siddani93/AIFAQSystem/resolve/main/knowledge_base.py
1.15 kB
| # Predefined Industrial Q&A | |
| INDUSTRIAL_KNOWLEDGE = { | |
| "refund": { | |
| "question": "How long does refund processing take?", | |
| "answer": "Standard refund processing takes 5-7 business days. Expedited options available for enterprise accounts.", | |
| "sources": ["finance_policy_v3.2", "customer_service_handbook"] | |
| }, | |
| "invoice": { | |
| "question": "Where can I find my invoice?", | |
| "answer": "Access invoices through:\n1. Customer portal (portal.example.com)\n2. Automated email system\n3. API integration (contact support@example.com)", | |
| "sources": ["billing_system_guide", "API_docs"] | |
| }, | |
| "shipment": { | |
| "question": "How to track shipments?", | |
| "answer": "Track shipments using:\n- Tracking ID via website\n- Mobile app notifications\n- ERP system integration (Contact IT team)", | |
| "sources": ["shipping_policy", "ERP_manual"] | |
| } | |
| } | |
| def get_industrial_answer(query: str) -> dict: | |
| """Check against predefined industrial knowledge""" | |
| query = query.lower() | |
| for key in INDUSTRIAL_KNOWLEDGE: | |
| if key in query: | |
| return INDUSTRIAL_KNOWLEDGE[key] | |
| return None |