mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-17 18:21:46 -05:00
Restructuring the Repo to make it clear the difference between classic autogpt and the autogpt platform: * Move the "classic" projects `autogpt`, `forge`, `frontend`, and `benchmark` into a `classic` folder * Also rename `autogpt` to `original_autogpt` for absolute clarity * Rename `rnd/` to `autogpt_platform/` * `rnd/autogpt_builder` -> `autogpt_platform/frontend` * `rnd/autogpt_server` -> `autogpt_platform/backend` * Adjust any paths accordingly
52 lines
1.3 KiB
Python
52 lines
1.3 KiB
Python
from abc import abstractmethod
|
|
from typing import TYPE_CHECKING, Awaitable, Generic, Iterator
|
|
|
|
from forge.models.action import ActionResult, AnyProposal
|
|
|
|
from .components import AgentComponent
|
|
|
|
if TYPE_CHECKING:
|
|
from forge.command.command import Command
|
|
from forge.llm.providers import ChatMessage
|
|
|
|
|
|
class DirectiveProvider(AgentComponent):
|
|
def get_constraints(self) -> Iterator[str]:
|
|
return iter([])
|
|
|
|
def get_resources(self) -> Iterator[str]:
|
|
return iter([])
|
|
|
|
def get_best_practices(self) -> Iterator[str]:
|
|
return iter([])
|
|
|
|
|
|
class CommandProvider(AgentComponent):
|
|
@abstractmethod
|
|
def get_commands(self) -> Iterator["Command"]:
|
|
...
|
|
|
|
|
|
class MessageProvider(AgentComponent):
|
|
@abstractmethod
|
|
def get_messages(self) -> Iterator["ChatMessage"]:
|
|
...
|
|
|
|
|
|
class AfterParse(AgentComponent, Generic[AnyProposal]):
|
|
@abstractmethod
|
|
def after_parse(self, result: AnyProposal) -> None | Awaitable[None]:
|
|
...
|
|
|
|
|
|
class ExecutionFailure(AgentComponent):
|
|
@abstractmethod
|
|
def execution_failure(self, error: Exception) -> None | Awaitable[None]:
|
|
...
|
|
|
|
|
|
class AfterExecute(AgentComponent):
|
|
@abstractmethod
|
|
def after_execute(self, result: "ActionResult") -> None | Awaitable[None]:
|
|
...
|