Skip to content

Commit

Permalink
changelog and fix for vizro-ai
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna-Xiong committed Oct 31, 2023
1 parent 77e20e0 commit 5d65af9
Show file tree
Hide file tree
Showing 16 changed files with 140 additions and 28 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ repos:
rev: v2.2.6
hooks:
- id: codespell
args: [-L sav]
additional_dependencies:
- tomli

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ target-version = ["py38"]

[tool.codespell]
builtin = "clear,rare,en-GB_to_en-US"
ignore-words-list = "grey,ned"
ignore-words-list = "grey,ned,sav"

[tool.mypy]
# strict checks : strict = true
Expand Down
4 changes: 2 additions & 2 deletions vizro-ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Vizro-AI is a tool for generating visualizations.

## Disclaimer

Please review the [Disclaimer]() before using `vizro-ai` package.
Please review the [Disclaimer](docs/pages/explanation/disclaimer.md) before using `vizro-ai` package.

## Documentation

Here is the link to the [Documentation]().
Here is the link to the [Documentation](docs/pages).
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

### Highlights ✨

- Initial release of vizro-ai package. Vizro-AI is a tool for generating data visualizations. ([#138](https://github.com/mckinsey/vizro/pull/138))

<!--
### 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))
-->
14 changes: 14 additions & 0 deletions vizro-ai/changelog.d/new_fragment.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

{% for cat in config.categories -%}
<!--
### {{ cat }}
- A bullet item for the {{ cat }} 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))
-->
{% endfor -%}
4 changes: 4 additions & 0 deletions vizro-ai/changelog.d/scriv.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[scriv]
version = literal: src/vizro_ai/__init__.py: __version__
format = md
categories = Highlights ✨, Removed, Added, Changed, Deprecated, Fixed, Security
6 changes: 3 additions & 3 deletions vizro-ai/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Vizro-AI is a tool for generating data visualizations.
Please review this [disclaimer](pages/explanation/disclaimer.md)
before using the `vizro-ai` package.

Since users must connect to LLMs (Large Language Models) in order to use Vizro-AI,
please also ensure that you review [usage of LLMs (Large Language Models)](pages/explanation/safety_in_vizro_ai.md)
Since users must connect to Large Language Models (LLMs) in order to use Vizro-AI,
please also ensure that you review [usage of LLMs](pages/explanation/safety_in_vizro_ai.md)
and required [safeguarding for dynamic code evaluation](pages/explanation/safeguard.md).


Expand All @@ -29,7 +29,7 @@ Vizro-AI is a tool for generating data visualizations.
<div class="card-content">
<h5>User Guides</h5>
<p>
Our user guides provide step-by-step instructions on how to leverage our core features.
Our user guides provide step-by-step instructions on how to install `vizro-ai` package and leverage our core features.
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion vizro-ai/docs/pages/explanation/disclaimer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disclaimer

Users must select one of the [supported Large Language Models](../user_guides/model_config.md) in order to use the `vizro-ai` package,
Users must select one of the [supported Large Language Models (LLMs)](../user_guides/model_config.md) in order to use the `vizro-ai` package,
and are responsible for obtaining their own suitable API key for the relevant model.

## Third Party API
Expand Down
6 changes: 3 additions & 3 deletions vizro-ai/docs/pages/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ to do so inside a virtual environment.

### 2. Set up jupyter notebook
A good way to initially explore Vizro-AI is from a Jupyter notebook.
Activate your previously create virtual environment and install Jupyter using the following command:
Activate your previously created virtual environment and install Jupyter using the following command:

