ashleshp's picture
first commit
fca155a
from abc import ABC, abstractmethod
from typing import List, Dict, Optional, Any
from pathlib import Path
class PerceptionEngine(ABC):
"""Abstract Base Class for the Visual Perception System."""
@abstractmethod
def load_model(self, model_path: Path) -> None:
pass
@abstractmethod
def analyze_frame(self, frame_path: str, prompt: str) -> str:
pass
@abstractmethod
def analyze_video_segment(self, video_path: Path, start_time: float, end_time: float, prompt: str) -> str:
pass
@abstractmethod
def chat(self, messages: List[Dict[str, str]]) -> str:
"""General purpose chat completion (for the Agent brain)."""
pass
@abstractmethod
def generate_text(self, prompt: str, stop: Optional[List[str]] = None) -> str:
"""Raw text completion for advanced prompting."""
pass
class MemoryManager(ABC):
"""Abstract Base Class for the Knowledge Graph."""
@abstractmethod
def initialize_storage(self, video_id: str) -> None:
pass
@abstractmethod
def commit_event(self, video_id: str, timestamp: str, description: str, metadata: Dict[str, Any]) -> None:
pass
@abstractmethod
def query_knowledge(self, video_id: str, query: str) -> List[Dict[str, Any]]:
pass
@abstractmethod
def get_summary(self, video_id: str) -> str:
pass