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

1import asyncio
2
3from signalwire.ai_chat import AIChatClient
4
5VISIBLE = {"user", "assistant"}
6
7
8async def main():
9 async with AIChatClient(space="your-space") as client:
10 conversation = await client.log("chat-8f21")
11
12 for message in conversation.messages:
13 if message["role"] in VISIBLE:
14 print(message["role"], message["content"])
15
16
17asyncio.run(main())