feat: +sequence merge

This commit is contained in:
莘权 马 2024-01-26 20:23:24 +08:00
parent 67bf89996b
commit 1b9ce4abca
2 changed files with 6 additions and 2 deletions

View file

@ -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"])

View file

@ -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)