Skip to content

Commit

Permalink
[Tidy] Update Vizro-AI error message and safeguards (#923)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadijagraca authored Dec 9, 2024
1 parent afdb96b commit f88ec76
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨
- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Removed
- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Added
- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Changed
- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Deprecated
- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Fixed
- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Security
- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
2 changes: 1 addition & 1 deletion vizro-ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion vizro-ai/src/vizro_ai/plot/_response_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions vizro-ai/src/vizro_ai/plot/_utils/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# '__build_class__',
# '__import__',
"abs",
# 'all',
"all",
"any",
# 'ascii',
# 'bin',
Expand All @@ -45,7 +45,7 @@
# 'input',
# 'isinstance',
# 'issubclass',
# 'iter',
"iter",
# 'aiter',
"len",
# 'locals',
Expand All @@ -60,7 +60,7 @@
# 'repr',
"round",
# 'setattr',
# 'sorted',
"sorted",
"sum",
# 'vars',
"None",
Expand All @@ -76,7 +76,7 @@
# 'complex',
"dict",
"enumerate",
# 'filter',
"filter",
"float",
# 'frozenset',
# 'property',
Expand All @@ -85,7 +85,7 @@
"map",
# 'object',
"range",
# 'reversed',
"reversed",
"set",
# 'slice',
# 'staticmethod',
Expand Down

0 comments on commit f88ec76

Please sign in to comment.