From 1a9c88c8aa29e27a237ba7a34252b0f8b430a4e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Wed, 19 Jun 2024 12:02:29 +0800 Subject: [PATCH] fixbug: detect interactions --- examples/mgx_write_project_framework.py | 5 ++++- .../requirement_analysis/framework/evaluate_framework.py | 3 ++- .../actions/requirement_analysis/trd/detect_interaction.py | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/mgx_write_project_framework.py b/examples/mgx_write_project_framework.py index 109ce877d..f82666e04 100644 --- a/examples/mgx_write_project_framework.py +++ b/examples/mgx_write_project_framework.py @@ -90,7 +90,10 @@ Given the user requirement of "User Requirements", write out the software framew ## User Requirements {user_requirements} """ - env.publish_message(UserMessage(content=msg.format(user_requirements="\n".join(user_requirements)))) + env.publish_message( + UserMessage(content=msg.format(user_requirements="\n".join(user_requirements)), send_to="Bob"), + user_defined_recipient="Bob", + ) while not env.is_idle: await env.run() diff --git a/metagpt/actions/requirement_analysis/framework/evaluate_framework.py b/metagpt/actions/requirement_analysis/framework/evaluate_framework.py index 8aa120712..f81da6f5b 100644 --- a/metagpt/actions/requirement_analysis/framework/evaluate_framework.py +++ b/metagpt/actions/requirement_analysis/framework/evaluate_framework.py @@ -92,7 +92,8 @@ You are a tool that evaluates the quality of framework code based on the TRD con You need to refer to the content of the "Legacy TRD" section to check for any errors or omissions in the framework code found in "Legacy Outputs"; The content of "Actor, System, External System" provides an explanation of actors and systems that appear in UML Use Case diagram; Information about the external system missing from the "Legacy TRD" can be found in the "Acknowledge" section; -Which interfaces defined in "Acknowledge" are used in the "Legacy TRD"? Do not implement the interface in "Acknowledge" section until it is used in "Legacy TRD"; +Which interfaces defined in "Acknowledge" are used in the "Legacy TRD"? +Do not implement the interface in "Acknowledge" section until it is used in "Legacy TRD"; Parts not mentioned in the "Legacy TRD" will be handled by other TRDs, therefore, processes not present in the "Legacy TRD" are considered ready; "Additional Technical Requirements" specifies the additional technical requirements that the generated software framework code must meet; Return a markdown JSON object with: diff --git a/metagpt/actions/requirement_analysis/trd/detect_interaction.py b/metagpt/actions/requirement_analysis/trd/detect_interaction.py index 844266034..b77193194 100644 --- a/metagpt/actions/requirement_analysis/trd/detect_interaction.py +++ b/metagpt/actions/requirement_analysis/trd/detect_interaction.py @@ -87,9 +87,12 @@ You are a tool for capturing interaction events. "Actor, System, External System" provides the possible participants of the interaction event; "Legacy Interaction Events" is the contents of the interaction events that you output earlier; Some descriptions in the "Evaluation Conclusion" relate to the content of "User Requirements", and these descriptions in the "Evaluation Conclusion" address some issues regarding the content of "Legacy Interaction Events"; -You need to capture the interaction events occurring in the description within the content of "User Requirements", including: -1. Who is interacting with whom. An interaction event has a maximum of 2 participants. If there are multiple participants, it indicates that multiple events are combined into one event and should be further split.\; +You need to capture the interaction events occurring in the description within the content of "User Requirements" word-for-word, including: +1. Who is interacting with whom. An interaction event has a maximum of 2 participants. If there are multiple participants, it indicates that multiple events are combined into one event and should be further split; 2. When an interaction event occurs, who is the initiator? What data did the initiator enter? +3. What data does the interaction event ultimately return according to the "User Requirements"? + +You can check the data flow described in the "User Requirements" to see if there are any missing interaction events; Return a markdown JSON object list, each object of the list containing: - a "name" key containing the name of the interaction event; - a "participants" key containing a string list of the names of the two participants;