From f2834e205926e9bae158bcd85b352c47498bd668 Mon Sep 17 00:00:00 2001 From: Lingyi Zhang Date: Tue, 5 Nov 2024 14:14:29 -0500 Subject: [PATCH 1/3] Update model names and add pycafe --- vizro-ai/README.md | 1 + vizro-ai/docs/pages/user-guides/customize-vizro-ai.md | 2 +- vizro-ai/examples/example.ipynb | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vizro-ai/README.md b/vizro-ai/README.md index c6f5d2ab4..75aa82f83 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/docs/pages/user-guides/customize-vizro-ai.md b/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md index e2a4e883b..6093cfdb7 100644 --- a/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md +++ b/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md @@ -116,7 +116,7 @@ Passing an instantiated model to `VizroAI` lets you customize it, and additional 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. -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/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", From ae1498f03b35a482fc511c11909e0c952178c5e7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:15:51 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- vizro-ai/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vizro-ai/README.md b/vizro-ai/README.md index 75aa82f83..888b79af8 100644 --- a/vizro-ai/README.md +++ b/vizro-ai/README.md @@ -23,7 +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 | | +| 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? From 312933b8eb3d9084815c7d49063d974f310d7ee6 Mon Sep 17 00:00:00 2001 From: Lingyi Zhang Date: Wed, 6 Nov 2024 14:23:27 -0500 Subject: [PATCH 3/3] drop all gpt-3.5 mentions --- ...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 | 2 +- vizro-ai/examples/chart_by_vizro_ai.ipynb | 2 +- vizro-ai/examples/dashboard_by_vizro_ai.ipynb | 2 +- vizro-ai/src/vizro_ai/_llm_models.py | 2 +- vizro-ai/tests/integration/test_dashboard.py | 4 +- 8 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 vizro-ai/changelog.d/20241105_141708_lingyi_zhang_update_docs_to_reflect_changes.md 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 efc021fa2..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,7 +112,7 @@ 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` model series, for more demanding tasks. The downside of using these models is that they come at a higher cost. 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/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")