"""Base AI adapter interface for HAD Digital MVP.
All AI adapters must implement this interface.
"""
from abc import ABC, abstractmethod
class BaseAdapter(ABC):
"""Base class for AI chat adapters."""
@abstractmethod
def chat(self, message: str, context: dict = None) -> dict:
"""Send a message and get a response.
Args:
message: The user's message
context: Optional context dict with keys like:
- patient_id: Current patient
- user_role: Current user's role
- history: List of previous messages
- symptoms: Current symptom data
Returns:
Dict with keys:
- response: The AI response text
- sources: List of source references (optional)
- confidence: Confidence score 0-1 (optional)
- actions: List of suggested actions (optional)
"""
pass
@abstractmethod
def get_name(self) -> str:
"""Return the adapter name."""
pass
@abstractmethod
def is_available(self) -> bool:
"""Check if this adapter is available and configured."""
pass