diff --git a/graphrag/query/structured_search/drift_search/search.py b/graphrag/query/structured_search/drift_search/search.py index 93ac5bba..947cb726 100644 --- a/graphrag/query/structured_search/drift_search/search.py +++ b/graphrag/query/structured_search/drift_search/search.py @@ -120,7 +120,7 @@ class DRIFTSearch(BaseSearch[DRIFTSearchContextBuilder]): i["intermediate_answer"] for i in response if "intermediate_answer" in i ] - if len(intermediate_answers) == 0: + if not intermediate_answers: error_msg = "No intermediate answers found in primer response. Ensure that the primer response includes intermediate answers." raise RuntimeError(error_msg) diff --git a/graphrag/query/structured_search/drift_search/state.py b/graphrag/query/structured_search/drift_search/state.py index 17733f44..979a03e2 100644 --- a/graphrag/query/structured_search/drift_search/state.py +++ b/graphrag/query/structured_search/drift_search/state.py @@ -44,7 +44,7 @@ class QueryState: for follow_up in follow_ups: if isinstance(follow_up, str): follow_up = DriftAction(query=follow_up) - else: + elif not isinstance(follow_up, DriftAction): log.warning( "Follow-up action is not a string, found type: %s", type(follow_up) )