52 lines
1.4 KiB
Python
52 lines
1.4 KiB
Python
from abc import ABC, abstractmethod
|
|
|
|
class InferenceBot(ABC):
|
|
@abstractmethod
|
|
async def start(self):
|
|
"""Starts the bot."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def clear_conversation_history(self, user_id):
|
|
"""Clears the conversation history for a given user."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def switch_model(self):
|
|
"""Switches the model (if applicable)."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def set_processing_status(self, user_id, message_id):
|
|
"""Sets the processing status for a user, typically with a message ID."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def handle_message(self, user_id, user_message):
|
|
"""Handles an incoming message from a user."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def clear_processing_status(self, user_id):
|
|
"""Clears the processing status for a user."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def abort_processing(self, user_id):
|
|
"""Aborts any ongoing processing for a user."""
|
|
pass
|
|
|
|
@property
|
|
@abstractmethod
|
|
def processing_status(self):
|
|
"""
|
|
An attribute (e.g., a dictionary) to store the processing status for users.
|
|
Example usage in subclass: self.processing_status.get(user_id)
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_bot_status(self):
|
|
"""Returns a human-readable message describing the model in use and the system prompt path."""
|
|
pass
|