Add report generation step to the main async process

The `generate_report` method is now explicitly called within the main process, ensuring the researcher's report generation is initiated properly. Updated its return type annotation for clarity in `deepresearch.py`.
This commit is contained in:
ThomasTaroni 2025-04-25 18:39:33 +02:00
parent 14429fc6f7
commit ade4511a87
2 changed files with 2 additions and 1 deletions

View file

@ -37,6 +37,7 @@ async def get_report_endpoint(request: ReportRequest):
try: try:
# Call the asynchronous get_report function # Call the asynchronous get_report function
generator = ReportGenerator(request.query, request.report_type) generator = ReportGenerator(request.query, request.report_type)
await generator.generate_report()
async for log in generator: async for log in generator:
yield log yield log
except Exception as e: except Exception as e:

View file

@ -27,7 +27,7 @@ class ReportGenerator:
self.researcher = GPTResearcher(query, report_type, websocket=self.custom_logs_handler) self.researcher = GPTResearcher(query, report_type, websocket=self.custom_logs_handler)
async def generate_report(self): async def generate_report(self) -> CustomLogsHandler:
""" """
Conducts research and generates the report along with additional information. Conducts research and generates the report along with additional information.
""" """