agent.py 494 B

1234567891011121314151617181920
  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, **kwargs) -> Any:
  8. """Run the agent with the given user input.
  9. Args:
  10. user_input (str): The input from the user.
  11. **kwargs: Additional keyword arguments.
  12. Returns:
  13. Any: The output from the agent.
  14. """
  15. pass