nat.plugins.vanna.text2sql#

Attributes#

Classes#

StatusPayload

Payload for status intermediate steps.

Text2SQLOutput

Output schema for text2sql function.

Text2SQLConfig

Text2SQL configuration with Vanna integration.

Functions#

text2sql(config, builder)

Register the Text2SQL function with Vanna integration.

Module Contents#

logger#
class StatusPayload(/, **data: Any)#

Bases: pydantic.BaseModel

Payload for status intermediate steps.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

message: str#
class Text2SQLOutput(/, **data: Any)#

Bases: pydantic.BaseModel

Output schema for text2sql function.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

sql: str = None#
explanation: str | None = None#
class Text2SQLConfig(/, **data: Any)#

Bases: nat.data_models.function.FunctionBaseConfig

Text2SQL configuration with Vanna integration.

Currently only Databricks is supported.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

llm_name: nat.data_models.component_ref.LLMRef = None#
embedder_name: nat.data_models.component_ref.EmbedderRef = None#
milvus_retriever: nat.data_models.component_ref.RetrieverRef = None#
database_type: str = None#
connection_url: nat.plugins.vanna.db_utils.RequiredSecretStr = None#
milvus_search_limit: int = None#
allow_llm_to_see_data: bool = None#
execute_sql: bool = None#
train_on_startup: bool = None#
auto_training: bool = None#
initial_prompt: str | None = None#
n_results: int = None#
sql_collection: str = None#
ddl_collection: str = None#
doc_collection: str = None#
reasoning_models: set[str] = None#
chat_models: set[str] = None#
async text2sql(config: Text2SQLConfig, builder: nat.builder.builder.Builder)#

Register the Text2SQL function with Vanna integration.