action.py 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. RECALL: str = Field(default='recall')
  32. """Searches long-term memory
  33. """
  34. THINK: str = Field(default='think')
  35. """Allows the agent to make a plan, set a goal, or record thoughts
  36. """
  37. TALK: str = Field(default='talk')
  38. """Allows the agent to respond to the user.
  39. """
  40. DELEGATE: str = Field(default='delegate')
  41. """Delegates a task to another agent.
  42. """
  43. FINISH: str = Field(default='finish')
  44. """If you're absolutely certain that you've completed your task and have tested your work,
  45. use the finish action to stop working.
  46. """
  47. REJECT: str = Field(default='reject')
  48. """If you're absolutely certain that you cannot complete the task with given requirements,
  49. use the reject action to stop working.
  50. """
  51. NULL: str = Field(default='null')
  52. SUMMARIZE: str = Field(default='summarize')
  53. ADD_TASK: str = Field(default='add_task')
  54. MODIFY_TASK: str = Field(default='modify_task')
  55. PAUSE: str = Field(default='pause')
  56. """Pauses the task.
  57. """
  58. RESUME: str = Field(default='resume')
  59. """Resumes the task.
  60. """
  61. STOP: str = Field(default='stop')
  62. """Stops the task. Must send a start action to restart a new task.
  63. """
  64. CHANGE_AGENT_STATE: str = Field(default='change_agent_state')
  65. PUSH: str = Field(default='push')
  66. """Push a branch to github."""
  67. SEND_PR: str = Field(default='send_pr')
  68. """Send a PR to github."""
  69. ActionType = ActionTypeSchema()