types.ServerValues

types.ServerValues(df, sql, title, client)

Session-specific reactive values and client returned by QueryChat.server().

This dataclass contains all the session-specific reactive state for a QueryChat instance. Each session gets its own ServerValues to ensure proper isolation between concurrent sessions.

Attributes

Name Type Description
df Callable[[], IntoFrameT] A reactive Calc that returns the current filtered data frame or lazy frame. If the data source is lazy, returns a LazyFrame. If no SQL query has been set, this returns the unfiltered data from the data source. Call it like .df() to reactively read the current data.
sql ReactiveStringOrNone A reactive Value containing the current SQL query string. Access the value by calling .sql(), or set it with .sql.set("SELECT ..."). Returns None if no query has been set.
title ReactiveStringOrNone A reactive Value containing the current title for the query. The LLM provides this title when generating a new SQL query. Access it with .title(), or set it with .title.set("..."). Returns None if no title has been set.
client ServerClient Session chat client value. For real sessions this is a chatlas.Chat created by the client factory. For deferred stub sessions (where data_source is not set yet), this is a placeholder client that raises when accessed.