```console
pip install jupyter
Expand All @@ -37,9 +37,9 @@ print(vizro_ai.__version__)

You should see a return output of the version.

### 3. Large Language Model API KEY
### 3. Large Language Model (LLM) API KEY

A prerequisite to use Vizro-AI is access to one of the supported large language models. Refer to the [user guide](../user_guides/api_setup.md) on how to set up the API.
A prerequisite to use Vizro-AI is access to one of the supported LLMs. Refer to the [user guide](../user_guides/api_setup.md) on how to set up the API.

After successful setup, your API key is loaded in Jupyter with the following two lines:

Expand Down
4 changes: 2 additions & 2 deletions vizro-ai/docs/pages/user_guides/api_setup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to setup the API
This guide shows how to set up the API key and other environment variables (e.g.,
base URL) so that you can seamlessly communicate with the LLM.
base URL) so that you can seamlessly communicate with the Large Language Model (LLM).

Users are recommended to review the third party API key section of the [disclaimer](../explanation/disclaimer.md) documentation.

Expand Down Expand Up @@ -33,7 +33,7 @@ __Method 2: Set up the API key as an environment variable for all projects__

To make the API key available for all projects, you can set it as an environment
variable. Please refer to the section ["Setup your API key for all projects"](https://platform.openai.com/docs/quickstart/step-2-setup-your-api-key?context=python)
in the OpenAI documentation.(It is under the dropdown of Step 2: Setup your API key).
in the OpenAI documentation. (It is under the dropdown of Step 2: Setup your API key).

It provides step-by-step instructions for setting up the API key as an environment
variable, on operating systems including Windows and MacOS.
Expand Down
6 changes: 3 additions & 3 deletions vizro-ai/docs/pages/user_guides/model_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

!!! Warning

Users are recommended to exercise caution and to research and understand the selected LLM (Large Language Model) before using `vizro-ai`.
Users are recommended to exercise caution and to research and understand the selected Large Language Model (LLM) before using `vizro-ai`.
Users should be cautious about sharing or inputting any personal or sensitive information.

**Data is sent to model vendors if you connect to LLMs (Large Language Models) via their APIs.**
**Data is sent to model vendors if you connect to LLMs via their APIs.**
For example, if you specify model_name="gpt-3.5-turbo-0613", your data will be sent to OpenAI via their API.

Users are also recommended to review the third party API key section of the [disclaimer](../explanation/disclaimer.md) documentation.
Expand All @@ -17,7 +17,7 @@ Currently, Vizro-AI supports the following parameters:
default. We recommend setting it to 0 for Vizro-AI usage, as it's mostly
deterministic.
- `model_name`: The name of the model to use. Please refer to the section
[Models currently supported by Vizro-AI](#models-currently-supported-by-vizro-ai) for available
[Models currently supported by Vizro-AI](#supported-models) for available
model options.

!!! example "Config and construct Vizro-AI"
Expand Down
5 changes: 3 additions & 2 deletions vizro-ai/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ nav:
# - Contributing: pages/contribute/contributing.md
- Authors: pages/contribute/authors.md

repo_url: https://github.com/mckinsey/vizro/tree/main/vizro-ai
repo_name: mckinsey/vizro-ai #TODO: this infers the version number of the latest release...
#TODO: this infers the version number of the latest release of whole repo
#repo_url: https://github.com/mckinsey/vizro/tree/main/vizro-ai
#repo_name: mckinsey/vizro-ai

theme:
name: material
Expand Down
2 changes: 1 addition & 1 deletion vizro-ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies = [
"openai>=0.27.8",
"langchain==0.0.317",
"python-dotenv>=1.0.0", # TODO decide env var management to see if we need this
"vizro==0.1.4",
"vizro>=0.1.4", # TODO set upper bound later
"ipython>=8.10.0", # not directly required, pinned by Snyk to avoid a vulnerability: https://app.snyk.io/vuln/SNYK-PYTHON-IPYTHON-3318382
"urllib3>=2.0.7" # not directly required, pinned by Snyk to avoid a vulnerability: https://security.snyk.io/vuln/SNYK-PYTHON-URLLIB3-6002459
]
Expand Down
2 changes: 1 addition & 1 deletion vizro-ai/snyk/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ tabulate
openai>=0.27.8
langchain==0.0.317
python-dotenv>=1.0.0
vizro==0.1.4
vizro>=0.1.4
ipython>=8.10.0
urllib3>=2.0.7
16 changes: 8 additions & 8 deletions vizro-ai/src/vizro_ai/utils/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# '__loader__',
# '__spec__',
# '__build_class__',
# # '__import__',
# '__import__',
"abs",
# 'all',
"any",
Expand All @@ -27,12 +27,12 @@
# 'breakpoint',
# 'callable',
# 'chr',
# # 'compile',
# # 'delattr',
# 'compile',
# 'delattr',
# 'dir',
# 'divmod',
# # 'eval',
# # 'exec',
# 'eval',
# 'exec',
# 'format',
# 'getattr',
# 'globals',
Expand Down Expand Up @@ -162,13 +162,13 @@
# 'ExceptionGroup',
# 'EnvironmentError',
# 'IOError',
# # 'open',
# 'open',
# 'copyright',
# 'credits',
# 'license',
# 'help',
# # 'execfile',
# # 'runfile',
# 'execfile',
# 'runfile',
# '__IPYTHON__',
# 'display',
# "get_ipython",
Expand Down
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))
-->

0 comments on commit 5d65af9

Please sign in to comment.