action.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. BROWSE: str = Field(default='browse')
  26. """Opens a web page.
  27. """
  28. BROWSE_INTERACTIVE: str = Field(default='browse_interactive')
  29. """Interact with the browser instance.
  30. """
  31. DELEGATE: str = Field(default='delegate')
  32. """Delegates a task to another agent.
  33. """
  34. FINISH: str = Field(default='finish')
  35. """If you're absolutely certain that you've completed your task and have tested your work,
  36. use the finish action to stop working.
  37. """
  38. REJECT: str = Field(default='reject')
  39. """If you're absolutely certain that you cannot complete the task with given requirements,
  40. use the reject action to stop working.
  41. """
  42. NULL: str = Field(default='null')
  43. SUMMARIZE: str = Field(default='summarize')
  44. ADD_TASK: str = Field(default='add_task')
  45. MODIFY_TASK: str = Field(default='modify_task')
  46. PAUSE: str = Field(default='pause')
  47. """Pauses the task.
  48. """
  49. RESUME: str = Field(default='resume')
  50. """Resumes the task.
  51. """
  52. STOP: str = Field(default='stop')
  53. """Stops the task. Must send a start action to restart a new task.
  54. """
  55. CHANGE_AGENT_STATE: str = Field(default='change_agent_state')
  56. PUSH: str = Field(default='push')
  57. """Push a branch to github."""
  58. SEND_PR: str = Field(default='send_pr')
  59. """Send a PR to github."""
  60. ActionType = ActionTypeSchema()