234
This commit is contained in:
@@ -220,8 +220,8 @@ async def chat(websocket: WebSocket):
|
||||
async for message in stream:
|
||||
if isinstance(message, TaskResult):
|
||||
continue
|
||||
print(f"----------------{message.source}----------------\n {message.content}")
|
||||
if message.type == 'TextMessage' and message.type == 'HandoffMessage':
|
||||
if message.type == 'TextMessage' or message.type == 'HandoffMessage':
|
||||
print(f"----------------{message.source}----------------\n {message.content}")
|
||||
await websocket.send_json(message.model_dump())
|
||||
if not isinstance(message, UserInputRequestedEvent):
|
||||
history.append(message.model_dump())
|
||||
@@ -338,7 +338,8 @@ async def websocket_endpoint(websocket: WebSocket, camera_id: str):
|
||||
send_task.cancel()
|
||||
await asyncio.gather(capture_task, send_task, return_exceptions=True)
|
||||
finally:
|
||||
process.kill()
|
||||
if process and process.poll() is None: # Check if the process is still running
|
||||
process.kill()
|
||||
await websocket.close()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user