|
|
há 1 ano atrás | |
|---|---|---|
| .. | ||
| agent | há 1 ano atrás | |
| auth | há 1 ano atrás | |
| session | há 1 ano atrás | |
| README.md | há 1 ano atrás | |
| __init__.py | há 1 ano atrás | |
| listen.py | há 1 ano atrás | |
This is a WebSocket server that executes tasks using an agent.
Follow the instructions in the base README.md to install dependencies and set up.
uvicorn opendevin.server.listen:app --reload --port 3000
You can use websocat to test the server: https://github.com/vi/websocat
websocat ws://127.0.0.1:3000/ws
{"action": "start", "args": {"task": "write a bash script that prints hello"}}
LLM_API_KEY=sk-... # Your OpenAI API Key
LLM_MODEL=gpt-3.5-turbo-1106 # Default model for the agent to use
WORKSPACE_BASE=/path/to/your/workspace # Default path to model's workspace
There are two types of messages that can be sent to, or received from, the server:
An action has three parts:
action: The action to be takenargs: The arguments for the actionmessage: A friendly message that can be put in the chat logThere are several kinds of actions. Their arguments are listed below. This list may grow over time.
initialize - initializes the agent. Only sent by client.
model - the name of the model to usedirectory - the path to the workspaceagent_cls - the class of the agent to usestart - starts a new development task. Only sent by the client.
task - the task to startread - reads the content of a file.
path - the path of the file to readwrite - writes the content to a file.
path - the path of the file to writecontent - the content to write to the filerun - runs a command.
command - the command to runbackground - if true, run the command in the backgroundkill - kills a background command
id - the ID of the background command to killbrowse - opens a web page.
url - the URL to openrecall - searches long-term memory
query - the query to search forthink - Allows the agent to make a plan, set a goal, or record thoughts
thought - the thought to recordfinish - agent signals that the task is completedAn observation has four parts:
observation: The observation typecontent: A string representing the observed dataextras: additional structured datamessage: A friendly message that can be put in the chat logThere are several kinds of observations. Their extras are listed below. This list may grow over time.
read - the content of a file
path - the path of the file readbrowse - the HTML content of a url
url - the URL openedrun - the output of a command
command - the command runexit_code - the exit code of the commandrecall - the result of a search
query - the query searched forchat - a message from the user