A Thread is a collection of related Runs grouped together for context. Threads are particularly useful when working on multi-turn conversations or workflows that involve multiple sequential or parallel operations.
Core Features:
-
Contextual Continuity: Ensures all related Runs are grouped for better observability.
-
Multi-Turn Support: Simplifies managing interactions that require maintaining state across multiple Runs.
Example:
A user interacting with a chatbot over multiple turns (e.g., asking follow-up questions) generates several Runs, but all are grouped under a single Thread to maintain continuity.
Headers for Thread:
x-thread-id
: Links all Runs in the same context or conversations.