fresh-painting-88343
08/20/2025, 8:30 PMtall-airline-16756
08/20/2025, 8:30 PMtall-airline-16756
08/20/2025, 8:31 PMRoomEvent.TranscriptionReceived right in your frontend. This way, you’ll gather transcription segments as they come in.
• Combine Transcriptions and Chat Data: Try using handy hooks like useTranscriptions() and useChat() to bring together transcription and chat data for a complete view.
• Custom RPC Method: Another option is to create a custom RPC method where the agent shares the conversation history. The agent can set up an RPC method (like get_all_transcripts) that your frontend can call to fetch all the transcripts.
If you want a hand with any of these or have something specific in mind, just give me a shout—I’m here to help!
Sources: Transcriptions | LiveKit Docs | complex-agents/teleprompter/cartesia-ink.py | Session recording and transcripts | LiveKit Docs | Text and transcriptions | LiveKit Docsfresh-painting-88343
08/20/2025, 8:32 PMtall-airline-16756
08/20/2025, 8:32 PMget_all_transcripts RPC method:
Agent Side: The agent sets up the RPC method to share the conversation history:
from livekit import RoomContext
@ctx.room.local_participant.register_rpc_method("get_all_transcripts")
async def get_all_transcripts(data):
# Grab the conversation history
history = session.history # This is available on the agent session
return {"transcripts": history}
Frontend Side: On the frontend, you can call this RPC method to get the transcripts like this:
// Call the RPC method to request transcripts
const response = await room.localParticipant.performRpc({
destinationIdentity: agentParticipant.identity, // Just swap in the agent's identity here
method: "get_all_transcripts",
payload: "" // You can add a payload if needed, or leave it empty
});
// Here’s the transcripts you get back
const transcripts = response.transcripts;
console.log(transcripts);
If you want me to walk you through any part of this or help with adding it to your project, just let me know—I’m here to help!fresh-painting-88343
08/20/2025, 8:41 PMtall-airline-16756
08/20/2025, 8:42 PMTranscriptionSegment objects that hold the actual transcript details
TranscriptionSegment Object:
• id (string): A unique ID for each segment
• text (string): The actual transcribed text
• start_time (uint64): When this segment starts
• end_time (uint64): When this segment ends
• final (boolean): Shows if this transcription is final or just a draft
• language (string): The language used in the transcription
And here’s a quick example in TypeScript to help visualize it:
interface Transcription {
participantIdentity: string;
trackSid: string;
segments: TranscriptionSegment[];
}
interface TranscriptionSegment {
id: string;
text: string;
startTime: bigint;
endTime: bigint;
language: string;
final: boolean;
}
If you have any questions or want me to walk you through any part of this, just let me know—I’m happy to help!