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

Fix micro-agents schema bug #1424

Merged
merged 8 commits into from Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/run-integration-tests.yml
Expand Up @@ -33,6 +33,11 @@ jobs:
agent: "CodeActAgent"
embedding-model: "none"
sandbox: "ssh"
- name: ManagerAgent-py311-ssh
python-version: "3.11"
agent: "ManagerAgent"
embedding-model: "none"
sandbox: "ssh"
- name: SWEAgent-py311-exec
python-version: "3.11"
agent: "SWEAgent"
Expand All @@ -53,6 +58,11 @@ jobs:
agent: "CodeActAgent"
embedding-model: "none"
sandbox: "exec"
- name: ManagerAgent-py311-exec
python-version: "3.11"
agent: "ManagerAgent"
embedding-model: "none"
sandbox: "exec"
- name: MonologueAgent-py311-local
python-version: "3.11"
agent: "MonologueAgent"
Expand Down
7 changes: 1 addition & 6 deletions agenthub/micro/agent.py
Expand Up @@ -56,14 +56,9 @@ def __init__(self, llm: LLM):
super().__init__(llm)
if 'name' not in self.agent_definition:
raise ValueError('Agent definition must contain a name')
self.name = self.agent_definition['name']
li-boxuan marked this conversation as resolved.
Show resolved Hide resolved
self.description = self.agent_definition['description'] if 'description' in self.agent_definition else ''
self.inputs = self.agent_definition['inputs'] if 'inputs' in self.agent_definition else []
self.outputs = self.agent_definition['outputs'] if 'outputs' in self.agent_definition else []
self.examples = self.agent_definition['examples'] if 'examples' in self.agent_definition else []
self.prompt_template = Environment(loader=BaseLoader).from_string(self.prompt)
self.delegates = all_microagents.copy()
del self.delegates[self.name]
del self.delegates[self.agent_definition['name']]

