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:
parent
14429fc6f7
commit
ade4511a87
2 changed files with 2 additions and 1 deletions
|
@ -37,6 +37,7 @@ async def get_report_endpoint(request: ReportRequest):
|
|||
try:
|
||||
# Call the asynchronous get_report function
|
||||
generator = ReportGenerator(request.query, request.report_type)
|
||||
await generator.generate_report()
|
||||
async for log in generator:
|
||||
yield log
|
||||
except Exception as e:
|
||||
|
|
|
@ -27,7 +27,7 @@ class ReportGenerator:
|
|||
|
||||
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.
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue