mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
28 lines
725 B
Python
28 lines
725 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Any
|
|
|
|
from integrations.models import Message, SourceType
|
|
|
|
|
|
class Manager(ABC):
|
|
manager_type: SourceType
|
|
|
|
@abstractmethod
|
|
async def receive_message(self, message: Message):
|
|
"Receive message from integration"
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def send_message(self, message: str, *args: Any, **kwargs: Any):
|
|
"""Send message to integration from OpenHands server.
|
|
|
|
Args:
|
|
message: The message content to send (plain text string).
|
|
"""
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def start_job(self):
|
|
"Kick off a job with openhands agent"
|
|
raise NotImplementedError
|