Skip to content

Commit c78c263

Browse files
fix: handle non-dict types for overlapped_items in MultiHopSpecificQuerySynthesizer
- Updated logic to check if overlapped_items is a dictionary before extracting keys. - Ensured compatibility with non-dict types for overlapped_items.
1 parent e8112da commit c78c263

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ragas/testset/synthesizers/multi_hop/specific.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ async def _generate_scenarios(
8181
overlapped_items = []
8282
overlapped_items = triplet[1].properties[self.relation_overlap_property]
8383
if overlapped_items:
84-
themes = list(dict(overlapped_items).keys())
84+
themes = (
85+
list(overlapped_items.keys())
86+
if isinstance(overlapped_items, dict)
87+
else overlapped_items
88+
)
8589
prompt_input = ThemesPersonasInput(
8690
themes=themes, personas=persona_list
8791
)

0 commit comments

Comments
 (0)