action.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. from pydantic import BaseModel, Field
  2. __all__ = ['ActionType']
  3. class ActionTypeSchema(BaseModel):
  4. INIT: str = Field(default='initialize')
  5. """Initializes the agent. Only sent by client.
  6. """
  7. MESSAGE: str = Field(default='message')
  8. """Represents a message.
  9. """
  10. START: str = Field(default='start')
  11. """Starts a new development task OR send chat from the user. Only sent by the client.
  12. """
  13. READ: str = Field(default='read')
  14. """Reads the content of a file.
  15. """
  16. WRITE: str = Field(default='write')
  17. """Writes the content to a file.
  18. """
  19. RUN: str = Field(default='run')
  20. """Runs a command.
  21. """
  22. RUN_IPYTHON: str = Field(default='run_ipython')
  23. """Runs a IPython cell.
  24. """
  25. KILL: str = Field(default='kill')
  26. """Kills a background command.
  27. """
  28. BROWSE: str = Field(default='browse')
  29. """Opens a web page.
  30. """
  31. BROWSE_INTERACTIVE: str = Field(default='browse_interactive')
  32. """Interact with the browser instance.
  33. """
  34. RECALL: str = Field(default='recall')
  35. """Searches long-term memory
  36. """
  37. DELEGATE: str = Field(default='delegate')
  38. """Delegates a task to another agent.
  39. """
  40. FINISH: str = Field(default='finish')
  41. """If you're absolutely certain that you've completed your task and have tested your work,
  42. use the finish action to stop working.
  43. """
  44. REJECT: str = Field(default='reject')
  45. """If you're absolutely certain that you cannot complete the task with given requirements,
  46. use the reject action to stop working.
  47. """
  48. NULL: str = Field(default='null')
  49. SUMMARIZE: str = Field(default='summarize')
  50. ADD_TASK: str = Field(default='add_task')
  51. MODIFY_TASK: str = Field(default='modify_task')
  52. PAUSE: str = Field(default='pause')
  53. """Pauses the task.
  54. """
  55. RESUME: str = Field(default='resume')
  56. """Resumes the task.
  57. """
  58. STOP: str = Field(default='stop')
  59. """Stops the task. Must send a start action to restart a new task.
  60. """
  61. CHANGE_AGENT_STATE: str = Field(default='change_agent_state')
  62. PUSH: str = Field(default='push')
  63. """Push a branch to github."""
  64. SEND_PR: str = Field(default='send_pr')
  65. """Send a PR to github."""
  66. ActionType = ActionTypeSchema()