Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add message related schema to FE and BE. #195

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions frontend/src/types/ActionType.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
enum ActionType {
// Initializes the agent. Only sent by client.
INIT = "initialize",

// Starts a new development task. Only sent by the client.
START = "start",

// Reads the contents of a file.
READ = "read",

// Writes the contents to a file.
WRITE = "write",

// Runs a command.
RUN = "run",

// Kills a background command.
KILL = "kill",

// Opens a web page.
BROWSE = "browse",

// Searches long-term memory.
RECALL = "recall",

// Allows the agent to make a plan, set a goal, or record thoughts.
THINK = "think",

// If you're absolutely certain that you've completed your task and have tested your work,
// use the finish action to stop working.
FINISH = "finish",
}

export default ActionType;
24 changes: 24 additions & 0 deletions frontend/src/types/Message.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export interface ActionMessage {
// The action to be taken
action: string;

// The arguments for the action
args: Record<string, string>;

// A friendly message that can be put in the chat log
message: string;
}

export interface ObservationMessage {
// The type of observation
observation: string;

// The observed data
content: string;

// Additional structured data
extras: Record<string, string>;

// A friendly message that can be put in the chat log
message: string;
}
18 changes: 18 additions & 0 deletions frontend/src/types/ObservationType.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
enum ObservationType {
// The contents of a file
READ = "read",

// The HTML contents of a URL
BROWSE = "browse",

// The output of a command
RUN = "run",

// The result of a search
RECALL = "recall",

// A message from the user
CHAT = "chat",
}

export default ObservationType;
44 changes: 44 additions & 0 deletions opendevin/server/schema/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from enum import Enum


class ActionType(str, Enum):
INIT = "initialize"
"""Initializes the agent. Only sent by client.
"""

START = "start"
"""Starts a new development task. Only sent by the client.
"""

READ = "read"
"""Reads the contents of a file.
"""

WRITE = "write"
"""Writes the contents to a file.
"""

RUN = "run"
"""Runs a command.
"""

KILL = "kill"
"""Kills a background command.
"""

BROWSE = "browse"
"""Opens a web page.
"""

RECALL = "recall"
"""Searches long-term memory
"""

THINK = "think"
"""Allows the agent to make a plan, set a goal, or record thoughts
"""

FINISH = "finish"
"""If you're absolutely certain that you've completed your task and have tested your work,
use the finish action to stop working.
"""
23 changes: 23 additions & 0 deletions opendevin/server/schema/observation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from enum import Enum


class ObservationType(str, Enum):
READ = "read"
"""The contents of a file
"""

BROWSE = "browse"
"""The HTML contents of a URL
"""

RUN = "run"
"""The output of a command
"""

RECALL = "recall"
"""The result of a search
"""

CHAT = "chat"
"""A message from the user
"""