mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
update: SWE Agent
This commit is contained in:
parent
45b3552510
commit
00d683251b
1 changed files with 38 additions and 0 deletions
38
tests/metagpt/roles/di/run_swe_new.py
Normal file
38
tests/metagpt/roles/di/run_swe_new.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import asyncio
|
||||
|
||||
from metagpt.logs import logger
|
||||
from metagpt.roles.di.swe import SWE
|
||||
|
||||
FIX_ISSUE1 = """
|
||||
Write a fix for this issue: https://github.com/langchain-ai/langchain/issues/20453,
|
||||
you can fix it on this repo https://github.com/garylin2099/langchain,
|
||||
"""
|
||||
|
||||
"checkout a branch named test-fix, commit your changes, push, and create a PR to the master branch of https://github.com/iorisa/langchain"
|
||||
|
||||
FIX_ISSUE2 = """
|
||||
Write a fix for this issue https://github.com/geekan/MetaGPT/issues/1275.
|
||||
You can fix it on the v0.8-release branch of this repo https://github.com/garylin2099/MetaGPT,
|
||||
during fixing, checkout a branch named test-fix-1275, commit your changes, push, and create a PR to the v0.8-release branch of https://github.com/garylin2099/MetaGPT
|
||||
"""
|
||||
FIX_ISSUE3 = """
|
||||
Write a fix for this issue https://github.com/geekan/MetaGPT/issues/1262.
|
||||
You can fix it on this repo https://github.com/garylin2099/MetaGPT,
|
||||
during fixing, checkout a branch named test-fix-1262, commit your changes, push, and create a PR to https://github.com/garylin2099/MetaGPT
|
||||
"""
|
||||
FIX_ISSUE_SIMPLE = """
|
||||
Write a fix for this issue: https://github.com/mannaandpoem/simple_calculator/issues/1,
|
||||
you can fix it on this repo https://github.com/garylin2099/simple_calculator,
|
||||
checkout a branch named test, commit your changes, push, and create a PR to the master branch of original repo.
|
||||
"""
|
||||
|
||||
if __name__ == "__main__":
|
||||
swe_agent = SWE()
|
||||
logger.info("**** Starting run ****")
|
||||
user_requirement_and_issue = (
|
||||
FIX_ISSUE1
|
||||
+ """Because the environment is not available, you DO NOT need to run and modify any existing test case files or add new test case files to ensure that the bug is fixed."""
|
||||
)
|
||||
asyncio.run(swe_agent.run(user_requirement_and_issue))
|
||||
logger.info("**** Finished running ****")
|
||||
logger.info(f"Patch: {swe_agent.output_diff}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue