Skip to content

IQLGenerator#

dbally.iql_generator.iql_generator.IQLGenerator #

IQLGenerator(filters_generation: Optional[IQLOperationGenerator] = None, aggregation_generation: Optional[IQLOperationGenerator] = None)

Orchestrates all IQL operations for the given question.

Constructs a new IQLGenerator instance.

PARAMETER DESCRIPTION
decision_prompt

Prompt template for filtering decision making.

generation_prompt

Prompt template for IQL generation.

Source code in src/dbally/iql_generator/iql_generator.py
def __init__(
    self,
    filters_generation: Optional["IQLOperationGenerator"] = None,
    aggregation_generation: Optional["IQLOperationGenerator"] = None,
) -> None:
    """
    Constructs a new IQLGenerator instance.

    Args:
        decision_prompt: Prompt template for filtering decision making.
        generation_prompt: Prompt template for IQL generation.
    """
    self._filters_generation = filters_generation or IQLOperationGenerator[IQLFiltersQuery](
        FILTERING_DECISION_TEMPLATE,
        FILTERS_GENERATION_TEMPLATE,
    )
    self._aggregation_generation = aggregation_generation or IQLOperationGenerator[IQLAggregationQuery](
        AGGREGATION_DECISION_TEMPLATE,
        AGGREGATION_GENERATION_TEMPLATE,
    )