diff --git a/backend/server.py b/backend/server.py index 55d8a3db7..7167044d2 100644 --- a/backend/server.py +++ b/backend/server.py @@ -77,6 +77,7 @@ async def websocket_endpoint(websocket: WebSocket): json_data = json.loads(data[6:]) task = json_data.get("task") report_type = json_data.get("report_type") + source_urls = json_data.get("source_urls") tone = json_data.get("tone") headers = json_data.get("headers", {}) filename = f"task_{int(time.time())}_{task}" @@ -86,7 +87,7 @@ async def websocket_endpoint(websocket: WebSocket): report_source = json_data.get("report_source") if task and report_type: report = await manager.start_streaming( - task, report_type, report_source, tone, websocket, headers + task, report_type, report_source, source_urls, tone, websocket, headers ) # Ensure report is a string if not isinstance(report, str): diff --git a/backend/websocket_manager.py b/backend/websocket_manager.py index 0f47e6fe1..2c5287ff0 100644 --- a/backend/websocket_manager.py +++ b/backend/websocket_manager.py @@ -54,14 +54,14 @@ async def disconnect(self, websocket: WebSocket): del self.message_queues[websocket] - async def start_streaming(self, task, report_type, report_source, tone, websocket, headers=None): + async def start_streaming(self, task, report_type, report_source, source_urls, tone, websocket, headers=None): """Start streaming the output.""" tone = Tone[tone] - report = await run_agent(task, report_type, report_source, tone, websocket, headers) + report = await run_agent(task, report_type, report_source, source_urls, tone, websocket, headers) return report -async def run_agent(task, report_type, report_source, tone: Tone, websocket, headers=None): +async def run_agent(task, report_type, report_source, source_urls, tone: Tone, websocket, headers=None): """Run the agent.""" # measure time start_time = datetime.datetime.now() @@ -76,7 +76,7 @@ async def run_agent(task, report_type, report_source, tone: Tone, websocket, hea query=task, report_type=report_type, report_source=report_source, - source_urls=None, + source_urls=source_urls, tone=tone, config_path=config_path, websocket=websocket, @@ -88,14 +88,14 @@ async def run_agent(task, report_type, report_source, tone: Tone, websocket, hea query=task, report_type=report_type, report_source=report_source, - source_urls=None, + source_urls=source_urls, tone=tone, config_path=config_path, websocket=websocket, headers=headers ) report = await researcher.run() - + # measure time end_time = datetime.datetime.now() await websocket.send_json( diff --git a/frontend/index.html b/frontend/index.html index ec1b30bb9..c31e0960d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -179,7 +179,19 @@