From c7df0c56fabdfe37be22a1ac090d9e7816e92245 Mon Sep 17 00:00:00 2001 From: Lingyi Zhang Date: Thu, 7 Nov 2024 06:30:53 -0500 Subject: [PATCH] [Tidy] Update model names and add PyCafe link (#853) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- vizro-ai/README.md | 1 + ...yi_zhang_update_docs_to_reflect_changes.md | 48 +++++++++++++++++++ .../pages/explanation/safety-in-vizro-ai.md | 2 +- .../docs/pages/user-guides/chart-examples.md | 2 +- .../pages/user-guides/customize-vizro-ai.md | 4 +- vizro-ai/examples/chart_by_vizro_ai.ipynb | 2 +- vizro-ai/examples/dashboard_by_vizro_ai.ipynb | 2 +- vizro-ai/examples/example.ipynb | 4 +- vizro-ai/src/vizro_ai/_llm_models.py | 2 +- vizro-ai/tests/integration/test_dashboard.py | 4 +- 10 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 vizro-ai/changelog.d/20241105_141708_lingyi_zhang_update_docs_to_reflect_changes.md diff --git a/vizro-ai/README.md b/vizro-ai/README.md index c6f5d2ab4..888b79af8 100644 --- a/vizro-ai/README.md +++ b/vizro-ai/README.md @@ -23,6 +23,7 @@ It serves as an extension to Vizro, leveraging natural language capabilities to | Platform | Chart creation | Dashboard creation | | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| PyCafe | https://py.cafe/app/vizro-official/vizro-ai-charts | | | Google Colab | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mckinsey/vizro/blob/main/vizro-ai/examples/chart_by_vizro_ai.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mckinsey/vizro/blob/main/vizro-ai/examples/dashboard_by_vizro_ai.ipynb) | ## Why Vizro-AI? diff --git a/vizro-ai/changelog.d/20241105_141708_lingyi_zhang_update_docs_to_reflect_changes.md b/vizro-ai/changelog.d/20241105_141708_lingyi_zhang_update_docs_to_reflect_changes.md new file mode 100644 index 000000000..f1f65e73c --- /dev/null +++ b/vizro-ai/changelog.d/20241105_141708_lingyi_zhang_update_docs_to_reflect_changes.md @@ -0,0 +1,48 @@ + + + + + + + + + diff --git a/vizro-ai/docs/pages/explanation/safety-in-vizro-ai.md b/vizro-ai/docs/pages/explanation/safety-in-vizro-ai.md index bcdd08131..669f01d30 100644 --- a/vizro-ai/docs/pages/explanation/safety-in-vizro-ai.md +++ b/vizro-ai/docs/pages/explanation/safety-in-vizro-ai.md @@ -26,7 +26,7 @@ It is necessary to approach the generated content with caution, especially when ### 3. Data privacy Your data is sent to model vendors if you connect to LLMs via their APIs. -For example, if you connect to the model "gpt-3.5-turbo-0613" from Open AI, your data will be sent to OpenAI via their API. +For example, if you connect to the model from OpenAI, your data will be sent to OpenAI via their API. Users should be cautious about sharing or inputting any personal or sensitive information. diff --git a/vizro-ai/docs/pages/user-guides/chart-examples.md b/vizro-ai/docs/pages/user-guides/chart-examples.md index ebcec002e..4721980c4 100644 --- a/vizro-ai/docs/pages/user-guides/chart-examples.md +++ b/vizro-ai/docs/pages/user-guides/chart-examples.md @@ -1,6 +1,6 @@ # Gallery of examples -Take a look at some more advanced charts that can be created with Vizro-AI using data from [Plotly Express](https://plotly.com/python-api-reference/generated/plotly.express.data.html). The examples below use the OpenAI `"gpt-4o"` model as we are going to request specific updates to the layout of the charts, which are [more complex than the GPT 3.5 model can handle](./customize-vizro-ai.md). +Take a look at some more advanced charts that can be created with Vizro-AI using data from [Plotly Express](https://plotly.com/python-api-reference/generated/plotly.express.data.html). The examples below use the OpenAI `"gpt-4o"` model as we are going to request specific updates to the layout of the charts. ### Polar bar chart diff --git a/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md b/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md index 2171e06b5..e2c7da2da 100644 --- a/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md +++ b/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md @@ -112,9 +112,9 @@ Passing an instantiated model to `VizroAI` lets you customize it, and additional ### Chart generation -At the time of writing, we found that for chart creation, the leading vendor's "cheaper" models, for example OpenAI's `gpt-4o-mini` and `gpt-3.5` model series, are suitable for basic charting despite their relatively low price points. +At the time of writing, we found that for chart creation, the leading vendor's "cheaper" models, for example OpenAI's `gpt-4o-mini`, are suitable for basic charting despite their relatively low price points. -Consider upgrading to, in the case of OpenAI the `gpt-4o` and `gpt-4` model series, or in the case of Anthropic the `claude-3-5-sonnet-20240620` model series, for more demanding tasks. The downside of using these models is that they come at a higher cost. +Consider upgrading to, in the case of OpenAI the `gpt-4o` and `gpt-4` model series, or in the case of Anthropic the `Claude 3.5` model series, for more demanding tasks. The downside of using these models is that they come at a higher cost. ### Dashboard generation diff --git a/vizro-ai/examples/chart_by_vizro_ai.ipynb b/vizro-ai/examples/chart_by_vizro_ai.ipynb index eb6fb67e8..88e6c99aa 100644 --- a/vizro-ai/examples/chart_by_vizro_ai.ipynb +++ b/vizro-ai/examples/chart_by_vizro_ai.ipynb @@ -298,7 +298,7 @@ "\n", "# @markdown #### 1. Choose the LLM model\n", "\n", - "LLM = \"gpt-4o\" # @param [\"gpt-4o\", \"gpt-3.5-turbo\", \"gpt-4-turbo\", \"gpt-4o-mini\"]\n", + "LLM = \"gpt-4o\" # @param [\"gpt-4o\", \"gpt-4-turbo\", \"gpt-4o-mini\"]\n", "\n", "print(f\"Selected LLM: {LLM}\")\n", "\n", diff --git a/vizro-ai/examples/dashboard_by_vizro_ai.ipynb b/vizro-ai/examples/dashboard_by_vizro_ai.ipynb index 8f93a5a16..fd5dda4d1 100644 --- a/vizro-ai/examples/dashboard_by_vizro_ai.ipynb +++ b/vizro-ai/examples/dashboard_by_vizro_ai.ipynb @@ -296,7 +296,7 @@ "\n", "# @markdown #### 1. Choose the LLM model\n", "\n", - "LLM = \"gpt-4o\" # @param [\"gpt-4o\", \"gpt-3.5-turbo\", \"gpt-4-turbo\", \"gpt-4o-mini\"]\n", + "LLM = \"gpt-4o\" # @param [\"gpt-4o\", \"gpt-4-turbo\", \"gpt-4o-mini\"]\n", "\n", "\n", "# @markdown ---\n", diff --git a/vizro-ai/examples/example.ipynb b/vizro-ai/examples/example.ipynb index 83dd91fd6..9fc56071c 100644 --- a/vizro-ai/examples/example.ipynb +++ b/vizro-ai/examples/example.ipynb @@ -11,7 +11,7 @@ "llm = None\n", "# uncomment below to try out different models\n", "# llm = \"gpt-4o\"\n", - "# llm = \"claude-3-5-sonnet-20240620\"\n", + "# llm = \"claude-3-5-sonnet-latest\"\n", "# llm = \"mistral-large-latest\"\n", "\n", "# from langchain_openai import ChatOpenAI\n", @@ -22,7 +22,7 @@ "# import os\n", "# from langchain_anthropic import ChatAnthropic\n", "# llm = ChatAnthropic(\n", - "# model=\"claude-3-5-sonnet-20240620\",\n", + "# model=\"claude-3-5-sonnet-latest\",\n", "# # api_key = os.environ.get(\"ANTHROPIC_API_KEY\"),\n", "# # base_url= os.environ.get(\"ANTHROPIC_API_BASE\")\n", "# )\n", diff --git a/vizro-ai/src/vizro_ai/_llm_models.py b/vizro-ai/src/vizro_ai/_llm_models.py index 3df967b50..c3c9858b0 100644 --- a/vizro-ai/src/vizro_ai/_llm_models.py +++ b/vizro-ai/src/vizro_ai/_llm_models.py @@ -86,6 +86,6 @@ def _get_model_name(model: BaseChatModel) -> str: if __name__ == "__main__": - llm_chat_openai = _get_llm_model(model="gpt-3.5-turbo") + llm_chat_openai = _get_llm_model(model="gpt-4o-mini") print(repr(llm_chat_openai)) # noqa: T201 print(llm_chat_openai.model_name) # noqa: T201 diff --git a/vizro-ai/tests/integration/test_dashboard.py b/vizro-ai/tests/integration/test_dashboard.py index b44a66336..9958d89f0 100644 --- a/vizro-ai/tests/integration/test_dashboard.py +++ b/vizro-ai/tests/integration/test_dashboard.py @@ -27,8 +27,8 @@ def setup_test_environment(): @pytest.mark.parametrize( "model_name", - ["gpt-3.5-turbo"], - ids=["gpt-3.5"], + ["gpt-4o-mini"], + ids=["gpt-4o-mini"], ) @pytest.mark.filterwarnings("ignore::langchain_core._api.beta_decorator.LangChainBetaWarning") @pytest.mark.filterwarnings("ignore::UserWarning")