Demo: Azure Table Storage as a ChatStore¶
This guide shows you how to use our AzureChatStore
abstraction which automatically persists chat histories to Azure Table Storage or CosmosDB.
If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.
%pip install llama-index
%pip install llama-index-llms-azure-openai
%pip install llama-index-storage-chat-store-azure
Requirement already satisfied: llama-index-storage-chat-store-azure in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (0.1.3) Requirement already satisfied: azure-data-tables<13.0.0,>=12.5.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-storage-chat-store-azure) (12.5.0) Requirement already satisfied: llama-index-core<0.11.0,>=0.10.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-storage-chat-store-azure) (0.10.36) Requirement already satisfied: azure-core<2.0.0,>=1.29.4 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-data-tables<13.0.0,>=12.5.0->llama-index-storage-chat-store-azure) (1.30.1) Requirement already satisfied: yarl<2.0,>=1.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-data-tables<13.0.0,>=12.5.0->llama-index-storage-chat-store-azure) (1.9.4) Requirement already satisfied: isodate<1.0.0,>=0.6.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-data-tables<13.0.0,>=12.5.0->llama-index-storage-chat-store-azure) (0.6.1) Requirement already satisfied: typing-extensions>=4.3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-data-tables<13.0.0,>=12.5.0->llama-index-storage-chat-store-azure) (4.11.0) Requirement already satisfied: PyYAML>=6.0.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (6.0.1) Requirement already satisfied: SQLAlchemy>=1.4.49 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2.0.30) Requirement already satisfied: aiohttp<4.0.0,>=3.8.6 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (3.9.5) Requirement already satisfied: dataclasses-json in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (0.6.6) Requirement already satisfied: deprecated>=1.2.9.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.2.14) Requirement already satisfied: dirtyjson<2.0.0,>=1.0.8 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.0.8) Requirement already satisfied: fsspec>=2023.5.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2024.3.1) Requirement already satisfied: httpx in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (0.27.0) Requirement already satisfied: llamaindex-py-client<0.2.0,>=0.1.18 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (0.1.19) Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.6.0) Requirement already satisfied: networkx>=3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (3.1) Requirement already satisfied: nltk<4.0.0,>=3.8.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (3.8.1) Requirement already satisfied: numpy in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.24.4) Requirement already satisfied: openai>=1.1.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.28.0) Requirement already satisfied: pandas in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2.0.3) Requirement already satisfied: pillow>=9.0.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (10.3.0) Requirement already satisfied: requests>=2.31.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2.31.0) Requirement already satisfied: tenacity<9.0.0,>=8.2.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (8.3.0) Requirement already satisfied: tiktoken>=0.3.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (0.6.0) Requirement already satisfied: tqdm<5.0.0,>=4.66.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (4.66.4) Requirement already satisfied: typing-inspect>=0.8.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (0.9.0) Requirement already satisfied: wrapt in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.16.0) Requirement already satisfied: aiosignal>=1.1.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.3.1) Requirement already satisfied: attrs>=17.3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (23.2.0) Requirement already satisfied: frozenlist>=1.1.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.4.1) Requirement already satisfied: multidict<7.0,>=4.5 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (6.0.5) Requirement already satisfied: six>=1.11.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-core<2.0.0,>=1.29.4->azure-data-tables<13.0.0,>=12.5.0->llama-index-storage-chat-store-azure) (1.16.0) Requirement already satisfied: pydantic>=1.10 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llamaindex-py-client<0.2.0,>=0.1.18->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2.7.1) Requirement already satisfied: anyio in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (4.3.0) Requirement already satisfied: certifi in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2024.2.2) Requirement already satisfied: httpcore==1.* in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.0.5) Requirement already satisfied: idna in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (3.7) Requirement already satisfied: sniffio in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.3.1) Requirement already satisfied: h11<0.15,>=0.13 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpcore==1.*->httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (0.14.0) Requirement already satisfied: click in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (8.1.7) Requirement already satisfied: joblib in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.4.2) Requirement already satisfied: regex>=2021.8.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2024.5.10) Requirement already satisfied: distro<2,>=1.7.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.9.0) Requirement already satisfied: charset-normalizer<4,>=2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from requests>=2.31.0->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (3.3.2) Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from requests>=2.31.0->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2.2.1) Requirement already satisfied: greenlet!=0.4.17 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (3.0.3) Requirement already satisfied: mypy-extensions>=0.3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from typing-inspect>=0.8.0->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (1.0.0) Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from dataclasses-json->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (3.21.2) Requirement already satisfied: python-dateutil>=2.8.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pandas->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2.9.0.post0) Requirement already satisfied: pytz>=2020.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pandas->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2024.1) Requirement already satisfied: tzdata>=2022.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pandas->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2024.1) Requirement already satisfied: packaging>=17.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from marshmallow<4.0.0,>=3.18.0->dataclasses-json->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (24.0) Requirement already satisfied: annotated-types>=0.4.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pydantic>=1.10->llamaindex-py-client<0.2.0,>=0.1.18->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (0.6.0) Requirement already satisfied: pydantic-core==2.18.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pydantic>=1.10->llamaindex-py-client<0.2.0,>=0.1.18->llama-index-core<0.11.0,>=0.10.1->llama-index-storage-chat-store-azure) (2.18.2) Note: you may need to restart the kernel to use updated packages. Requirement already satisfied: llama-index-llms-azure-openai in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (0.1.5) Requirement already satisfied: azure-identity<2.0.0,>=1.15.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-llms-azure-openai) (1.15.0) Requirement already satisfied: httpx in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-llms-azure-openai) (0.27.0) Requirement already satisfied: llama-index-core<0.11.0,>=0.10.11.post1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-llms-azure-openai) (0.10.36) Requirement already satisfied: llama-index-llms-openai<0.2.0,>=0.1.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-llms-azure-openai) (0.1.14) Requirement already satisfied: azure-core<2.0.0,>=1.23.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (1.30.1) Requirement already satisfied: cryptography>=2.5 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (42.0.7) Requirement already satisfied: msal<2.0.0,>=1.24.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (1.28.0) Requirement already satisfied: msal-extensions<2.0.0,>=0.3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (1.1.0) Requirement already satisfied: PyYAML>=6.0.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (6.0.1) Requirement already satisfied: SQLAlchemy>=1.4.49 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2.0.30) Requirement already satisfied: aiohttp<4.0.0,>=3.8.6 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (3.9.5) Requirement already satisfied: dataclasses-json in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (0.6.6) Requirement already satisfied: deprecated>=1.2.9.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.2.14) Requirement already satisfied: dirtyjson<2.0.0,>=1.0.8 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.0.8) Requirement already satisfied: fsspec>=2023.5.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2024.3.1) Requirement already satisfied: llamaindex-py-client<0.2.0,>=0.1.18 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (0.1.19) Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.6.0) Requirement already satisfied: networkx>=3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (3.1) Requirement already satisfied: nltk<4.0.0,>=3.8.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (3.8.1) Requirement already satisfied: numpy in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.24.4) Requirement already satisfied: openai>=1.1.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.28.0) Requirement already satisfied: pandas in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2.0.3) Requirement already satisfied: pillow>=9.0.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (10.3.0) Requirement already satisfied: requests>=2.31.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2.31.0) Requirement already satisfied: tenacity<9.0.0,>=8.2.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (8.3.0) Requirement already satisfied: tiktoken>=0.3.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (0.6.0) Requirement already satisfied: tqdm<5.0.0,>=4.66.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (4.66.4) Requirement already satisfied: typing-extensions>=4.5.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (4.11.0) Requirement already satisfied: typing-inspect>=0.8.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (0.9.0) Requirement already satisfied: wrapt in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.16.0) Requirement already satisfied: anyio in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-llms-azure-openai) (4.3.0) Requirement already satisfied: certifi in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-llms-azure-openai) (2024.2.2) Requirement already satisfied: httpcore==1.* in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-llms-azure-openai) (1.0.5) Requirement already satisfied: idna in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-llms-azure-openai) (3.7) Requirement already satisfied: sniffio in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-llms-azure-openai) (1.3.1) Requirement already satisfied: h11<0.15,>=0.13 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpcore==1.*->httpx->llama-index-llms-azure-openai) (0.14.0) Requirement already satisfied: aiosignal>=1.1.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.3.1) Requirement already satisfied: attrs>=17.3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (23.2.0) Requirement already satisfied: frozenlist>=1.1.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.4.1) Requirement already satisfied: multidict<7.0,>=4.5 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (6.0.5) Requirement already satisfied: yarl<2.0,>=1.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.9.4) Requirement already satisfied: six>=1.11.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from azure-core<2.0.0,>=1.23.0->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (1.16.0) Requirement already satisfied: cffi>=1.12 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from cryptography>=2.5->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (1.16.0) Requirement already satisfied: pydantic>=1.10 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llamaindex-py-client<0.2.0,>=0.1.18->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2.7.1) Requirement already satisfied: PyJWT<3,>=1.0.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from PyJWT[crypto]<3,>=1.0.0->msal<2.0.0,>=1.24.0->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (2.8.0) Requirement already satisfied: packaging in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from msal-extensions<2.0.0,>=0.3.0->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (24.0) Requirement already satisfied: portalocker<3,>=1.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from msal-extensions<2.0.0,>=0.3.0->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (2.8.2) Requirement already satisfied: click in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (8.1.7) Requirement already satisfied: joblib in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.4.2) Requirement already satisfied: regex>=2021.8.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2024.5.10) Requirement already satisfied: distro<2,>=1.7.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.9.0) Requirement already satisfied: charset-normalizer<4,>=2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from requests>=2.31.0->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (3.3.2) Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from requests>=2.31.0->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2.2.1) Requirement already satisfied: greenlet!=0.4.17 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (3.0.3) Requirement already satisfied: mypy-extensions>=0.3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from typing-inspect>=0.8.0->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (1.0.0) Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from dataclasses-json->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (3.21.2) Requirement already satisfied: python-dateutil>=2.8.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pandas->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2.9.0.post0) Requirement already satisfied: pytz>=2020.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pandas->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2024.1) Requirement already satisfied: tzdata>=2022.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pandas->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2024.1) Requirement already satisfied: pycparser in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from cffi>=1.12->cryptography>=2.5->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai) (2.22) Requirement already satisfied: annotated-types>=0.4.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pydantic>=1.10->llamaindex-py-client<0.2.0,>=0.1.18->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (0.6.0) Requirement already satisfied: pydantic-core==2.18.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pydantic>=1.10->llamaindex-py-client<0.2.0,>=0.1.18->llama-index-core<0.11.0,>=0.10.11.post1->llama-index-llms-azure-openai) (2.18.2) Note: you may need to restart the kernel to use updated packages. Requirement already satisfied: llama-index in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (0.10.27) Requirement already satisfied: llama-index-agent-openai<0.3.0,>=0.1.4 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.2.2) Requirement already satisfied: llama-index-cli<0.2.0,>=0.1.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.1.11) Requirement already satisfied: llama-index-core<0.11.0,>=0.10.27 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.10.36) Requirement already satisfied: llama-index-embeddings-openai<0.2.0,>=0.1.5 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.1.7) Requirement already satisfied: llama-index-indices-managed-llama-cloud<0.2.0,>=0.1.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.1.5) Requirement already satisfied: llama-index-legacy<0.10.0,>=0.9.48 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.9.48) Requirement already satisfied: llama-index-llms-openai<0.2.0,>=0.1.13 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.1.14) Requirement already satisfied: llama-index-multi-modal-llms-openai<0.2.0,>=0.1.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.1.4) Requirement already satisfied: llama-index-program-openai<0.2.0,>=0.1.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.1.5) Requirement already satisfied: llama-index-question-gen-openai<0.2.0,>=0.1.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.1.3) Requirement already satisfied: llama-index-readers-file<0.2.0,>=0.1.4 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.1.13) Requirement already satisfied: llama-index-readers-llama-parse<0.2.0,>=0.1.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index) (0.1.4) Requirement already satisfied: openai>=1.14.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-agent-openai<0.3.0,>=0.1.4->llama-index) (1.28.0) Requirement already satisfied: PyYAML>=6.0.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (6.0.1) Requirement already satisfied: SQLAlchemy>=1.4.49 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.27->llama-index) (2.0.30) Requirement already satisfied: aiohttp<4.0.0,>=3.8.6 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (3.9.5) Requirement already satisfied: dataclasses-json in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (0.6.6) Requirement already satisfied: deprecated>=1.2.9.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (1.2.14) Requirement already satisfied: dirtyjson<2.0.0,>=1.0.8 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (1.0.8) Requirement already satisfied: fsspec>=2023.5.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (2024.3.1) Requirement already satisfied: httpx in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (0.27.0) Requirement already satisfied: llamaindex-py-client<0.2.0,>=0.1.18 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (0.1.19) Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (1.6.0) Requirement already satisfied: networkx>=3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (3.1) Requirement already satisfied: nltk<4.0.0,>=3.8.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (3.8.1) Requirement already satisfied: numpy in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (1.24.4) Requirement already satisfied: pandas in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (2.0.3) Requirement already satisfied: pillow>=9.0.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (10.3.0) Requirement already satisfied: requests>=2.31.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (2.31.0) Requirement already satisfied: tenacity<9.0.0,>=8.2.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (8.3.0) Requirement already satisfied: tiktoken>=0.3.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (0.6.0) Requirement already satisfied: tqdm<5.0.0,>=4.66.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (4.66.4) Requirement already satisfied: typing-extensions>=4.5.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (4.11.0) Requirement already satisfied: typing-inspect>=0.8.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (0.9.0) Requirement already satisfied: wrapt in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-core<0.11.0,>=0.10.27->llama-index) (1.16.0) Requirement already satisfied: beautifulsoup4<5.0.0,>=4.12.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (4.12.3) Requirement already satisfied: pymupdf<2.0.0,>=1.23.21 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (1.24.1) Requirement already satisfied: pypdf<5.0.0,>=4.0.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (4.1.0) Requirement already satisfied: striprtf<0.0.27,>=0.0.26 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (0.0.26) Requirement already satisfied: llama-parse<0.5.0,>=0.4.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llama-index-readers-llama-parse<0.2.0,>=0.1.2->llama-index) (0.4.0) Requirement already satisfied: aiosignal>=1.1.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.27->llama-index) (1.3.1) Requirement already satisfied: attrs>=17.3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.27->llama-index) (23.2.0) Requirement already satisfied: frozenlist>=1.1.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.27->llama-index) (1.4.1) Requirement already satisfied: multidict<7.0,>=4.5 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.27->llama-index) (6.0.5) Requirement already satisfied: yarl<2.0,>=1.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.27->llama-index) (1.9.4) Requirement already satisfied: soupsieve>1.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from beautifulsoup4<5.0.0,>=4.12.3->llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (2.5) Requirement already satisfied: pydantic>=1.10 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from llamaindex-py-client<0.2.0,>=0.1.18->llama-index-core<0.11.0,>=0.10.27->llama-index) (2.7.1) Requirement already satisfied: anyio in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.27->llama-index) (4.3.0) Requirement already satisfied: certifi in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.27->llama-index) (2024.2.2) Requirement already satisfied: httpcore==1.* in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.27->llama-index) (1.0.5) Requirement already satisfied: idna in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.27->llama-index) (3.7) Requirement already satisfied: sniffio in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpx->llama-index-core<0.11.0,>=0.10.27->llama-index) (1.3.1) Requirement already satisfied: h11<0.15,>=0.13 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from httpcore==1.*->httpx->llama-index-core<0.11.0,>=0.10.27->llama-index) (0.14.0) Requirement already satisfied: click in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.27->llama-index) (8.1.7) Requirement already satisfied: joblib in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.27->llama-index) (1.4.2) Requirement already satisfied: regex>=2021.8.3 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.27->llama-index) (2024.5.10) Requirement already satisfied: distro<2,>=1.7.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from openai>=1.14.0->llama-index-agent-openai<0.3.0,>=0.1.4->llama-index) (1.9.0) Requirement already satisfied: PyMuPDFb==1.24.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pymupdf<2.0.0,>=1.23.21->llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (1.24.1) Requirement already satisfied: charset-normalizer<4,>=2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from requests>=2.31.0->llama-index-core<0.11.0,>=0.10.27->llama-index) (3.3.2) Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from requests>=2.31.0->llama-index-core<0.11.0,>=0.10.27->llama-index) (2.2.1) Requirement already satisfied: greenlet!=0.4.17 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.27->llama-index) (3.0.3) Requirement already satisfied: mypy-extensions>=0.3.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from typing-inspect>=0.8.0->llama-index-core<0.11.0,>=0.10.27->llama-index) (1.0.0) Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from dataclasses-json->llama-index-core<0.11.0,>=0.10.27->llama-index) (3.21.2) Requirement already satisfied: python-dateutil>=2.8.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pandas->llama-index-core<0.11.0,>=0.10.27->llama-index) (2.9.0.post0) Requirement already satisfied: pytz>=2020.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pandas->llama-index-core<0.11.0,>=0.10.27->llama-index) (2024.1) Requirement already satisfied: tzdata>=2022.1 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pandas->llama-index-core<0.11.0,>=0.10.27->llama-index) (2024.1) Requirement already satisfied: packaging>=17.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from marshmallow<4.0.0,>=3.18.0->dataclasses-json->llama-index-core<0.11.0,>=0.10.27->llama-index) (24.0) Requirement already satisfied: annotated-types>=0.4.0 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pydantic>=1.10->llamaindex-py-client<0.2.0,>=0.1.18->llama-index-core<0.11.0,>=0.10.27->llama-index) (0.6.0) Requirement already satisfied: pydantic-core==2.18.2 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from pydantic>=1.10->llamaindex-py-client<0.2.0,>=0.1.18->llama-index-core<0.11.0,>=0.10.27->llama-index) (2.18.2) Requirement already satisfied: six>=1.5 in /Users/falven/.pyenv/versions/3.11.8/envs/llama_index/lib/python3.11/site-packages (from python-dateutil>=2.8.2->pandas->llama-index-core<0.11.0,>=0.10.27->llama-index) (1.16.0) Note: you may need to restart the kernel to use updated packages.
import nest_asyncio
nest_asyncio.apply()
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(
logging.WARNING
)
from llama_index.llms.azure_openai import AzureOpenAI
from llama_index.core.response.notebook_utils import display_response
from llama_index.core import Settings
Define our models¶
In staying with the Azure theme, let's define our Azure OpenAI embedding and LLM models.
Settings.llm = AzureOpenAI(
model="gpt-4",
deployment_name="gpt-4",
api_key="",
azure_endpoint="",
api_version="2024-03-01-preview",
)
We now define an AzureChatStore
, memory and SimpleChatEngine
to converse and store history in Azure Table Storage.
from llama_index.core.chat_engine import SimpleChatEngine
from llama_index.core.memory import ChatMemoryBuffer
from llama_index.storage.chat_store.azure import AzureChatStore
chat_store = AzureChatStore.from_account_and_key(
account_name="",
account_key="",
chat_table_name="FranChat",
metadata_table_name="FranChatMeta",
metadata_partition_key="conversation1",
)
memory = ChatMemoryBuffer.from_defaults(
token_limit=3000,
chat_store=chat_store,
chat_store_key="conversation1",
)
chat_engine = SimpleChatEngine(
memory=memory, llm=Settings.llm, prefix_messages=[]
)
Test out a ChatEngine with memory backed by Azure Table Storage¶
response = chat_engine.chat("Hello, my name is Fran.")
display_response(response)
Final Response:
Hello Fran! How can I assist you today?
response = chat_engine.chat("What's my name again?")
display_response(response)
Final Response:
Your name is Fran. How can I help you further?
Start a new conversation¶
chat_store.metadata_partition_key = "conversation2"
memory = ChatMemoryBuffer.from_defaults(
token_limit=3000,
chat_store=chat_store,
chat_store_key="conversation2",
)
chat_engine = SimpleChatEngine(
memory=memory, llm=Settings.llm, prefix_messages=[]
)
response = chat_engine.chat("What's in a name?")
display_response(response)
Final Response:
"What's in a name?" is a famous quote from William Shakespeare's play "Romeo and Juliet." It is spoken by Juliet in Act 2, Scene 2, during the balcony scene. The full quote is:
"What's in a name? That which we call a rose By any other name would smell as sweet."
In this context, Juliet is musing on the nature of names and identity, specifically referring to Romeo's last name, Montague. The Montagues and the Capulets, Juliet's family, are sworn enemies. Juliet is lamenting the fact that Romeo's name is the only thing that is keeping them apart, implying that the essence or nature of a person is not tied to their name. Essentially, she's arguing that if Romeo had any other name, he would still be the person she loves. The quote speaks to the idea that names themselves do not hold value or meaning beyond the significance that society or individuals ascribe to them.