astonishing-salesclerk-9701
12/13/2025, 11:29 AMtall-airline-16756
12/13/2025, 11:29 AMtall-airline-16756
12/13/2025, 11:30 AMchat_ctx property; it contains the conversation items.
• Iterate `self.chat_ctx.items`; each item may be a ChatMessage, FunctionCall, or FunctionCallOutput. Example:
async def my_method(self):
for item in self.chat_ctx.items:
if hasattr(item, 'content'):
print(f"Message: {item.content}")
• For the full session history (including across handoffs), use self.session.history.
Would you like an example tailored to a specific language or a sample that filters by message role (user/system/assistant)?
Sources: Agents v0.x migration guide - Node.js | LiveKit Docsastonishing-salesclerk-9701
12/13/2025, 11:30 AMtall-airline-16756
12/13/2025, 11:30 AMself.session.history.to_dict() which returns the full conversation as serializable dictionaries. Example:
async def my_method(self):
# returns a list[dict] with keys like 'role' and 'text_content'
messages_as_dicts = self.session.history.to_dict()
# optional: filter or transform
simplified = [
{"role": m.get("role"), "content": m.get("text_content")}
for m in messages_as_dicts
]
return simplified
Would you like the dicts to include timestamps, message IDs, or function-call details?
Sources: Observability data hooks | LiveKit docs | Agents and handoffs | LiveKit docs