witty-yak-62929
08/19/2025, 5:37 PMtall-airline-16756
08/19/2025, 5:37 PMtall-airline-16756
08/19/2025, 5:38 PMwitty-yak-62929
08/19/2025, 5:39 PMtall-airline-16756
08/19/2025, 5:40 PMfrom livekit import api
async def record_individual_participants():
# Record the agent
agent_req = api.ParticipantEgressRequest(
room_name="your-room-name", # Swap this out with your actual room name
identity="agent-identity", # Use the agent’s identity here
file_outputs=[api.EncodedFileOutput(
filepath="agent-recording-{time}",
s3=api.S3Upload(
access_key="your-access-key", # Your S3 access key goes here
secret="your-secret", # Your S3 secret key here
region="your-region", # And your S3 region
bucket="your-bucket" # Don’t forget your S3 bucket name
)
)]
)
# Record the user
user_req = api.ParticipantEgressRequest(
room_name="your-room-name", # Same here, replace with your room name
identity="user-identity", # And the user’s identity
file_outputs=[api.EncodedFileOutput(
filepath="user-recording-{time}",
s3=api.S3Upload(
access_key="your-access-key", # Your S3 access key again
secret="your-secret", # Your S3 secret key
region="your-region", # Your S3 region
bucket="your-bucket" # Your S3 bucket name
)
)]
)
lkapi = api.LiveKitAPI()
await lkapi.egress.start_participant_egress(agent_req)
await lkapi.egress.start_participant_egress(user_req)
# Just call this function within your async environment when you’re ready
Just swap out placeholders like your-room-name
, agent-identity
, user-identity
, and your S3 credentials with your real info. If you hit any snags or want me to walk you through it, just give me a shout—I’m here to help!helpful-author-83080
09/17/2025, 9:40 AMtall-airline-16756
09/17/2025, 9:41 AMhelpful-author-83080
09/17/2025, 9:42 AMtall-airline-16756
09/17/2025, 9:42 AM