How arsentievalex/safewatch works
Main Components
• Frontend (User Interface):
• Represented by the Streamlit app (app.py) that drives the entire UI.
• It provides pages for user profile selection, trigger preference configuration, and displaying analyzed results.
• Backend & Processing Modules:
• Video Download: The yt_download.py handles fetching video content directly from YouTube URLs.
• Video Analysis: The video_analysis directory stores JSON files with analysis results, signifying processed data.
• Content Understanding: The content_understanding.py integrates with Azure’s AI Content Understanding service.
• AI Response Generation: The llm_inference.py module acts as the LLM-based module for personalized insights.
• Azure Storage: The azure_storage.py module interacts with Azure Blob Storage, managing file persistence.
• Utility Functions: The utils.py module contains common helper routines.
• External Services:
• Azure AI Foundry & Content Understanding: Identified by the integration in content_understanding.py.
• Azure Blob Storage: Supported by the azure_storage.py integration.
Relationships and Interactions
• The User Interface (app.py) collects user inputs (e.g., YouTube video URLs, trigger preferences) and forwards these inputs to backend modules.
• The yt_download.py module downloads video content based on user-provided YouTube URLs.
• After downloading, the content is analyzed either via:
• The content_understanding.py which calls Azure AI Content Understanding.
• The llm_inference.py that utilizes AI models to generate explanations and warnings.
• Processed video analysis results are stored in the video_analysis folder for persistence or further review.
• The azure_storage.py module ensures that data (like processed video analyses or configurations) is stored and retrieved from Azure Blob Storage.
• Utility functions (from utils.py) support common functions across modules.
Architectural Patterns and Design Principles
• Separation of Concerns: Each module maintains a specific responsibility (UI, downloading, analysis, storage, AI inference).
• Modular Design: The clear division into modules (e.g., content understanding, LLM inference) makes the system extensible and maintainable.
• External API Integration: The project design emphasizes integration with external Azure services, which should be depicted clearly.
Relevant Technologies
• Streamlit for the frontend.
• Python for backend operations.
• Azure AI and Azure Blob Storage for cloud services.
• Integration with YouTube for video processing.