mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-06 06:12:39 +02:00
chore: rename WriteCode -> WriteCodeFunction.
This commit is contained in:
parent
50f64ca934
commit
fa400a0b0d
3 changed files with 5 additions and 5 deletions
|
|
@ -24,7 +24,7 @@ from metagpt.actions.write_prd import WritePRD
|
|||
from metagpt.actions.write_prd_review import WritePRDReview
|
||||
from metagpt.actions.write_test import WriteTest
|
||||
from metagpt.actions.code_executor import PyCodeExecutor
|
||||
from metagpt.actions.write_code_v2 import WriteCode as WriteCodeFunction
|
||||
from metagpt.actions.write_code_function import WriteCodeFunction
|
||||
from metagpt.actions.plan import Plan
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from metagpt.actions import Action
|
|||
from metagpt.schema import Message
|
||||
|
||||
|
||||
class WriteCode(Action):
|
||||
class WriteCodeFunction(Action):
|
||||
"""Use openai function to generate code."""
|
||||
|
||||
def __init__(self, name: str = "", context=None, llm=None) -> str:
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
import pytest
|
||||
|
||||
from metagpt.actions.write_code_v2 import WriteCode
|
||||
from metagpt.actions.write_code_function import WriteCodeFunction
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_write_code():
|
||||
coder = WriteCode()
|
||||
coder = WriteCodeFunction()
|
||||
code = await coder.run("Write a hello world code.")
|
||||
assert "language" in code.content
|
||||
assert "code" in code.content
|
||||
|
|
@ -14,7 +14,7 @@ async def test_write_code():
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_write_code_by_list_prompt():
|
||||
coder = WriteCode()
|
||||
coder = WriteCodeFunction()
|
||||
msg = ["a=[1,2,5,10,-10]", "写出求a中最大值的代码python"]
|
||||
code = await coder.run(msg)
|
||||
assert "language" in code.content
|
||||
Loading…
Add table
Add a link
Reference in a new issue