from lionagi.core.generic import BaseComponent from pydantic import BaseModel, Field, field_validator from abc import ABC, abstractmethod class iModel(BaseComponent, ABC): model_id: str = Field(default_factory=str) model_name: str = Field(default_factory=str) llmconfig: dict = Field(default_factory=dict) def update_config(self, updates: Dict): self.llmconfig.update(updates) self.log("Configuration updated.") return True def log(self, message: str): """ Basic logging function. """ print(f"Log [{self.model_id}]: {message}") @abstractmethod async def predict(self, input_data: dict): """ Generate a prediction based on input_data. This method must be overridden by subclasses. """ pass