def step(self, state: State) -> Action:
prompt = self.prompt_template.render(
Expand Down
8 changes: 4 additions & 4 deletions agenthub/micro/coder/agent.yaml
@@ -1,6 +1,6 @@
name: Coder
name: CoderAgent
description: Given a particular task, and a detailed description of the codebase, accomplishes the task
inputs:
- task: string
- codebase_summary: string
outputs: []
task: string
codebase_summary: string
outputs: {}
3 changes: 2 additions & 1 deletion agenthub/micro/manager/agent.yaml
@@ -1,5 +1,6 @@
name: Manager
name: ManagerAgent
description: Delegates tasks to microagents based on their area of expertise
generates: Action
inputs:
task: string
outputs: {}
14 changes: 7 additions & 7 deletions agenthub/micro/math_agent/agent.yaml
Expand Up @@ -7,19 +7,19 @@ inputs:
outputs:
answer: string
examples:
- input:
- inputs:
task: "What is 2 + 2?"
output:
outputs:
answer: "4"
- input:
- inputs:
task: "What is the area of a circle with radius 7.324 inches?"
output:
answer: "168.518 square inches"
- input:
- inputs:
task: "What day of the week is 2099-01-01?"
output:
outputs:
answer: "Saturday"
- input:
- inputs:
task: "What is the integral of sin(x^2) evaluated from -1 to 1?"
output:
outputs:
answer: "0.603848"
4 changes: 2 additions & 2 deletions agenthub/micro/postgres_agent/agent.yaml
Expand Up @@ -2,5 +2,5 @@ name: PostgresAgent
description: Writes and maintains PostgreSQL migrations
generates: Action
inputs:
- task: string
outputs: []
task: string
outputs: {}
6 changes: 3 additions & 3 deletions agenthub/micro/repo_explorer/agent.yaml
@@ -1,5 +1,5 @@
name: RepoExplorer
name: RepoExplorerAgent
description: Generates a detailed summary of an existing codebase
inputs: []
inputs: {}
outputs:
- summary: string
summary: string
4 changes: 2 additions & 2 deletions agenthub/micro/study_repo_for_task/agent.yaml
@@ -1,6 +1,6 @@
name: StudyRepoForTaskAgent
description: Given a particular task, finds and describes all relevant parts of the codebase
inputs:
- task: string
task: string
outputs:
- summary: string
summary: string
8 changes: 4 additions & 4 deletions agenthub/micro/verifier/agent.yaml
@@ -1,7 +1,7 @@
name: Verifier
name: VerifierAgent
description: Given a particular task, verifies that the task has been completed
inputs:
- task: string
task: string
outputs:
- completed: boolean
- summary: string
completed: boolean
summary: string
@@ -0,0 +1,65 @@


----------

# Task
You are in charge of accomplishing the following task:
Write a shell script 'hello.sh' that prints 'hello'.

In order to accomplish this goal, you must delegate tasks to one or more agents, who
can do the actual work. A description of each agent is provided below. You MUST
select one of the delegates below to move towards accomplishing the task, and you MUST
provide the correct inputs for the delegate you select.

## Agents

### StudyRepoForTaskAgent
Given a particular task, finds and describes all relevant parts of the codebase
#### Inputs
{"task": "string"}

### MathAgent
Solves simple and complex math problems using python
#### Inputs
{"task": "string"}

### RepoExplorerAgent
Generates a detailed summary of an existing codebase
#### Inputs
{}

### VerifierAgent
Given a particular task, verifies that the task has been completed
#### Inputs
{"task": "string"}

### CoderAgent
Given a particular task, and a detailed description of the codebase, accomplishes the task
#### Inputs
{"task": "string", "codebase_summary": "string"}

### PostgresAgent
Writes and maintains PostgreSQL migrations
#### Inputs
{"task": "string"}


## History

[]

## Available Actions
* `delegate` - send a task to another agent from the list provided. Arguments:
* `agent` - the agent to which the task is delegated. MUST match a name in the list of agents provided.
* `inputs` - a dictionary of input parameters to the agent, as specified in the list

* `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. Arguments:
* `outputs` - a dictionary representing the outputs of your task, if any


## Format
Your response MUST be in JSON format. It must be an object, and it must contain two fields:
* `action`, which is one of the actions specified here
* `args`, which is a map of key-value pairs, specifying the arguments for that action

You MUST NOT include any other text besides the JSON response
@@ -0,0 +1,43 @@


----------

# Task
You are a software engineer. You've inherited an existing codebase, which you're
learning about for the first time. Your goal is to produce a detailed summary
of the codebase, including:
* The overall purpose of the project
* The directory structure
* The main components of the codebase
* How the components fit together

## Available Actions
* `run` - runs a command on the command line in a Linux shell. Arguments:
* `command` - the command to run
* `background` - if true, run the command in the background, so that other commands can be run concurrently. Useful for e.g. starting a server. You won't be able to see the logs. You don't need to end the command with `&`, just set this to true.

* `read` - reads the content of a file. Arguments:
* `path` - the path of the file to read

* `think` - make a plan, set a goal, or record your thoughts. Arguments:
* `thought` - the thought to record

* `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. Arguments:
* `outputs` - a dictionary representing the outputs of your task, if any


You should ONLY `run` commands that have no side-effects, like `ls` and `grep`.

Do NOT finish until you have a complete understanding of the codebase.
When you're done, put your summary into the output of the `finish` action.

## History

[]

## Format
Your response MUST be in JSON format. It must be an object, and it must contain two fields:
* `action`, which is one of the actions specified here
* `args`, which is a map of key-value pairs, specifying the arguments for that action

You MUST NOT include any other text besides the JSON response
@@ -0,0 +1,43 @@


----------

# Task
You are a software engineer. You've inherited an existing codebase, which you're
learning about for the first time. Your goal is to produce a detailed summary
of the codebase, including:
* The overall purpose of the project
* The directory structure
* The main components of the codebase
* How the components fit together

## Available Actions
* `run` - runs a command on the command line in a Linux shell. Arguments:
* `command` - the command to run
* `background` - if true, run the command in the background, so that other commands can be run concurrently. Useful for e.g. starting a server. You won't be able to see the logs. You don't need to end the command with `&`, just set this to true.

* `read` - reads the content of a file. Arguments:
* `path` - the path of the file to read

* `think` - make a plan, set a goal, or record your thoughts. Arguments:
* `thought` - the thought to record

* `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. Arguments:
* `outputs` - a dictionary representing the outputs of your task, if any


You should ONLY `run` commands that have no side-effects, like `ls` and `grep`.

Do NOT finish until you have a complete understanding of the codebase.
When you're done, put your summary into the output of the `finish` action.

## History

[[{"action": "run", "args": {"command": "ls -l", "background": false}, "message": "Running command: ls -l"}, {"observation": "run", "content": "total 0", "extras": {"command_id": -1, "command": "ls -l", "exit_code": 0}, "message": "Command `ls -l` executed with exit code 0."}]]

## Format
Your response MUST be in JSON format. It must be an object, and it must contain two fields:
* `action`, which is one of the actions specified here
* `args`, which is a map of key-value pairs, specifying the arguments for that action

You MUST NOT include any other text besides the JSON response
@@ -0,0 +1,43 @@


----------

# Task
You are a software engineer. You've inherited an existing codebase, which you're
learning about for the first time. Your goal is to produce a detailed summary
of the codebase, including:
* The overall purpose of the project
* The directory structure
* The main components of the codebase
* How the components fit together

## Available Actions
* `run` - runs a command on the command line in a Linux shell. Arguments:
* `command` - the command to run
* `background` - if true, run the command in the background, so that other commands can be run concurrently. Useful for e.g. starting a server. You won't be able to see the logs. You don't need to end the command with `&`, just set this to true.

* `read` - reads the content of a file. Arguments:
* `path` - the path of the file to read

* `think` - make a plan, set a goal, or record your thoughts. Arguments:
* `thought` - the thought to record

* `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. Arguments:
* `outputs` - a dictionary representing the outputs of your task, if any


You should ONLY `run` commands that have no side-effects, like `ls` and `grep`.

Do NOT finish until you have a complete understanding of the codebase.
When you're done, put your summary into the output of the `finish` action.

## History

[[{"action": "run", "args": {"command": "ls -l", "background": false}, "message": "Running command: ls -l"}, {"observation": "run", "content": "total 0", "extras": {"command_id": -1, "command": "ls -l", "exit_code": 0}, "message": "Command `ls -l` executed with exit code 0."}], [{"action": "think", "args": {"thought": "The initial 'ls -l' command shows an empty directory, which means there may have been an error or misunderstanding. There's no immediate structure or files to analyze. I need to verify whether the directory is truly empty or if more information is required to proceed."}, "message": "The initial 'ls -l' command shows an empty directory, which means there may have been an error or misunderstanding. There's no immediate structure or files to analyze. I need to verify whether the directory is truly empty or if more information is required to proceed."}, {"observation": "null", "content": "", "extras": {}, "message": ""}]]

## Format
Your response MUST be in JSON format. It must be an object, and it must contain two fields:
* `action`, which is one of the actions specified here
* `args`, which is a map of key-value pairs, specifying the arguments for that action

You MUST NOT include any other text besides the JSON response
@@ -0,0 +1,43 @@


----------

# Task
You are a software engineer. You've inherited an existing codebase, which you're
learning about for the first time. Your goal is to produce a detailed summary
of the codebase, including:
* The overall purpose of the project
* The directory structure
* The main components of the codebase
* How the components fit together

## Available Actions
* `run` - runs a command on the command line in a Linux shell. Arguments:
* `command` - the command to run
* `background` - if true, run the command in the background, so that other commands can be run concurrently. Useful for e.g. starting a server. You won't be able to see the logs. You don't need to end the command with `&`, just set this to true.

* `read` - reads the content of a file. Arguments:
* `path` - the path of the file to read

* `think` - make a plan, set a goal, or record your thoughts. Arguments:
* `thought` - the thought to record

* `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. Arguments:
* `outputs` - a dictionary representing the outputs of your task, if any


You should ONLY `run` commands that have no side-effects, like `ls` and `grep`.

Do NOT finish until you have a complete understanding of the codebase.
When you're done, put your summary into the output of the `finish` action.

## History

[[{"action": "run", "args": {"command": "ls -l", "background": false}, "message": "Running command: ls -l"}, {"observation": "run", "content": "total 0", "extras": {"command_id": -1, "command": "ls -l", "exit_code": 0}, "message": "Command `ls -l` executed with exit code 0."}], [{"action": "think", "args": {"thought": "The initial 'ls -l' command shows an empty directory, which means there may have been an error or misunderstanding. There's no immediate structure or files to analyze. I need to verify whether the directory is truly empty or if more information is required to proceed."}, "message": "The initial 'ls -l' command shows an empty directory, which means there may have been an error or misunderstanding. There's no immediate structure or files to analyze. I need to verify whether the directory is truly empty or if more information is required to proceed."}, {"observation": "null", "content": "", "extras": {}, "message": ""}], [{"action": "run", "args": {"command": "pwd", "background": false}, "message": "Running command: pwd"}, {"observation": "run", "content": "/workspace", "extras": {"command_id": -1, "command": "pwd", "exit_code": 0}, "message": "Command `pwd` executed with exit code 0."}]]

## Format
Your response MUST be in JSON format. It must be an object, and it must contain two fields:
* `action`, which is one of the actions specified here
* `args`, which is a map of key-value pairs, specifying the arguments for that action

You MUST NOT include any other text besides the JSON response