ChatSession
class ChatSession(broker: LlmBroker, model: String, systemPrompt: String? = null, tools: List<LlmTool> = emptyList(), config: CompletionConfig = CompletionConfig())
Multi-turn chat coordinator on top of an LlmBroker.
Owns the message history, an optional system prompt, and a default tool set so callers can send a single user prompt per turn without rebuilding the full message list each time. Mutable state is protected by a Mutex so the session is safe to share across coroutines.
Two surfaces mirror the broker:
send — suspending, single-shot turn returning the assistant text.
stream — cold
Flowof StreamEvent; history is updated atomically once the flow completes.
The session is the Kotlin analogue of the Python reference's ChatSession.