Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

feat: +sequence merge

莘权 马1b9ce4abca06
diff --git a/metagpt/actions/rebuild_sequence_view.py b/metagpt/actions/rebuild_sequence_view.py
index 978ce4a8a..08fff81b9 100644
--- a/metagpt/actions/rebuild_sequence_view.py
+++ b/metagpt/actions/rebuild_sequence_view.py
@@ -267,7 +267,7 @@ class RebuildSequenceView(Action):
for r in rows:
_, name = split_namespace(r.subject)
if name == class_name:
- participants.append(name)
+ participants.append(r)
if len(participants) == 0:
await self.graph_db.insert(
subject=entry.subject, predicate=GraphKeyword.HAS_PARTICIPANT, object_=concat_namespace("?", class_name)
@@ -304,6 +304,10 @@ class RebuildSequenceView(Action):
block += await self._get_source_code(participant.subject)
block += "\n```\n"
prompt_blocks.append(block)
+ block = "## Legacy Sequence View\n"
+ rows = await self.graph_db.select(subject=entry.subject, predicate=GraphKeyword.HAS_SEQUENCE_VIEW)
+ block += rows[0].object_
+ prompt_blocks.append(block)
prompt = "\n---\n".join(prompt_blocks)
self.llm.aask(prompt, system_msgs=["You are a tool to cooperator"])
diff --git a/metagpt/repo_parser.py b/metagpt/repo_parser.py
index e27b4bb70..c11627595 100644
--- a/metagpt/repo_parser.py
+++ b/metagpt/repo_parser.py
@@ -121,7 +121,7 @@ class DotClassAttribute(BaseModel):
}
result = set()
for t in types:
- t = t.strip()
+ t = re.sub(r"['\"]", "", t.strip())
if t and t not in filters:
result.add(t)
return list(result)