fixbug: write to folder

This commit is contained in:
黄伟韬 2024-08-05 19:17:43 +08:00
parent 654ed131d7
commit fd080fa633
8 changed files with 16 additions and 11 deletions

View file

@ -83,7 +83,7 @@ class WriteDesign(Action):
prd_filename (str, optional): The filename of the Product Requirement Document (PRD).
legacy_design_filename (str, optional): The filename of the legacy design document.
extra_info (str, optional): Additional information to be included in the system design.
output_pathname (str, optional): The output path name of file that the system design should be saved to.
output_pathname (str, optional): The output path name of file that the system design should be saved to. The path name must must end with '.json'.
Returns:
str: The file path of the generated system design.

View file

@ -62,7 +62,7 @@ class WriteTasks(Action):
Args:
user_requirement (str, optional): A string specifying the user's requirements. Defaults to an empty string.
design_filename (str): The filename of the project system design file. Defaults to an empty string.
design_filename (str): The filename of the project system design file. The path name must must end with '.json'. Defaults to an empty string.
output_pathname (str, optional): The output path name of file that the project schedule should be saved to.
**kwargs: Additional keyword arguments.
@ -73,10 +73,11 @@ class WriteTasks(Action):
# Write a project schedule with a given system design.
>>> design_filename = "/absolute/path/to/snake_game/docs/system_design.json"
>>> output_pathname = "/absolute/path/to/snake_game/docs/project_schedule.json"
>>> user_requirement = "Write project schedule for a snake game following these requirements:..."
>>> action = WriteTasks()
>>> result = await action.run(design_filename=design_filename, output_pathname=output_pathname)
>>> result = await action.run(user_requirement=user_requirement,design_filename=design_filename, output_pathname=output_pathname)
>>> print(result)
The project schedule is at /absolute/path/to/snake_game/docs/project_schedule.json
The project schedule is at /absolute/path/to/nake_game/docs/project_schedule.json
# Write a project schedule with a user requirement.
>>> user_requirement = "Write project schedule for a snake game following these requirements: ..."

View file

@ -12,7 +12,7 @@ from metagpt.actions.action_node import ActionNode
REQUIRED_PYTHON_PACKAGES = ActionNode(
key="Required Python packages",
expected_type=List[str],
instruction="Provide required Python packages in requirements.txt format.",
instruction="Provide required Python packages in requirements.txt format. The response language should correspond to the context and requirements.",
example=["flask==1.1.2", "bcrypt==3.2.0"],
)

View file

@ -98,7 +98,7 @@ class WritePRD(Action):
Args:
user_requirement (str): A string detailing the user's requirements.
output_pathname (str, optional): The path name of file that the output document should be saved to. Defaults to "".
output_pathname (str, optional): The path name of file that the output document should be saved to. The path name must must end with '.json'. Defaults to "".
legacy_prd_filename (str, optional): The file path of the legacy Product Requirement Document to use as a reference. Defaults to "".
extra_info (str, optional): Additional information to include in the document. Defaults to "".
**kwargs: Additional keyword arguments.