diff --git a/src/ragas/testset/synthesizers/multi_hop/base.py b/src/ragas/testset/synthesizers/multi_hop/base.py index ecccb6c33..48b72ba7c 100644 --- a/src/ragas/testset/synthesizers/multi_hop/base.py +++ b/src/ragas/testset/synthesizers/multi_hop/base.py @@ -161,7 +161,7 @@ async def _generate_sample( self, scenario: Scenario, callbacks: Callbacks ) -> SingleTurnSample: if not isinstance(scenario, MultiHopScenario): - logger.warning('scenario type should be MultiHopScenario') + raise TypeError('scenario type should be MultiHopScenario') reference_context = self.make_contexts(scenario) prompt_input = QueryConditions( persona=scenario.persona, diff --git a/src/ragas/testset/synthesizers/single_hop/base.py b/src/ragas/testset/synthesizers/single_hop/base.py index 6ab0c4412..3a60a6dbc 100644 --- a/src/ragas/testset/synthesizers/single_hop/base.py +++ b/src/ragas/testset/synthesizers/single_hop/base.py @@ -122,7 +122,7 @@ async def _generate_sample( self, scenario: Scenario, callbacks: Callbacks ) -> SingleTurnSample: if not isinstance(scenario, SingleHopScenario): - logger.warning('scenario type should be SingleHopScenario') + raise TypeError('scenario type should be SingleHopScenario') reference_context = scenario.nodes[0].properties.get("page_content", "") prompt_input = QueryCondition( persona=scenario.persona,