Implement AI orchestration wedding demo
This commit is contained in:
25
backend/app/simulator.py
Normal file
25
backend/app/simulator.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import asyncio
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
import websockets
|
||||
|
||||
|
||||
TRANSCRIPT = [
|
||||
{"speaker": "Bride", "text": "Add a note that the customer prefers white flowers."},
|
||||
{"speaker": "Planner", "text": "Create a task for Maria to confirm the photographer."},
|
||||
{"speaker": "Groom", "text": "We should reserve the venue for July 15."},
|
||||
{"speaker": "Bride", "text": "I'll call the florist tomorrow."},
|
||||
]
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
async with websockets.connect("ws://localhost:9000/ws/transcript") as socket:
|
||||
for item in TRANSCRIPT:
|
||||
await socket.send(json.dumps({**item, "timestamp": datetime.utcnow().isoformat()}))
|
||||
print(await socket.recv())
|
||||
await asyncio.sleep(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user