Skip to content

Commit

Permalink
expand lists when adding entities ..
Browse files Browse the repository at this point in the history
after relationship selection
  • Loading branch information
slobentanzer committed Nov 29, 2023
1 parent 83cf7e7 commit e7854e3
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions biochatter/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,16 +372,14 @@ def _select_relationships(self) -> bool:

if self.selected_relationship_labels:
for key, value in self.selected_relationship_labels.items():
if (
value["source"]
and value["source"] not in self.selected_entities
):
self.selected_entities.append(value["source"])
if (
value["target"]
and value["target"] not in self.selected_entities
):
self.selected_entities.append(value["target"])
sources = ensure_iterable(value["source"])
targets = ensure_iterable(value["target"])
for source in sources:
if source not in self.selected_entities:
self.selected_entities.append(source)
for target in targets:
if target not in self.selected_entities:
self.selected_entities.append(target)

return bool(result)

Expand Down

0 comments on commit e7854e3

Please sign in to comment.