diff --git a/ai_ta_backend/service/retrieval_service.py b/ai_ta_backend/service/retrieval_service.py index eb9fb2ba..158c7ce6 100644 --- a/ai_ta_backend/service/retrieval_service.py +++ b/ai_ta_backend/service/retrieval_service.py @@ -57,7 +57,7 @@ def getTopContexts(self, search_query: str, course_name: str, token_limit: int = 4_000, - doc_groups: List[str] = []) -> Union[List[Dict], str]: + doc_groups: List[str] | None = None) -> Union[List[Dict], str]: """Here's a summary of the work. /GET arguments @@ -68,6 +68,8 @@ def getTopContexts(self, or String: An error message with traceback. """ + if doc_groups is None: + doc_groups = [] try: start_time_overall = time.monotonic() @@ -345,7 +347,9 @@ def delete_from_nomic_and_supabase(self, course_name: str, identifier_key: str, print(f"Supabase Error in delete. {identifier_key}: {identifier_value}", e) self.sentry.capture_exception(e) - def vector_search(self, search_query, course_name, doc_groups: List[str] = []): + def vector_search(self, search_query, course_name, doc_groups: List[str] | None = None): + if doc_groups is None: + doc_groups = [] top_n = 80 # EMBED openai_start_time = time.monotonic()