Refactor async logging logic in report generation.
Removed unused log yielding in `main.py` to simplify the flow. Updated `send_json` in `deepresearch.py` to use an async generator for more flexible streaming of log data.
This commit is contained in:
parent
ade4511a87
commit
327758f00f
2 changed files with 3 additions and 4 deletions
|
@ -38,8 +38,6 @@ async def get_report_endpoint(request: ReportRequest):
|
|||
# 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:
|
||||
yield f"Error: {str(e)}"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue