diff --git a/vizro-ai/changelog.d/20241205_104116_nadija_ratkusic_graca_update_safeguard_whitelist.md b/vizro-ai/changelog.d/20241205_104116_nadija_ratkusic_graca_update_safeguard_whitelist.md new file mode 100644 index 000000000..7c0d58d4f --- /dev/null +++ b/vizro-ai/changelog.d/20241205_104116_nadija_ratkusic_graca_update_safeguard_whitelist.md @@ -0,0 +1,48 @@ + + + + + + + + + diff --git a/vizro-ai/pyproject.toml b/vizro-ai/pyproject.toml index 015e302aa..791d2ab72 100644 --- a/vizro-ai/pyproject.toml +++ b/vizro-ai/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "langchain>=0.1.0, <0.3.0", # TODO update to pydantic v2 and remove upper bound "langgraph>=0.1.2, <0.2.17", # TODO update to pydantic v2 and remove upper bound (latest version break pydantic v1 compatibility) "python-dotenv>=1.0.0", # TODO decide env var management to see if we need this - "vizro>=0.1.23", + "vizro<=0.1.29", # Limited to current version of vizro, until the pydantic V2 changes of the main repo have been into here "langchain_openai", # Base dependency, ie minimum model working "black", "autoflake" diff --git a/vizro-ai/src/vizro_ai/plot/_response_models.py b/vizro-ai/src/vizro_ai/plot/_response_models.py index 17333373a..8daa0f4de 100644 --- a/vizro-ai/src/vizro_ai/plot/_response_models.py +++ b/vizro-ai/src/vizro_ai/plot/_response_models.py @@ -196,7 +196,8 @@ def _test_execute_chart_code(v, values): fig = custom_chart(data_frame.sample(10, replace=True)) except Exception as e: raise ValueError( - f"Produced code execution failed the following error: <{e}>. Please check the code and try again." + f"Produced code execution failed the following error: <{e}>. Please check the code and try again, " + f"alternatively try with a more powerful model." ) assert isinstance( fig, go.Figure diff --git a/vizro-ai/src/vizro_ai/plot/_utils/_constants.py b/vizro-ai/src/vizro_ai/plot/_utils/_constants.py index 86935f633..30db3eaf8 100644 --- a/vizro-ai/src/vizro_ai/plot/_utils/_constants.py +++ b/vizro-ai/src/vizro_ai/plot/_utils/_constants.py @@ -22,7 +22,7 @@ # '__build_class__', # '__import__', "abs", - # 'all', + "all", "any", # 'ascii', # 'bin', @@ -45,7 +45,7 @@ # 'input', # 'isinstance', # 'issubclass', - # 'iter', + "iter", # 'aiter', "len", # 'locals', @@ -60,7 +60,7 @@ # 'repr', "round", # 'setattr', - # 'sorted', + "sorted", "sum", # 'vars', "None", @@ -76,7 +76,7 @@ # 'complex', "dict", "enumerate", - # 'filter', + "filter", "float", # 'frozenset', # 'property', @@ -85,7 +85,7 @@ "map", # 'object', "range", - # 'reversed', + "reversed", "set", # 'slice', # 'staticmethod',