mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Fix micro-agents schema bug (#1424)
* Fix micro agents definitions * Add tests for micro agents * Add to CI * Revert "Add to CI" This reverts commit 94f3b4e7c8408a1b0267f3847cbaefdcd995db05. * Remove test artifacts for ManagerAgent --------- Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
This commit is contained in:
parent
5a9b6b0c9f
commit
319b9ac0f3
@ -56,14 +56,9 @@ class MicroAgent(Agent):
|
|||||||
super().__init__(llm)
|
super().__init__(llm)
|
||||||
if 'name' not in self.agent_definition:
|
if 'name' not in self.agent_definition:
|
||||||
raise ValueError('Agent definition must contain a name')
|
raise ValueError('Agent definition must contain a name')
|
||||||
self.name = self.agent_definition['name']
|
|
||||||
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.prompt_template = Environment(loader=BaseLoader).from_string(self.prompt)
|
||||||
self.delegates = all_microagents.copy()
|
self.delegates = all_microagents.copy()
|
||||||
del self.delegates[self.name]
|
del self.delegates[self.agent_definition['name']]
|
||||||
|
|
||||||
def step(self, state: State) -> Action:
|
def step(self, state: State) -> Action:
|
||||||
prompt = self.prompt_template.render(
|
prompt = self.prompt_template.render(
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
name: Coder
|
name: CoderAgent
|
||||||
description: Given a particular task, and a detailed description of the codebase, accomplishes the task
|
description: Given a particular task, and a detailed description of the codebase, accomplishes the task
|
||||||
inputs:
|
inputs:
|
||||||
- task: string
|
task: string
|
||||||
- codebase_summary: string
|
codebase_summary: string
|
||||||
outputs: []
|
outputs: {}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
name: Manager
|
name: ManagerAgent
|
||||||
description: Delegates tasks to microagents based on their area of expertise
|
description: Delegates tasks to microagents based on their area of expertise
|
||||||
generates: Action
|
generates: Action
|
||||||
inputs:
|
inputs:
|
||||||
task: string
|
task: string
|
||||||
|
outputs: {}
|
||||||
|
|||||||
@ -7,19 +7,19 @@ inputs:
|
|||||||
outputs:
|
outputs:
|
||||||
answer: string
|
answer: string
|
||||||
examples:
|
examples:
|
||||||
- input:
|
- inputs:
|
||||||
task: "What is 2 + 2?"
|
task: "What is 2 + 2?"
|
||||||
output:
|
outputs:
|
||||||
answer: "4"
|
answer: "4"
|
||||||
- input:
|
- inputs:
|
||||||
task: "What is the area of a circle with radius 7.324 inches?"
|
task: "What is the area of a circle with radius 7.324 inches?"
|
||||||
output:
|
output:
|
||||||
answer: "168.518 square inches"
|
answer: "168.518 square inches"
|
||||||
- input:
|
- inputs:
|
||||||
task: "What day of the week is 2099-01-01?"
|
task: "What day of the week is 2099-01-01?"
|
||||||
output:
|
outputs:
|
||||||
answer: "Saturday"
|
answer: "Saturday"
|
||||||
- input:
|
- inputs:
|
||||||
task: "What is the integral of sin(x^2) evaluated from -1 to 1?"
|
task: "What is the integral of sin(x^2) evaluated from -1 to 1?"
|
||||||
output:
|
outputs:
|
||||||
answer: "0.603848"
|
answer: "0.603848"
|
||||||
|
|||||||
@ -2,5 +2,5 @@ name: PostgresAgent
|
|||||||
description: Writes and maintains PostgreSQL migrations
|
description: Writes and maintains PostgreSQL migrations
|
||||||
generates: Action
|
generates: Action
|
||||||
inputs:
|
inputs:
|
||||||
- task: string
|
task: string
|
||||||
outputs: []
|
outputs: {}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: RepoExplorer
|
name: RepoExplorerAgent
|
||||||
description: Generates a detailed summary of an existing codebase
|
description: Generates a detailed summary of an existing codebase
|
||||||
inputs: []
|
inputs: {}
|
||||||
outputs:
|
outputs:
|
||||||
- summary: string
|
summary: string
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
name: StudyRepoForTaskAgent
|
name: StudyRepoForTaskAgent
|
||||||
description: Given a particular task, finds and describes all relevant parts of the codebase
|
description: Given a particular task, finds and describes all relevant parts of the codebase
|
||||||
inputs:
|
inputs:
|
||||||
- task: string
|
task: string
|
||||||
outputs:
|
outputs:
|
||||||
- summary: string
|
summary: string
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
name: Verifier
|
name: VerifierAgent
|
||||||
description: Given a particular task, verifies that the task has been completed
|
description: Given a particular task, verifies that the task has been completed
|
||||||
inputs:
|
inputs:
|
||||||
- task: string
|
task: string
|
||||||
outputs:
|
outputs:
|
||||||
- completed: boolean
|
completed: boolean
|
||||||
- summary: string
|
summary: string
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user