diff --git a/generic_rag/graphs/ret_gen.py b/generic_rag/graphs/ret_gen.py index c6f58d3..b3c97f4 100644 --- a/generic_rag/graphs/ret_gen.py +++ b/generic_rag/graphs/ret_gen.py @@ -48,10 +48,11 @@ class RetGenLangGraph: """ Method that retrieves the PDF sources used during the last invoke. """ - if self.last_invoke is None: - return [] - pdf_sources = {} + + if self.last_invoke is None: + return pdf_sources + for context in self.last_invoke["context"]: try: Path(context.metadata["source"]).suffix == ".pdf" @@ -84,10 +85,11 @@ class RetGenLangGraph: """ Method that retrieves the web sources used during the last invoke. """ - if self.last_invoke is None: - return set() - web_sources = set() + + if self.last_invoke is None: + return web_sources + for context in self.last_invoke["context"]: try: context.metadata["filetype"] == "web"