how to get chat history in stt plugin?
# ask-ai
f
how to get chat history in stt plugin?
t
Thanks for reaching out, Deo. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking how to get chat history from the STT plugin — thanks, that's clear. Short answer: the STT plugin does not store chat history. Transcriptions from STT are added to the AgentSession (or Agent) conversation history. To access chat history or react to new transcriptions, use the session-level APIs and events. What you can do: • Access the full conversation history:
Copy code
history = session.history.to_dict()
• Listen for new conversation items:
Copy code
@session.on("conversation_item_added")
def on_conversation_item_added(event):
    print(f"Added: {event.item.role}: {event.item.text_content}")
• Listen specifically for STT transcription events:
Copy code
@session.on("user_input_transcribed")
def on_user_input_transcribed(event):
    print(f"Transcribed: {event.transcript}, final: {event.is_final}")
Would you like an example showing how to pull only user messages from
session.history
, or how to persist transcriptions to your own storage? Sources: Pipeline nodes and hooks | LiveKit docs | Events and error handling | LiveKit docs | Observability data hooks | LiveKit docs | Text and transcriptions | LiveKit docs