diff --git a/gpt_researcher/skills/context_manager.py b/gpt_researcher/skills/context_manager.py index 35c5f9a10..7c0380432 100644 --- a/gpt_researcher/skills/context_manager.py +++ b/gpt_researcher/skills/context_manager.py @@ -26,7 +26,19 @@ async def get_similar_content_by_query(self, query, pages): return await context_compressor.async_get_context( query=query, max_results=10, cost_callback=self.researcher.add_costs ) - + + async def get_similar_content_by_query_with_vectorstore(self, query, filter): + if self.researcher.verbose: + await stream_output( + "logs", + "fetching_query_format", + f" Getting relevant content based on query: {query}...", + self.researcher.websocket, + ) + vectorstore_compressor = VectorstoreCompressor(self.researcher.vector_store, filter) + return await vectorstore_compressor.async_get_context(query=query, max_results=8) + + async def get_similar_written_contents_by_draft_section_titles( self, current_subtopic: str,