mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
* Replace OpenDevin with OpenHands * Update CONTRIBUTING.md * Update README.md * Update README.md * update poetry lock; move opendevin folder to openhands * fix env var * revert image references in docs * revert permissions * revert permissions --------- Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
32 lines
662 B
Python
32 lines
662 B
Python
from abc import abstractmethod
|
|
from dataclasses import dataclass
|
|
|
|
from openhands.events.action import Action
|
|
from openhands.events.observation import Observation
|
|
|
|
|
|
class Plugin:
|
|
"""Base class for a plugin.
|
|
|
|
This will be initialized by the runtime client, which will run inside docker.
|
|
"""
|
|
|
|
name: str
|
|
|
|
@abstractmethod
|
|
async def initialize(self, username: str):
|
|
"""Initialize the plugin."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def run(self, action: Action) -> Observation:
|
|
"""Run the plugin for a given action."""
|
|
pass
|
|
|
|
|
|
@dataclass
|
|
class PluginRequirement:
|
|
"""Requirement for a plugin."""
|
|
|
|
name: str
|