46 lines
1.2 KiB
Python
46 lines
1.2 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
|