Hi <@U08CKJH7C12>, is there any way to download ch...
# agents
t
Hi @refined-appointment-81829, is there any way to download chat
l
r
Here is one option you can try. Save the transcript then transfer to your server: https://docs.livekit.io/agents/ops/recording/#text-transcripts
Copy code
from datetime import datetime
import json

def entrypoint(ctx: JobContext):
    # Add the following code to the top, before calling ctx.connect()
    
    async def write_transcript():
        current_date = datetime.now().strftime("%Y%m%d_%H%M%S")

        # This example writes to the temporary directory, but you can save to any location
        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)

    # .. The rest of your entrypoint code follows ..
t
Thank you @refined-appointment-81829