log

View as MarkdownOpen in Claude

Read the conversation back. This changes nothing about the conversation.

Parameters

conversation_id
strRequired

The conversation to read.

Returns

ChatLog — carries messages and call_timeline.

Messages contain the fields returned by the service. Code that displays a transcript should not assume every entry has a timestamp. call_timeline contains any structured timeline entries returned for the conversation.

messages can include your prompt and other non-dialogue entries. Filter to user and assistant before displaying a transcript. ChatGateway.visible_messages() does this filtering for you.

Example

import asyncio
from signalwire.ai_chat import AIChatClient
VISIBLE = {"user", "assistant"}
async def main():
async with AIChatClient(space="your-space") as client:
conversation = await client.log("chat-8f21")
for message in conversation.messages:
if message["role"] in VISIBLE:
print(message["role"], message["content"])
asyncio.run(main())