agent.py 431 B

123456789101112131415161718
  1. from abc import ABC, abstractmethod
  2. from typing import Any
  3. DEFAULT_MAX_RUN_STEPS = 20
  4. class BaseAgent(ABC):
  5. r"""An abstract base class for all agents."""
  6. @abstractmethod
  7. def run(self, user_input: str) -> Any:
  8. """Run the agent with the given user input.
  9. Args:
  10. user_input (str): The input from the user.
  11. Returns:
  12. Any: The output from the agent.
  13. """
  14. pass