Spaces:
Runtime error
Runtime error
| import asyncio | |
| import os | |
| from unittest.mock import MagicMock | |
| from app.services.industry_ai import IndustryAI | |
| async def verify_industry_medical(): | |
| # Mock NLP to avoid spacy dependency during quick validation | |
| industry_ai = IndustryAI() | |
| industry_ai.nlp = MagicMock() | |
| industry_ai.nlp.tokenize_and_clean.return_value = ["diabetes"] | |
| industry_ai.nlp.extract_medical_details.return_value = {} | |
| test_queries = [ | |
| "What is diabetes?", | |
| "What diseases are associated with fever?", | |
| "I have a mild fever—should I rest or see a doctor?" | |
| ] | |
| print("\n--- IndustryAI Healthcare Integration Verification (Mocked NLP) ---") | |
| for query in test_queries: | |
| print(f"\nQuery: {query}") | |
| # Intent 'medical_consult' to trigger healthcare logic | |
| response, confidence, needs_contact = await industry_ai.get_industry_dataset_response( | |
| query, | |
| industry="healthcare", | |
| config={"intent": "medical_consult"} | |
| ) | |
| print(f"Confidence: {confidence}") | |
| print(f"Response Snippet: {response[:150]}...") | |
| print("\n------------------------------------------------------------------") | |
| if __name__ == "__main__": | |
| asyncio.run(verify_industry_medical()) | |