Bladeren bron

Add base agent abstract class

StrayWarrior 1 maand geleden
bovenliggende
commit
c74830f618
1 gewijzigde bestanden met toevoegingen van 20 en 0 verwijderingen
  1. 20 0
      pqai_agent/agent.py

+ 20 - 0
pqai_agent/agent.py

@@ -0,0 +1,20 @@
+from abc import ABC, abstractmethod
+from typing import Any
+
+DEFAULT_MAX_RUN_STEPS = 20
+
+class BaseAgent(ABC):
+    r"""An abstract base class for all agents."""
+
+    @abstractmethod
+    def run(self, user_input: str, **kwargs) -> Any:
+        """Run the agent with the given user input.
+
+        Args:
+            user_input (str): The input from the user.
+            **kwargs: Additional keyword arguments.
+
+        Returns:
+            Any: The output from the agent.
+        """
+        pass