action.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. EDIT: str = Field(default='edit')
  20. """Edits a file by providing a draft.
  21. """
  22. RUN: str = Field(default='run')
  23. """Runs a command.
  24. """
  25. RUN_IPYTHON: str = Field(default='run_ipython')
  26. """Runs a IPython cell.
  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. DELEGATE: str = Field(default='delegate')
  35. """Delegates a task to another agent.
  36. """
  37. FINISH: str = Field(default='finish')
  38. """If you're absolutely certain that you've completed your task and have tested your work,
  39. use the finish action to stop working.
  40. """
  41. REJECT: str = Field(default='reject')
  42. """If you're absolutely certain that you cannot complete the task with given requirements,
  43. use the reject action to stop working.
  44. """
  45. NULL: str = Field(default='null')
  46. SUMMARIZE: str = Field(default='summarize')
  47. ADD_TASK: str = Field(default='add_task')
  48. MODIFY_TASK: str = Field(default='modify_task')
  49. PAUSE: str = Field(default='pause')
  50. """Pauses the task.
  51. """
  52. RESUME: str = Field(default='resume')
  53. """Resumes the task.
  54. """
  55. STOP: str = Field(default='stop')
  56. """Stops the task. Must send a start action to restart a new task.
  57. """
  58. CHANGE_AGENT_STATE: str = Field(default='change_agent_state')
  59. PUSH: str = Field(default='push')
  60. """Push a branch to github."""
  61. SEND_PR: str = Field(default='send_pr')
  62. """Send a PR to github."""
  63. ActionType = ActionTypeSchema()