hse-python-assistant/app/models/base.py

17 lines
465 B
Python
Raw Normal View History

2024-10-16 22:57:05 +00:00
import abc
from typing import Optional
class BaseModel(abc.ABC):
"""Abstract class for all models."""
def __init__(self, system_prompt: Optional[str] = None) -> None:
self.messages = []
self.system_prompt = system_prompt
pass
@abc.abstractmethod
def ask(self, user_message: str, clear_history: bool = True) -> Optional[str]:
"""Send a message to the assistant and return the assistant's response."""
pass