Skip to content

Commit

Permalink
raise error for type check
Browse files Browse the repository at this point in the history
  • Loading branch information
oslijunw committed Jan 15, 2025
1 parent 3fddbc1 commit b7d0351
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ragas/testset/synthesizers/multi_hop/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/ragas/testset/synthesizers/single_hop/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b7d0351

Please sign in to comment.