diff --git a/vizro-ai/changelog.d/20240727_031259_lingyi_zhang_vizroai_code.md b/vizro-ai/changelog.d/20240727_031259_lingyi_zhang_vizroai_code.md new file mode 100644 index 000000000..f1f65e73c --- /dev/null +++ b/vizro-ai/changelog.d/20240727_031259_lingyi_zhang_vizroai_code.md @@ -0,0 +1,48 @@ + + + + + + + + + diff --git a/vizro-ai/src/vizro_ai/plot/components/__init__.py b/vizro-ai/src/vizro_ai/plot/components/__init__.py index 3d0fc8204..0ec637392 100644 --- a/vizro-ai/src/vizro_ai/plot/components/__init__.py +++ b/vizro-ai/src/vizro_ai/plot/components/__init__.py @@ -1,4 +1,4 @@ -from ._base import VizroAiComponentBase +from ._base import VizroAIComponentBase from .chart_selection import GetChartSelection from .code_validation import GetDebugger from .custom_chart_wrap import GetCustomChart @@ -7,7 +7,7 @@ from .visual_code import GetVisualCode __all__ = [ - "VizroAiComponentBase", + "VizroAIComponentBase", "GetChartSelection", "GetDataFrameCraft", "GetVisualCode", diff --git a/vizro-ai/src/vizro_ai/plot/components/_base.py b/vizro-ai/src/vizro_ai/plot/components/_base.py index a0f16b96f..afeef8ddd 100644 --- a/vizro-ai/src/vizro_ai/plot/components/_base.py +++ b/vizro-ai/src/vizro_ai/plot/components/_base.py @@ -6,7 +6,7 @@ from vizro_ai.chains import FunctionCallChain -class VizroAiComponentBase(ABC): +class VizroAIComponentBase(ABC): """Abstract Base Class that represents a blueprint for Vizro-AI components. Attributes diff --git a/vizro-ai/src/vizro_ai/plot/components/chart_selection.py b/vizro-ai/src/vizro_ai/plot/components/chart_selection.py index 3186f7c6c..1f0495742 100644 --- a/vizro-ai/src/vizro_ai/plot/components/chart_selection.py +++ b/vizro-ai/src/vizro_ai/plot/components/chart_selection.py @@ -12,7 +12,7 @@ from langchain_core.language_models.chat_models import BaseChatModel from vizro_ai.chains._chain_utils import _log_time -from vizro_ai.plot.components import VizroAiComponentBase +from vizro_ai.plot.components import VizroAIComponentBase from vizro_ai.plot.schema_manager import SchemaManager # initialization of schema manager, and register schema needed @@ -39,7 +39,7 @@ class ChartSelection(BaseModel): # 3. Define Component -class GetChartSelection(VizroAiComponentBase): +class GetChartSelection(VizroAIComponentBase): """Get Chart Types. Attributes diff --git a/vizro-ai/src/vizro_ai/plot/components/code_validation.py b/vizro-ai/src/vizro_ai/plot/components/code_validation.py index 4b2dc2910..f5344ddbc 100644 --- a/vizro-ai/src/vizro_ai/plot/components/code_validation.py +++ b/vizro-ai/src/vizro_ai/plot/components/code_validation.py @@ -11,7 +11,7 @@ from langchain_core.language_models.chat_models import BaseChatModel from vizro_ai.chains._chain_utils import _log_time -from vizro_ai.plot.components import VizroAiComponentBase +from vizro_ai.plot.components import VizroAIComponentBase from vizro_ai.plot.schema_manager import SchemaManager # 1. Define schema @@ -35,7 +35,7 @@ class CodeDebug(BaseModel): # 3. Define Component -class GetDebugger(VizroAiComponentBase): +class GetDebugger(VizroAIComponentBase): """Get Visual code. Attributes diff --git a/vizro-ai/src/vizro_ai/plot/components/custom_chart_wrap.py b/vizro-ai/src/vizro_ai/plot/components/custom_chart_wrap.py index 0eeba174c..fab6f6a77 100644 --- a/vizro-ai/src/vizro_ai/plot/components/custom_chart_wrap.py +++ b/vizro-ai/src/vizro_ai/plot/components/custom_chart_wrap.py @@ -11,7 +11,7 @@ from langchain_core.language_models.chat_models import BaseChatModel from vizro_ai.chains._chain_utils import _log_time -from vizro_ai.plot.components import VizroAiComponentBase +from vizro_ai.plot.components import VizroAIComponentBase from vizro_ai.plot.schema_manager import SchemaManager logger = logging.getLogger(__name__) @@ -38,7 +38,7 @@ class CustomChart(BaseModel): """ -class GetCustomChart(VizroAiComponentBase): +class GetCustomChart(VizroAIComponentBase): # TODO Explore if it is possible to create CustomChart without LLM """Get custom chart code. diff --git a/vizro-ai/src/vizro_ai/plot/components/dataframe_craft.py b/vizro-ai/src/vizro_ai/plot/components/dataframe_craft.py index e63d24083..a62fc112f 100755 --- a/vizro-ai/src/vizro_ai/plot/components/dataframe_craft.py +++ b/vizro-ai/src/vizro_ai/plot/components/dataframe_craft.py @@ -14,7 +14,7 @@ from langchain_core.language_models.chat_models import BaseChatModel from vizro_ai.chains._chain_utils import _log_time -from vizro_ai.plot.components import VizroAiComponentBase +from vizro_ai.plot.components import VizroAIComponentBase from vizro_ai.plot.schema_manager import SchemaManager logger = logging.getLogger(__name__) @@ -42,7 +42,7 @@ class DataFrameCraft(BaseModel): # 3. Define Component -class GetDataFrameCraft(VizroAiComponentBase): +class GetDataFrameCraft(VizroAIComponentBase): """Get dataframe code. Attributes diff --git a/vizro-ai/src/vizro_ai/plot/components/explanation.py b/vizro-ai/src/vizro_ai/plot/components/explanation.py index ca68a8732..5139f2321 100644 --- a/vizro-ai/src/vizro_ai/plot/components/explanation.py +++ b/vizro-ai/src/vizro_ai/plot/components/explanation.py @@ -10,7 +10,7 @@ from langchain_core.language_models.chat_models import BaseChatModel from vizro_ai.chains._chain_utils import _log_time -from vizro_ai.plot.components import VizroAiComponentBase +from vizro_ai.plot.components import VizroAIComponentBase from vizro_ai.plot.schema_manager import SchemaManager # 1. Define schema @@ -35,7 +35,7 @@ class CodeExplanation(BaseModel): # 3. Define Component -class GetCodeExplanation(VizroAiComponentBase): +class GetCodeExplanation(VizroAIComponentBase): """Get Explanation of a code snippet. Attributes diff --git a/vizro-ai/src/vizro_ai/plot/components/visual_code.py b/vizro-ai/src/vizro_ai/plot/components/visual_code.py index 636c7ca79..67f848212 100644 --- a/vizro-ai/src/vizro_ai/plot/components/visual_code.py +++ b/vizro-ai/src/vizro_ai/plot/components/visual_code.py @@ -10,7 +10,7 @@ from langchain_core.language_models.chat_models import BaseChatModel from vizro_ai.chains._chain_utils import _log_time -from vizro_ai.plot.components import VizroAiComponentBase +from vizro_ai.plot.components import VizroAIComponentBase from vizro_ai.plot.schema_manager import SchemaManager # 1. Define schema @@ -34,7 +34,7 @@ class VizroCode(BaseModel): # 3. Define Component -class GetVisualCode(VizroAiComponentBase): +class GetVisualCode(VizroAIComponentBase): """Get Visual code. Attributes