Conversations
Usetracer.conversation(conversation_id, user_id=...) to group spans across multiple turns of a chat into a single conversation context. All nested spans inherit the conversation_id (and optional user_id) so you can analyze end‑to‑end sessions.
Start a conversation
conversation_basic.py
Multi‑turn conversations
Re‑use the sameconversation_id across turns to stitch a session together.
multi_turn.py
Track state and I/O on spans
state_and_io.py
- In async frameworks, set
trace_across_async_contexts=Trueon yourTracerand onwrap(...)for LLM clients so conversation context flows across await points. - To see a complete server example, check the FastAPI guide.
FastAPI Integration
See a full multi‑turn chatbot with conversations, tools, and LLM calls.

