-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Description
Hi assafelovic,
Me again :),
I am not sure if this is really an issue, but for me it seems that when not relevant context is found (self.context = []) inside the write_report method the final report just makes up some sources and content which looks for the moment very real, but confused me a lot when I implemented my customRag Retriever, since it did not found anything but the report invented web sources.
So when I introduced my write_report wrapper in my overladed GPTResearcher class it now just tell me no relevant source foiund
async def write_report(self, existing_headers: list = [], relevant_written_contents: list = [], ext_context: str = ""):
"""
Override the original write_report method to handle empty RAG results.
If no context is found, return a structured object with "no results" information.
"""
# Check if we have any meaningful context
print("self.context", self.context)
print("relevant_written_contents", relevant_written_contents)
print("ext_context", ext_context)
if not self.context or len(self.context.strip()) == 0:
await self._log_event("report", step="empty_context_detected")
return "NO_RESULTS_FOUND" # Simple string marker for basic_report.py to handle
# If we have context, use the original write_report method
return await super().write_report(existing_headers, relevant_written_contents, ext_context)
So i am really not sure what is going on here, it might have to do something with a special configuration parameter or something else. Maybe you can enlight us here?
Cheers
Metadata
Metadata
Assignees
Labels
No labels