Skip to content

VizroAI

vizro_ai

VizroAI

Vizro-AI main class.

__init__

__init__(model=None)

Initialization of VizroAI.

Parameters:

  • model (Optional[Union[BaseChatModel, str]], default: None ) –

    model instance or model name.

dashboard

dashboard(dfs, user_input, return_elements=False)

Creates a Vizro dashboard using english descriptions.

Parameters:

  • dfs (list[DataFrame]) –

    The dataframes to be analyzed.

  • user_input (str) –

    User questions or descriptions of the desired visual.

  • return_elements (bool, default: False ) –

    Flag to return DashboardOutputs dataclass that includes all possible elements generated.

Returns:

  • Union[DashboardOutputs, Dashboard]

    vm.Dashboard or DashboardOutputs dataclass.

plot

plot(df, user_input, max_debug_retry=1, return_elements=False, validate_code=True)

Plot visuals using vizro via english descriptions, english to chart translation.

Parameters:

  • df (DataFrame) –

    The dataframe to be analyzed.

  • user_input (str) –

    User questions or descriptions of the desired visual.

  • max_debug_retry (int, default: 1 ) –

    Maximum number of retries to debug errors. Defaults to 1.

  • return_elements (bool, default: False ) –

    Flag to return ChartPlan pydantic model that includes all possible elements generated. Defaults to False.

  • validate_code (bool, default: True ) –

    Flag if produced code should be executed to validate it. Defaults to True.

Returns:

  • Union[Figure, ChartPlan]

    go.Figure or ChartPlan pydantic model