Thread

class Thread(Utils)

Using the with statement

If you prefer to have more flexibility in logging Threads, you can use the with statement. You can create a thread and execute code within it using the with statement:

You can also continue a thread by passing the thread id to the thread method:

Using the Literal AI API client

You can also create Threads using the literalai_client.api.create_thread() method.

Using Chainlit

If you built your LLM application with Chainlit, you don’t need to specify Threads in your code. Chainlit logs Threads for you by default.