Преглед на файлове

Add base agent abstract class

StrayWarrior преди 1 месец
родител
ревизия
c74830f618
променени са 1 файла, в които са добавени 20 реда и са изтрити 0 реда
  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