API Reference
vizro_ai.agents
Vizro-AI agents.
This module contains pre-configured Pydantic AI agents. Below you can find a list of all agents available and their respective response models/types instructions. For more information on how to use those agents, see the Pydantic AI agents documentation.
vizro_ai.agents.response_models
BaseChartPlan
Bases: BaseModel
Base chart plan used to generate chart code based on user visualization requirements.
chart_function
property
vizro_chart_function
property
get_chart_function
Return a callable function with customizable name and vizro flag.
This method returns a reusable function that can be called with a dataframe and optional keyword arguments. The function name and Vizro compatibility can be customized.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart_name
|
str
|
Name of the chart function. |
required |
vizro
|
bool
|
Whether to generate Vizro-compatible code. |
required |
Returns:
| Type | Description |
|---|---|
Callable[..., Figure]
|
A callable function that accepts |
ChartPlan
ChartPlanFactory
__new__
Creates a chart plan model that executes the chart code as part of the model validation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_frame
|
DataFrame
|
DataFrame to use for validation |
required |
chart_plan
|
type[BaseChartPlan]
|
Chart plan model to run extended validation against. |
ChartPlan
|
Returns:
| Type | Description |
|---|---|
type[BaseChartPlan]
|
Chart plan model with additional validation |