import asyncio
import websockets

# Function to handle WebSocket connections and send transcriptions
async def send_transcription(websocket, path):
    while True:
        transcription = "Real-time transcription here"  # Replace with actual transcription
        await websocket.send(transcription)
        await asyncio.sleep(1)  # Simulates real-time updates

# Start the WebSocket server on localhost at port 8765
start_server = websockets.serve(send_transcription, "localhost", 8765)

# Run the WebSocket server
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()

