DBT Model

class dbt_llm_tools.DbtModel(documentation: DbtModelDict)[source]

A class representing a dbt model.

Attributes:

name (str): The name of the model. description (str, optional): The description of the model. columns (list[DbtModelColumn], optional):

A list of columns contained in the model. May or may not be exhaustive.

as_dict() DbtModelDict[source]

Returns the dbt model as a dictionary.

Returns:

DbtModelDict: A dictionary representation of the dbt model.

as_prompt_text(template_function: Callable[[DbtModelDict], str] | None = None) str[source]

Returns pre-formatted description of the model containing it’s name, description and names and decriptions of all the columns.

Args:

template_function (fn, optional): A function that takes a model name, description and a list of columns as arguments and returns a text description of the model.

Returns:

str: A pre-formatted string that documents the column