forked from All-Hands-AI/OpenHands
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update action.py * Update observation.py * Update observation.py * Update action.py * Update observation.py * Update opendevin/schema/action.py * Update action.py * Update observation.py * Update action.py * Update observation.py * Update observation.py * Update observation.py * Update observation.py * Update action.py * Update action.py * Update action.py * Update observation.py * Update observation.py --------- Co-authored-by: Robert Brennan <[email protected]> Co-authored-by: Engel Nyst <[email protected]>
- Loading branch information
1 parent
900de87
commit 454e961
Showing
2 changed files
with
45 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,73 @@ | ||
from enum import Enum | ||
from pydantic import BaseModel, Field | ||
|
||
__all__ = [ | ||
'ActionType' | ||
] | ||
|
||
class ActionType(str, Enum): | ||
INIT = 'initialize' | ||
|
||
class ActionTypeSchema(BaseModel): | ||
INIT: str = Field(default='initialize') | ||
"""Initializes the agent. Only sent by client. | ||
""" | ||
|
||
START = 'start' | ||
START: str = Field(default='start') | ||
"""Starts a new development task. Only sent by the client. | ||
""" | ||
|
||
READ = 'read' | ||
READ: str = Field(default='read') | ||
"""Reads the content of a file. | ||
""" | ||
|
||
WRITE = 'write' | ||
WRITE: str = Field(default='write') | ||
"""Writes the content to a file. | ||
""" | ||
|
||
RUN = 'run' | ||
RUN: str = Field(default='run') | ||
"""Runs a command. | ||
""" | ||
|
||
KILL = 'kill' | ||
KILL: str = Field(default='kill') | ||
"""Kills a background command. | ||
""" | ||
|
||
BROWSE = 'browse' | ||
BROWSE: str = Field(default='browse') | ||
"""Opens a web page. | ||
""" | ||
|
||
RECALL = 'recall' | ||
RECALL: str = Field(default='recall') | ||
"""Searches long-term memory | ||
""" | ||
|
||
THINK = 'think' | ||
THINK: str = Field(default='think') | ||
"""Allows the agent to make a plan, set a goal, or record thoughts | ||
""" | ||
|
||
FINISH = 'finish' | ||
FINISH: str = Field(default='finish') | ||
"""If you're absolutely certain that you've completed your task and have tested your work, | ||
use the finish action to stop working. | ||
""" | ||
|
||
CHAT = 'chat' | ||
|
||
SUMMARIZE = 'summarize' | ||
NULL: str = Field(default='null') | ||
|
||
ADD_TASK = 'add_task' | ||
SUMMARIZE: str = Field(default='summarize') | ||
|
||
MODIFY_TASK = 'modify_task' | ||
ADD_TASK: str = Field(default='add_task') | ||
|
||
NULL = 'null' | ||
MODIFY_TASK: str = Field(default='modify_task') | ||
|
||
PAUSE = 'pause' | ||
PAUSE: str = Field(default='pause') | ||
"""Pauses the task. | ||
""" | ||
|
||
RESUME = 'resume' | ||
RESUME: str = Field(default='resume') | ||
"""Resumes the task. | ||
""" | ||
|
||
STOP = 'stop' | ||
STOP: str = Field(default='stop') | ||
"""Stops the task. Must send a start action to restart a new task. | ||
""" | ||
|
||
CHANGE_TASK_STATE = 'change_task_state' | ||
CHANGE_TASK_STATE: str = Field(default='change_task_state') | ||
|
||
|
||
ActionType = ActionTypeSchema() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
from enum import Enum | ||
from pydantic import BaseModel, Field | ||
|
||
__all__ = [ | ||
'ObservationType' | ||
] | ||
|
||
class ObservationType(str, Enum): | ||
READ = 'read' | ||
|
||
class ObservationTypeSchema(BaseModel): | ||
READ: str = Field(default='read') | ||
"""The content of a file | ||
""" | ||
|
||
WRITE = 'write' | ||
WRITE: str = Field(default='write') | ||
|
||
BROWSE = 'browse' | ||
BROWSE: str = Field(default='browse') | ||
"""The HTML content of a URL | ||
""" | ||
|
||
RUN = 'run' | ||
RUN: str = Field(default='run') | ||
"""The output of a command | ||
""" | ||
|
||
RECALL = 'recall' | ||
RECALL: str = Field(default='recall') | ||
"""The result of a search | ||
""" | ||
|
||
CHAT = 'chat' | ||
CHAT: str = Field(default='chat') | ||
"""A message from the user | ||
""" | ||
|
||
MESSAGE = 'message' | ||
MESSAGE: str = Field(default='message') | ||
|
||
ERROR: str = Field(default='error') | ||
|
||
NULL: str = Field(default='null') | ||
|
||
ERROR = 'error' | ||
|
||
NULL = 'null' | ||
ObservationType = ObservationTypeSchema() |