Skip to content

Commit

Permalink
Add hosting option to docs (#145)
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Schulz <[email protected]>
Co-authored-by: Chiara <[email protected]>
  • Loading branch information
maxschulz-COL and chiara-sophie authored Nov 2, 2023
1 parent 5eabefa commit 01e240b
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 8 deletions.
16 changes: 16 additions & 0 deletions vizro-ai/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Read the Docs configuration file for MkDocs projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
commands:
- pip install hatch
- cd vizro-ai/ && hatch run docs:mkdocs build
- mkdir --parents $READTHEDOCS_OUTPUT
- mv vizro-ai/site/ $READTHEDOCS_OUTPUT/html
8 changes: 6 additions & 2 deletions vizro-ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ Vizro-AI is a tool for generating visualizations.

## Disclaimer

Please review the [Disclaimer](docs/pages/explanation/disclaimer.md) before using `vizro-ai` package.
Please review the [Disclaimer](https://vizro-ai.readthedocs.io/en/latest/pages/explanation/disclaimer/) before using `vizro-ai` package.

## Documentation

Here is the link to the [Documentation](docs/pages).
For more information, please refer to our [Documentation](https://vizro-ai.readthedocs.io/en/latest/).

## Acknowledgment

Vizro-AI is powered by [LangChain](https://github.com/langchain-ai/langchain).
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))
-->
4 changes: 2 additions & 2 deletions vizro-ai/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Vizro-AI is a tool for generating data visualizations.
before using the `vizro-ai` package.

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).
please also ensure that you review our guides on the [usage of LLMs](pages/explanation/safety_in_vizro_ai.md)
and the required [safeguarding for dynamic code evaluation](pages/explanation/safeguard.md).


<div class="card-section-wrapper" style="display: block;">
Expand Down
10 changes: 10 additions & 0 deletions vizro-ai/docs/pages/explanation/safety_in_vizro_ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ These models can be exploited for various malicious activities. Users should be

It's crucial for users to remain informed, cautious, and ethical in their applications.

## Dependencies, Code Scanners and Infosec

It may occur that dependencies of `vizro-ai` get flagged by code scanners and other infosec tools. As a consequence it may happen that
`vizro-ai` also get flagged.

While we aim to resolve any flagged issues as soon as possible, there may not always be an immediate available fix, especially in a very dynamic environment such as generative AI. We encourage users to investigate if any flagged infosec issues are actually related
to any functionality used in our code base or if they only concern functionality outside the scope of `vizro-ai`.

In case those issues are related to code execution, note that `vizro-ai` has its own process of executing dynamic code (see [Safeguard Execution of Dynamic Code](safeguard.md)), and does not rely on its dependencies to do so.

## Execution of Dynamic Code in Vizro-AI

The `exec()` statement is used in `vizro-ai`. It allows for dynamic execution of Python programs which can be powerful, but can also pose security risk
Expand Down
4 changes: 4 additions & 0 deletions vizro-ai/docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@
td:not([class]):not(:last-child) {
border-right: 1px solid lightgrey;
}

.md-source__fact--version {
display: none;
}
6 changes: 3 additions & 3 deletions vizro-ai/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ nav:
# - Contributing: pages/contribute/contributing.md
- Authors: pages/contribute/authors.md

#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
# This infers the version number of the latest release of whole repo, so we're hiding it for sub-packed in extra.css
repo_url: https://github.com/mckinsey/vizro/tree/main/vizro-ai
repo_name: mckinsey/vizro-ai

theme:
name: material
Expand Down
3 changes: 2 additions & 1 deletion vizro-ai/src/vizro_ai/_vizro_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def __init__(self, model_name: str = "gpt-3.5-turbo-0613", temperature: int = 0)
f"You have selected {self.model_name},"
f"Engaging with LLMs (Large Language Models) carries certain risks. "
f"Users are advised to become familiar with these risks to make informed decisions, "
f"and visit this page for detailed information:docs/pages/disclaimer.md(change to URL after docs is hosted)"
f"and visit this page for detailed information: "
"https://vizro-ai.readthedocs.io/en/latest/pages/explanation/disclaimer/"
)

@property
Expand Down

0 comments on commit 01e240b

Please sign in to comment.