breezy-knife-25008
11/13/2025, 11:13 PMtall-airline-16756
11/13/2025, 11:13 PMtall-airline-16756
11/13/2025, 11:14 PMfrom datetime import datetime
import json
async def entrypoint(ctx):
async def write_transcript():
current_date = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"/tmp/transcript_{ctx.room.name}_{current_date}.json"
with open(filename, 'w') as f:
json.dump(session.history.to_dict(), f, indent=2)
print(f"Transcript for {ctx.room.name} saved to {filename}")
ctx.add_shutdown_callback(write_transcript)
await ctx.connect()
This way, you can be confident the transcript is saved automatically once the session ends. If you’d like, I’m here to walk you through any part of this or explore other methods that might suit your needs better. Just let me know!
Sources: Session recording and transcripts | LiveKit docs | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.p... | agents/src/voice/audio_recognition.ts