#!/usr/bin/env python3 from app.core.database import engine, get_db from app.models.website import WebsiteContent from sqlalchemy.orm import Session import json def add_sample_content(): """Add sample Shaqaf Medical content for testing""" sample_content = [ { "page_url": "http://localhost:3001/about", "content": "Shaqaf Medical is a leading healthcare innovation company founded in 2020. We specialize in advanced medical technologies, telemedicine solutions, and digital health platforms. Our mission is to revolutionize healthcare delivery through cutting-edge technology and compassionate care. We serve patients across the Middle East and North Africa region with state-of-the-art medical equipment and innovative treatment solutions.", }, { "page_url": "http://localhost:3001/services", "content": "Shaqaf Medical offers comprehensive healthcare services including: Telemedicine consultations with certified doctors, Advanced diagnostic imaging and laboratory services, Surgical equipment and medical devices, Digital health monitoring systems, Electronic health records management, Medical training and education programs, Healthcare IT consulting services. Our products include MRI machines, CT scanners, ultrasound equipment, patient monitoring systems, and mobile health applications.", }, { "page_url": "http://localhost:3001/products", "content": "Our product portfolio includes: Advanced MRI and CT imaging systems, Portable ultrasound devices, Patient monitoring equipment, Telemedicine platforms, Electronic health record systems, Medical mobile applications, Surgical instruments and tools, Laboratory diagnostic equipment. All products are FDA approved and meet international quality standards. We provide 24/7 technical support and maintenance services.", }, { "page_url": "http://localhost:3001/contact", "content": "Contact Shaqaf Medical: Address: 123 Medical Center Drive, Dubai Healthcare City, UAE. Phone: +971-4-123-4567. Email: info@shaqafmedical.com. Business Hours: Sunday to Thursday 8:00 AM - 6:00 PM, Saturday 9:00 AM - 2:00 PM. Emergency Support: Available 24/7 for critical medical equipment. Sales Inquiries: sales@shaqafmedical.com. Technical Support: support@shaqafmedical.com", } ] # Get database session db = next(get_db()) try: # Clear existing content for website_id 1 (assuming first website) db.query(WebsiteContent).filter(WebsiteContent.website_id == 1).delete() # Add sample content for content_data in sample_content: # Generate simple embedding (placeholder) embedding = [0.1] * 384 # Simple placeholder embedding db_content = WebsiteContent( website_id=1, # Assuming first website page_url=content_data["page_url"], content=content_data["content"], embedding=json.dumps(embedding) ) db.add(db_content) db.commit() print(f"Added {len(sample_content)} sample content entries for Shaqaf Medical") except Exception as e: print(f"Error adding sample content: {e}") db.rollback() finally: db.close() if __name__ == "__main__": add_sample_content()