From cf9bd15006c7d89167cf1623953c0245d6ba6e35 Mon Sep 17 00:00:00 2001 From: Diana Rama Date: Sat, 6 Jun 2026 12:02:58 +0200 Subject: [PATCH 1/3] Add files via upload --- lab-agent-vector-store.ipynb | 645 ++++++++++++++++++++++++++++++----- 1 file changed, 558 insertions(+), 87 deletions(-) diff --git a/lab-agent-vector-store.ipynb b/lab-agent-vector-store.ipynb index c0f762e..f8d985c 100644 --- a/lab-agent-vector-store.ipynb +++ b/lab-agent-vector-store.ipynb @@ -34,19 +34,396 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "id": "12df91e0-7322-43c2-96cd-0159d017a1e1", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: chromadb in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (1.5.9)\n", + "Requirement already satisfied: langchain in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.2.17)\n", + "Requirement already satisfied: langchain_community in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.2.19)\n", + "Requirement already satisfied: langchain_openai in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.1.25)\n", + "Requirement already satisfied: build>=1.0.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.5.0)\n", + "Requirement already satisfied: pydantic>=2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (2.13.4)\n", + "Requirement already satisfied: pydantic-settings>=2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (2.14.1)\n", + "Requirement already satisfied: pybase64>=1.4.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.4.3)\n", + "Requirement already satisfied: uvicorn>=0.18.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (0.48.0)\n", + "Requirement already satisfied: numpy>=1.22.5 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.26.4)\n", + "Requirement already satisfied: typing-extensions>=4.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (4.15.0)\n", + "Requirement already satisfied: onnxruntime>=1.14.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.26.0)\n", + "Requirement already satisfied: opentelemetry-api>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", + "Requirement already satisfied: opentelemetry-exporter-otlp-proto-grpc>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", + "Requirement already satisfied: opentelemetry-sdk>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", + "Requirement already satisfied: tokenizers>=0.13.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.19.1)\n", + "Requirement already satisfied: pypika>=0.48.9 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.51.1)\n", + "Requirement already satisfied: tqdm>=4.65.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (4.67.3)\n", + "Requirement already satisfied: overrides>=7.3.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (7.7.0)\n", + "Requirement already satisfied: importlib-resources in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (7.1.0)\n", + "Requirement already satisfied: grpcio>=1.58.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.80.0)\n", + "Requirement already satisfied: bcrypt>=4.0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (5.0.0)\n", + "Requirement already satisfied: typer>=0.9.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.25.1)\n", + "Requirement already satisfied: kubernetes>=28.1.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (36.0.0)\n", + "Requirement already satisfied: tenacity>=8.2.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (8.5.0)\n", + "Requirement already satisfied: pyyaml>=6.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (6.0.3)\n", + "Requirement already satisfied: mmh3>=4.0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (5.2.1)\n", + "Requirement already satisfied: orjson>=3.9.12 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (3.11.9)\n", + "Requirement already satisfied: httpx>=0.27.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.28.1)\n", + "Requirement already satisfied: rich>=10.11.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (15.0.0)\n", + "Requirement already satisfied: jsonschema>=4.19.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (4.26.0)\n", + "Requirement already satisfied: SQLAlchemy<3,>=1.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (2.0.50)\n", + "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (3.13.5)\n", + "Requirement already satisfied: langchain-core<0.3.0,>=0.2.43 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (0.2.43)\n", + "Requirement already satisfied: langchain-text-splitters<0.3.0,>=0.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (0.2.4)\n", + "Requirement already satisfied: langsmith<0.2.0,>=0.1.17 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (0.1.147)\n", + "Requirement already satisfied: requests<3,>=2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (2.34.2)\n", + "Requirement already satisfied: aiohappyeyeballs>=2.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (2.6.2)\n", + "Requirement already satisfied: aiosignal>=1.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.4.0)\n", + "Requirement already satisfied: attrs>=17.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (26.1.0)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.8.0)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (6.7.1)\n", + "Requirement already satisfied: propcache>=0.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (0.5.2)\n", + "Requirement already satisfied: yarl<2.0,>=1.17.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.24.2)\n", + "Requirement already satisfied: jsonpatch<2.0,>=1.33 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain) (1.33)\n", + "Requirement already satisfied: packaging<25,>=23.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain) (24.2)\n", + "Requirement already satisfied: jsonpointer>=1.9 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonpatch<2.0,>=1.33->langchain-core<0.3.0,>=0.2.43->langchain) (3.1.1)\n", + "Requirement already satisfied: requests-toolbelt<2.0.0,>=1.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langsmith<0.2.0,>=0.1.17->langchain) (1.0.0)\n", + "Requirement already satisfied: anyio in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx>=0.27.0->chromadb) (4.13.0)\n", + "Requirement already satisfied: certifi in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx>=0.27.0->chromadb) (2026.5.20)\n", + "Requirement already satisfied: httpcore==1.* in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx>=0.27.0->chromadb) (1.0.9)\n", + "Requirement already satisfied: idna in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx>=0.27.0->chromadb) (3.16)\n", + "Requirement already satisfied: h11>=0.16 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpcore==1.*->httpx>=0.27.0->chromadb) (0.16.0)\n", + "Requirement already satisfied: annotated-types>=0.6.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic>=2.0->chromadb) (0.7.0)\n", + "Requirement already satisfied: pydantic-core==2.46.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic>=2.0->chromadb) (2.46.4)\n", + "Requirement already satisfied: typing-inspection>=0.4.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic>=2.0->chromadb) (0.4.2)\n", + "Requirement already satisfied: charset_normalizer<4,>=2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests<3,>=2->langchain) (3.4.7)\n", + "Requirement already satisfied: urllib3<3,>=1.26 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests<3,>=2->langchain) (2.7.0)\n", + "Requirement already satisfied: greenlet>=1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from SQLAlchemy<3,>=1.4->langchain) (3.5.1)\n", + "Requirement already satisfied: dataclasses-json<0.7,>=0.5.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain_community) (0.6.7)\n", + "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain_community) (3.26.2)\n", + "Requirement already satisfied: typing-inspect<1,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain_community) (0.9.0)\n", + "Requirement already satisfied: mypy-extensions>=0.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain_community) (1.1.0)\n", + "Requirement already satisfied: openai<2.0.0,>=1.40.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain_openai) (1.109.1)\n", + "Requirement already satisfied: tiktoken<1,>=0.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain_openai) (0.13.0)\n", + "Requirement already satisfied: distro<2,>=1.7.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain_openai) (1.9.0)\n", + "Requirement already satisfied: jiter<1,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain_openai) (0.15.0)\n", + "Requirement already satisfied: sniffio in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain_openai) (1.3.1)\n", + "Requirement already satisfied: regex in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from tiktoken<1,>=0.7->langchain_openai) (2026.5.9)\n", + "Requirement already satisfied: pyproject_hooks in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from build>=1.0.3->chromadb) (1.2.0)\n", + "Requirement already satisfied: colorama in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from build>=1.0.3->chromadb) (0.4.6)\n", + "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (2025.9.1)\n", + "Requirement already satisfied: referencing>=0.28.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.37.0)\n", + "Requirement already satisfied: rpds-py>=0.25.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.30.0)\n", + "Requirement already satisfied: six>=1.9.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (1.17.0)\n", + "Requirement already satisfied: python-dateutil>=2.5.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (2.9.0.post0)\n", + "Requirement already satisfied: websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (1.9.0)\n", + "Requirement already satisfied: requests-oauthlib in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (2.0.0)\n", + "Requirement already satisfied: durationpy>=0.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (0.10)\n", + "Requirement already satisfied: flatbuffers in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from onnxruntime>=1.14.1->chromadb) (25.12.19)\n", + "Requirement already satisfied: protobuf in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from onnxruntime>=1.14.1->chromadb) (6.33.6)\n", + "Requirement already satisfied: googleapis-common-protos~=1.57 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.75.0)\n", + "Requirement already satisfied: opentelemetry-exporter-otlp-proto-common==1.42.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.42.1)\n", + "Requirement already satisfied: opentelemetry-proto==1.42.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.42.1)\n", + "Requirement already satisfied: opentelemetry-semantic-conventions==0.63b1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-sdk>=1.2.0->chromadb) (0.63b1)\n", + "Requirement already satisfied: python-dotenv>=0.21.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic-settings>=2.0->chromadb) (1.2.2)\n", + "Requirement already satisfied: markdown-it-py>=2.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from rich>=10.11.0->chromadb) (4.2.0)\n", + "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from rich>=10.11.0->chromadb) (2.20.0)\n", + "Requirement already satisfied: mdurl~=0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->chromadb) (0.1.2)\n", + "Requirement already satisfied: huggingface-hub<1.0,>=0.16.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from tokenizers>=0.13.2->chromadb) (0.36.2)\n", + "Requirement already satisfied: filelock in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb) (3.29.0)\n", + "Requirement already satisfied: fsspec>=2023.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb) (2024.3.1)\n", + "Requirement already satisfied: click>=8.2.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (8.4.1)\n", + "Requirement already satisfied: shellingham>=1.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (1.5.4)\n", + "Requirement already satisfied: annotated-doc>=0.0.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (0.0.4)\n", + "Requirement already satisfied: httptools>=0.6.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (0.8.0)\n", + "Requirement already satisfied: watchfiles>=0.20 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (1.2.0)\n", + "Requirement already satisfied: websockets>=10.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (16.0)\n", + "Requirement already satisfied: oauthlib>=3.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests-oauthlib->kubernetes>=28.1.0->chromadb) (3.3.1)\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "\n", + "[notice] A new release of pip is available: 26.1.1 -> 26.1.2\n", + "[notice] To update, run: python.exe -m pip install --upgrade pip\n" + ] + } + ], + "source": [ + "!pip install chromadb langchain langchain_community langchain_openai" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "def6ed68", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: langchain==0.2.17 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.2.17)\n", + "Requirement already satisfied: langchain-community in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.2.19)\n", + "Collecting langchain-community\n", + " Using cached langchain_community-0.4.2-py3-none-any.whl.metadata (3.4 kB)\n", + "Requirement already satisfied: langchain-openai in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.1.25)\n", + "Collecting langchain-openai\n", + " Using cached langchain_openai-1.2.2-py3-none-any.whl.metadata (3.1 kB)\n", + "Requirement already satisfied: chromadb in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (1.5.9)\n", + "Requirement already satisfied: tiktoken in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.13.0)\n", + "Requirement already satisfied: PyYAML>=5.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (6.0.3)\n", + "Requirement already satisfied: SQLAlchemy<3,>=1.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (2.0.50)\n", + "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (3.13.5)\n", + "Requirement already satisfied: langchain-core<0.3.0,>=0.2.43 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (0.2.43)\n", + "Requirement already satisfied: langchain-text-splitters<0.3.0,>=0.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (0.2.4)\n", + "Requirement already satisfied: langsmith<0.2.0,>=0.1.17 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (0.1.147)\n", + "Requirement already satisfied: numpy<2.0.0,>=1.26.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (1.26.4)\n", + "Requirement already satisfied: pydantic<3,>=1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (2.13.4)\n", + "Requirement already satisfied: requests<3,>=2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (2.34.2)\n", + "Requirement already satisfied: tenacity!=8.4.0,<9.0.0,>=8.1.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (8.5.0)\n", + "Requirement already satisfied: aiohappyeyeballs>=2.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (2.6.2)\n", + "Requirement already satisfied: aiosignal>=1.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (1.4.0)\n", + "Requirement already satisfied: attrs>=17.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (26.1.0)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (1.8.0)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (6.7.1)\n", + "Requirement already satisfied: propcache>=0.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (0.5.2)\n", + "Requirement already satisfied: yarl<2.0,>=1.17.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (1.24.2)\n", + "Requirement already satisfied: jsonpatch<2.0,>=1.33 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain==0.2.17) (1.33)\n", + "Requirement already satisfied: packaging<25,>=23.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain==0.2.17) (24.2)\n", + "Requirement already satisfied: typing-extensions>=4.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain==0.2.17) (4.15.0)\n", + "Requirement already satisfied: jsonpointer>=1.9 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonpatch<2.0,>=1.33->langchain-core<0.3.0,>=0.2.43->langchain==0.2.17) (3.1.1)\n", + "Requirement already satisfied: httpx<1,>=0.23.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (0.28.1)\n", + "Requirement already satisfied: orjson<4.0.0,>=3.9.14 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (3.11.9)\n", + "Requirement already satisfied: requests-toolbelt<2.0.0,>=1.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (1.0.0)\n", + "Requirement already satisfied: anyio in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (4.13.0)\n", + "Requirement already satisfied: certifi in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (2026.5.20)\n", + "Requirement already satisfied: httpcore==1.* in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (1.0.9)\n", + "Requirement already satisfied: idna in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (3.16)\n", + "Requirement already satisfied: h11>=0.16 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpcore==1.*->httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (0.16.0)\n", + "Requirement already satisfied: annotated-types>=0.6.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic<3,>=1->langchain==0.2.17) (0.7.0)\n", + "Requirement already satisfied: pydantic-core==2.46.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic<3,>=1->langchain==0.2.17) (2.46.4)\n", + "Requirement already satisfied: typing-inspection>=0.4.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic<3,>=1->langchain==0.2.17) (0.4.2)\n", + "Requirement already satisfied: charset_normalizer<4,>=2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests<3,>=2->langchain==0.2.17) (3.4.7)\n", + "Requirement already satisfied: urllib3<3,>=1.26 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests<3,>=2->langchain==0.2.17) (2.7.0)\n", + "Requirement already satisfied: greenlet>=1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from SQLAlchemy<3,>=1.4->langchain==0.2.17) (3.5.1)\n", + "Requirement already satisfied: httpx-sse<1.0.0,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-community) (0.4.3)\n", + "Requirement already satisfied: langchain-classic<2.0.0,>=1.0.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-community) (1.0.7)\n", + "INFO: pip is looking at multiple versions of langchain-community to determine which version is compatible with other requirements. This could take a while.\n", + "Collecting langchain-community\n", + " Using cached langchain_community-0.4.1-py3-none-any.whl.metadata (3.0 kB)\n", + " Using cached langchain_community-0.4-py3-none-any.whl.metadata (3.0 kB)\n", + " Using cached langchain_community-0.3.31-py3-none-any.whl.metadata (3.0 kB)\n", + " Using cached langchain_community-0.3.30-py3-none-any.whl.metadata (3.0 kB)\n", + " Using cached langchain_community-0.3.29-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.28-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.27-py3-none-any.whl.metadata (2.9 kB)\n", + "INFO: pip is still looking at multiple versions of langchain-community to determine which version is compatible with other requirements. This could take a while.\n", + " Using cached langchain_community-0.3.26-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.25-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.24-py3-none-any.whl.metadata (2.5 kB)\n", + " Using cached langchain_community-0.3.23-py3-none-any.whl.metadata (2.5 kB)\n", + " Using cached langchain_community-0.3.22-py3-none-any.whl.metadata (2.4 kB)\n", + "INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.\n", + " Using cached langchain_community-0.3.21-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_community-0.3.20-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_community-0.3.19-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_community-0.3.18-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_community-0.3.17-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_community-0.3.16-py3-none-any.whl.metadata (2.9 kB)\n", + "Requirement already satisfied: dataclasses-json<0.7,>=0.5.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-community) (0.6.7)\n", + " Using cached langchain_community-0.3.15-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.14-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.13-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.12-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.11-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.10-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.9-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.8-py3-none-any.whl.metadata (2.9 kB)\n", + "Collecting SQLAlchemy<3,>=1.4 (from langchain==0.2.17)\n", + " Using cached SQLAlchemy-2.0.35-cp312-cp312-win_amd64.whl.metadata (9.9 kB)\n", + "Collecting langchain-community\n", + " Using cached langchain_community-0.3.7-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.6-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.5-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.4-py3-none-any.whl.metadata (2.9 kB)\n", + " Using cached langchain_community-0.3.3-py3-none-any.whl.metadata (2.8 kB)\n", + " Using cached langchain_community-0.3.2-py3-none-any.whl.metadata (2.8 kB)\n", + " Using cached langchain_community-0.3.1-py3-none-any.whl.metadata (2.8 kB)\n", + " Using cached langchain_community-0.3.0-py3-none-any.whl.metadata (2.8 kB)\n", + "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community) (3.26.2)\n", + "Requirement already satisfied: typing-inspect<1,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community) (0.9.0)\n", + "Requirement already satisfied: mypy-extensions>=0.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain-community) (1.1.0)\n", + "INFO: pip is looking at multiple versions of langchain-openai to determine which version is compatible with other requirements. This could take a while.\n", + "Collecting langchain-openai\n", + " Using cached langchain_openai-1.2.1-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.2.0-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.1.16-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.1.15-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.1.14-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.1.13-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.1.12-py3-none-any.whl.metadata (3.1 kB)\n", + "INFO: pip is still looking at multiple versions of langchain-openai to determine which version is compatible with other requirements. This could take a while.\n", + " Using cached langchain_openai-1.1.11-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.1.10-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.1.9-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.1.8-py3-none-any.whl.metadata (3.1 kB)\n", + " Using cached langchain_openai-1.1.7-py3-none-any.whl.metadata (2.6 kB)\n", + "INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.\n", + " Using cached langchain_openai-1.1.6-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-1.1.5-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-1.1.4-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-1.1.3-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-1.1.2-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-1.1.1-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-1.1.0-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-1.0.3-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-1.0.2-py3-none-any.whl.metadata (1.8 kB)\n", + " Using cached langchain_openai-1.0.1-py3-none-any.whl.metadata (1.8 kB)\n", + " Using cached langchain_openai-1.0.0-py3-none-any.whl.metadata (1.8 kB)\n", + " Using cached langchain_openai-0.3.35-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_openai-0.3.34-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_openai-0.3.33-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_openai-0.3.32-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_openai-0.3.31-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_openai-0.3.30-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_openai-0.3.29-py3-none-any.whl.metadata (2.4 kB)\n", + " Using cached langchain_openai-0.3.28-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.27-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.26-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.25-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.24-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.23-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.22-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.21-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.20-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.19-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.18-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.17-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.16-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.15-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.14-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.13-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.12-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.11-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.10-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.9-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.8-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.7-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.6-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.5-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.4-py3-none-any.whl.metadata (2.3 kB)\n", + " Using cached langchain_openai-0.3.3-py3-none-any.whl.metadata (2.7 kB)\n", + " Using cached langchain_openai-0.3.2-py3-none-any.whl.metadata (2.7 kB)\n", + " Using cached langchain_openai-0.3.1-py3-none-any.whl.metadata (2.7 kB)\n", + " Using cached langchain_openai-0.3.0-py3-none-any.whl.metadata (2.7 kB)\n", + " Using cached langchain_openai-0.2.14-py3-none-any.whl.metadata (2.7 kB)\n", + " Using cached langchain_openai-0.2.13-py3-none-any.whl.metadata (2.7 kB)\n", + " Using cached langchain_openai-0.2.12-py3-none-any.whl.metadata (2.7 kB)\n", + " Using cached langchain_openai-0.2.11-py3-none-any.whl.metadata (2.7 kB)\n", + " Using cached langchain_openai-0.2.10-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.9-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.8-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.7-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.6-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.5-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.4-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.3-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.2-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.1-py3-none-any.whl.metadata (2.6 kB)\n", + " Using cached langchain_openai-0.2.0-py3-none-any.whl.metadata (2.6 kB)\n", + "Requirement already satisfied: openai<2.0.0,>=1.40.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-openai) (1.109.1)\n", + "Requirement already satisfied: regex in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from tiktoken) (2026.5.9)\n", + "Requirement already satisfied: distro<2,>=1.7.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain-openai) (1.9.0)\n", + "Requirement already satisfied: jiter<1,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain-openai) (0.15.0)\n", + "Requirement already satisfied: sniffio in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain-openai) (1.3.1)\n", + "Requirement already satisfied: tqdm>4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain-openai) (4.67.3)\n", + "Requirement already satisfied: build>=1.0.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.5.0)\n", + "Requirement already satisfied: pydantic-settings>=2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (2.14.1)\n", + "Requirement already satisfied: pybase64>=1.4.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.4.3)\n", + "Requirement already satisfied: uvicorn>=0.18.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (0.48.0)\n", + "Requirement already satisfied: onnxruntime>=1.14.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.26.0)\n", + "Requirement already satisfied: opentelemetry-api>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", + "Requirement already satisfied: opentelemetry-exporter-otlp-proto-grpc>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", + "Requirement already satisfied: opentelemetry-sdk>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", + "Requirement already satisfied: tokenizers>=0.13.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.19.1)\n", + "Requirement already satisfied: pypika>=0.48.9 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.51.1)\n", + "Requirement already satisfied: overrides>=7.3.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (7.7.0)\n", + "Requirement already satisfied: importlib-resources in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (7.1.0)\n", + "Requirement already satisfied: grpcio>=1.58.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.80.0)\n", + "Requirement already satisfied: bcrypt>=4.0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (5.0.0)\n", + "Requirement already satisfied: typer>=0.9.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.25.1)\n", + "Requirement already satisfied: kubernetes>=28.1.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (36.0.0)\n", + "Requirement already satisfied: mmh3>=4.0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (5.2.1)\n", + "Requirement already satisfied: rich>=10.11.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (15.0.0)\n", + "Requirement already satisfied: jsonschema>=4.19.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (4.26.0)\n", + "Requirement already satisfied: pyproject_hooks in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from build>=1.0.3->chromadb) (1.2.0)\n", + "Requirement already satisfied: colorama in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from build>=1.0.3->chromadb) (0.4.6)\n", + "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (2025.9.1)\n", + "Requirement already satisfied: referencing>=0.28.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.37.0)\n", + "Requirement already satisfied: rpds-py>=0.25.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.30.0)\n", + "Requirement already satisfied: six>=1.9.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (1.17.0)\n", + "Requirement already satisfied: python-dateutil>=2.5.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (2.9.0.post0)\n", + "Requirement already satisfied: websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (1.9.0)\n", + "Requirement already satisfied: requests-oauthlib in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (2.0.0)\n", + "Requirement already satisfied: durationpy>=0.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (0.10)\n", + "Requirement already satisfied: flatbuffers in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from onnxruntime>=1.14.1->chromadb) (25.12.19)\n", + "Requirement already satisfied: protobuf in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from onnxruntime>=1.14.1->chromadb) (6.33.6)\n", + "Requirement already satisfied: googleapis-common-protos~=1.57 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.75.0)\n", + "Requirement already satisfied: opentelemetry-exporter-otlp-proto-common==1.42.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.42.1)\n", + "Requirement already satisfied: opentelemetry-proto==1.42.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.42.1)\n", + "Requirement already satisfied: opentelemetry-semantic-conventions==0.63b1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-sdk>=1.2.0->chromadb) (0.63b1)\n", + "Requirement already satisfied: python-dotenv>=0.21.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic-settings>=2.0->chromadb) (1.2.2)\n", + "Requirement already satisfied: markdown-it-py>=2.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from rich>=10.11.0->chromadb) (4.2.0)\n", + "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from rich>=10.11.0->chromadb) (2.20.0)\n", + "Requirement already satisfied: mdurl~=0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->chromadb) (0.1.2)\n", + "Requirement already satisfied: huggingface-hub<1.0,>=0.16.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from tokenizers>=0.13.2->chromadb) (0.36.2)\n", + "Requirement already satisfied: filelock in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb) (3.29.0)\n", + "Requirement already satisfied: fsspec>=2023.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb) (2024.3.1)\n", + "Requirement already satisfied: click>=8.2.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (8.4.1)\n", + "Requirement already satisfied: shellingham>=1.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (1.5.4)\n", + "Requirement already satisfied: annotated-doc>=0.0.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (0.0.4)\n", + "Requirement already satisfied: httptools>=0.6.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (0.8.0)\n", + "Requirement already satisfied: watchfiles>=0.20 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (1.2.0)\n", + "Requirement already satisfied: websockets>=10.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (16.0)\n", + "Requirement already satisfied: oauthlib>=3.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests-oauthlib->kubernetes>=28.1.0->chromadb) (3.3.1)\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", + "\n", + "[notice] A new release of pip is available: 26.1.1 -> 26.1.2\n", + "[notice] To update, run: python.exe -m pip install --upgrade pip\n" + ] + } + ], "source": [ - "#!pip install chromadb langchain langchain_community langchain_openai" + "!pip install -U langchain==0.2.17 langchain-community langchain-openai chromadb tiktoken" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 20, "id": "2868cff1-a3ef-426f-b8d7-7fe89047a5b7", "metadata": { "tags": [] @@ -62,7 +439,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "id": "aeff3a2d-b0cc-429f-a34c-4381d71f1a5f", "metadata": { "tags": [] @@ -78,7 +455,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "id": "f16d010b", "metadata": {}, "outputs": [], @@ -89,7 +466,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 23, "id": "14331eec-fd46-42e0-b6e7-adaf21824ef7", "metadata": { "tags": [] @@ -101,7 +478,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 24, "id": "0b7b772b", "metadata": { "tags": [] @@ -120,25 +497,75 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 25, + "id": "32b55162", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "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\n" + ] + } + ], + "source": [ + "import os\n", + "from dotenv import load_dotenv\n", + "\n", + "env_path = r\"E:\\AI\\Ironhack\\Leasons\\Week16\\lab-agent-vector-store-main\\lab-agent-vector-store-main\\.env\"\n", + "\n", + "load_dotenv(env_path, override=True)\n", + "\n", + "print(os.getenv(\"OPENAI_API_KEY\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "1413cf79", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "e:\\AI\\Ironhack\\Leasons\\Week16\\lab-agent-vector-store-main\\lab-agent-vector-store-main\n" + ] + } + ], + "source": [ + "import os\n", + "\n", + "print(os.getcwd())" + ] + }, + { + "cell_type": "code", + "execution_count": 27, "id": "f2675861", "metadata": { "tags": [] }, "outputs": [], "source": [ - "loader = TextLoader(doc_path)\n", + "loader = TextLoader(doc_path, encoding=\"utf-8\")\n", "documents = loader.load()\n", + "\n", "text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)\n", "texts = text_splitter.split_documents(documents)\n", "\n", "embeddings = OpenAIEmbeddings()\n", - "docsearch = Chroma.from_documents(texts, embeddings, collection_name=\"state-of-union\")" + "docsearch = Chroma.from_documents(\n", + " texts,\n", + " embeddings,\n", + " collection_name=\"state-of-union\"\n", + ")" ] }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 28, "id": "bc5403d4", "metadata": { "tags": [] @@ -152,19 +579,27 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 29, "id": "1431cded", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "USER_AGENT environment variable not set, consider setting it to identify your requests.\n" + ] + } + ], "source": [ "from langchain_community.document_loaders import WebBaseLoader" ] }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 30, "id": "915d3ff3", "metadata": { "tags": [] @@ -176,7 +611,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 31, "id": "96a2edf8", "metadata": { "tags": [] @@ -186,10 +621,10 @@ "name": "stderr", "output_type": "stream", "text": [ - "Created a chunk of size 2134, which is longer than the specified 1000\n", - "Created a chunk of size 2470, which is longer than the specified 1000\n", - "Created a chunk of size 1259, which is longer than the specified 1000\n", - "Created a chunk of size 1636, which is longer than the specified 1000\n" + "Created a chunk of size 2122, which is longer than the specified 1000\n", + "Created a chunk of size 3187, which is longer than the specified 1000\n", + "Created a chunk of size 1017, which is longer than the specified 1000\n", + "Created a chunk of size 2321, which is longer than the specified 1000\n" ] } ], @@ -226,7 +661,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 33, "id": "850bc4e9", "metadata": { "tags": [] @@ -249,7 +684,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 34, "id": "fc47f230", "metadata": { "tags": [] @@ -259,8 +694,8 @@ "name": "stderr", "output_type": "stream", "text": [ - "/opt/anaconda3/lib/python3.11/site-packages/langchain_core/_api/deprecation.py:119: LangChainDeprecationWarning: The function `initialize_agent` was deprecated in LangChain 0.1.0 and will be removed in 0.2.0. Use Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc. instead.\n", - " warn_deprecated(\n" + "C:\\Users\\diana\\AppData\\Local\\Temp\\ipykernel_42408\\1834837320.py:3: LangChainDeprecationWarning: The function `initialize_agent` was deprecated in LangChain 0.1.0 and will be removed in 1.0. Use Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc. instead.\n", + " agent = initialize_agent(\n" ] } ], @@ -274,7 +709,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 35, "id": "10ca2db8", "metadata": { "tags": [] @@ -284,23 +719,19 @@ "name": "stderr", "output_type": "stream", "text": [ - "/opt/anaconda3/lib/python3.11/site-packages/langchain_core/_api/deprecation.py:119: LangChainDeprecationWarning: The method `Chain.run` was deprecated in langchain 0.1.0 and will be removed in 0.2.0. Use invoke instead.\n", - " warn_deprecated(\n" + "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m I should use the State of Union QA System to answer this question\n", + "\u001b[32;1m\u001b[1;3m I should use the State of Union QA System to answer this question.\n", "Action: State of Union QA System\n", - "Action Input: What did biden say about ketanji brown jackson in the state of the union address?\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, praising her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m I now know the final answer\n", - "Final Answer: Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, praising her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\u001b[0m\n", + "Action Input: \"What did Biden say about Ketanji Brown Jackson in the state of the union address?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, and praised her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3m I now know the final answer.\n", + "Final Answer: Biden nominated Ketanji Brown Jackson to serve on the Supreme Court and praised her as a top legal mind.\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n" ] @@ -308,10 +739,11 @@ { "data": { "text/plain": [ - "\"Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, praising her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\"" + "{'input': 'What did biden say about ketanji brown jackson in the state of the union address?',\n", + " 'output': 'Biden nominated Ketanji Brown Jackson to serve on the Supreme Court and praised her as a top legal mind.'}" ] }, - "execution_count": 38, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -324,25 +756,53 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 36, "id": "4e91b811", "metadata": { "tags": [] }, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" + ] + }, { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m You should always think about the differences between ruff and flake8\n", + "\u001b[32;1m\u001b[1;3m Ruff is a python linter that has some unique features compared to flake8, so it's worth exploring the differences.\n", "Action: Ruff QA System\n", - "Action Input: \"Why use ruff over flake8?\"\u001b[0m\n", - "Observation: \u001b[33;1m\u001b[1;3m Ruff can replace multiple Flake8 plugins, has a larger rule set, and can automatically fix its own lint violations. It also supports Python versions from 3.7 onwards and does not require the installation of Rust. Additionally, Ruff can be used independently as a linter or formatter, and can be used alongside a type checker for more comprehensive error detection.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m I now know the final answer\n", - "Final Answer: Ruff offers more features and flexibility compared to flake8, making it a better choice for linting and formatting Python code.\u001b[0m\n", + "Action Input: \"What are the unique features of ruff compared to flake8?\"\u001b[0m\n", + "Observation: \u001b[33;1m\u001b[1;3m Ruff has over 900 rules, compared to Flake8's ~409 rules. Ruff also has the ability to automatically fix its own lint violations, while Flake8 does not. Additionally, Ruff does not support custom lint rules, but instead implements popular Flake8 plugins natively. Ruff also has a slightly different approach to line-length enforcement compared to Flake8.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3m Based on these unique features, it seems like Ruff may be a more comprehensive and user-friendly linter compared to Flake8.\n", + "Action: State of Union QA System\n", + "Action Input: \"What is the current state of Ruff compared to Flake8?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m I don't know.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about Ruff and Flake8, so let's try asking a more general question.\n", + "Action: State of Union QA System\n", + "Action Input: \"What is the current state of python linters?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m I don't know.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about python linters, so let's try asking a more general question.\n", + "Action: State of Union QA System\n", + "Action Input: \"What is the current state of python development tools?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m I don't know.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about python development tools, so let's try asking a more general question.\n", + "Action: State of Union QA System\n", + "Action Input: \"What is the current state of software development tools?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m I don't know. This context does not mention anything about software development tools.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about software development tools, so let's try asking a more general question.\n", + "Action: State of Union QA System\n", + "Action Input: \"What is the current state of technology tools?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m I don't know.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about technology tools, so let's try asking a more general question.\n", + "Action: State of Union QA System\n", + "Action Input: \"What is the current state of technology?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m The current state of technology is constantly evolving and advancing, with new innovations and developments being made every day.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3m I now know the final answer.\n", + "Final Answer: The current state of technology is constantly evolving and advancing, with new innovations and developments being made every day.\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n" ] @@ -351,10 +811,10 @@ "data": { "text/plain": [ "{'input': 'Why use ruff over flake8?',\n", - " 'output': 'Ruff offers more features and flexibility compared to flake8, making it a better choice for linting and formatting Python code.'}" + " 'output': 'The current state of technology is constantly evolving and advancing, with new innovations and developments being made every day.'}" ] }, - "execution_count": 40, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -383,7 +843,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 37, "id": "f59b377e", "metadata": { "tags": [] @@ -408,7 +868,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 38, "id": "8615707a", "metadata": { "tags": [] @@ -422,23 +882,27 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 39, "id": "36e718a9", "metadata": { "tags": [] }, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" + ] + }, { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m I should use the State of Union QA System to answer this question\n", + "\u001b[32;1m\u001b[1;3m I should use the State of Union QA System to answer this question.\n", "Action: State of Union QA System\n", - "Action Input: What did biden say about ketanji brown jackson in the state of the union address?\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, praising her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\u001b[0m\n", + "Action Input: \"What did Biden say about Ketanji Brown Jackson in the state of the union address?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, and praised her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\u001b[0m\n", "\u001b[32;1m\u001b[1;3m\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n" @@ -448,10 +912,10 @@ "data": { "text/plain": [ "{'input': 'What did biden say about ketanji brown jackson in the state of the union address?',\n", - " 'output': \" Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, praising her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\"}" + " 'output': \" Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, and praised her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\"}" ] }, - "execution_count": 48, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -464,23 +928,27 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 40, "id": "edfd0a1a", "metadata": { "tags": [] }, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" + ] + }, { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m You should always think about the differences between ruff and flake8\n", + "\u001b[32;1m\u001b[1;3m Ruff is a python linter that has some unique features compared to flake8, so it's worth exploring the differences.\n", "Action: Ruff QA System\n", - "Action Input: \"Why use ruff over flake8?\"\u001b[0m\n", - "Observation: \u001b[33;1m\u001b[1;3m Ruff can replace multiple Flake8 plugins, has a larger rule set, and can automatically fix its own lint violations. It also supports Python versions from 3.7 onwards and does not require the installation of Rust. Additionally, Ruff can be used independently as a linter or formatter, and can be used alongside a type checker for more comprehensive error detection.\u001b[0m\n", + "Action Input: \"What are the unique features of ruff compared to flake8?\"\u001b[0m\n", + "Observation: \u001b[33;1m\u001b[1;3m Ruff has over 900 rules, compared to Flake8's ~409 rules. Ruff also has the ability to automatically fix its own lint violations, while Flake8 does not. Additionally, Ruff does not support custom lint rules, but instead implements popular Flake8 plugins natively. Ruff also has a slightly different approach to line-length enforcement compared to Flake8.\u001b[0m\n", "\u001b[32;1m\u001b[1;3m\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n" @@ -490,10 +958,10 @@ "data": { "text/plain": [ "{'input': 'Why use ruff over flake8?',\n", - " 'output': ' Ruff can replace multiple Flake8 plugins, has a larger rule set, and can automatically fix its own lint violations. It also supports Python versions from 3.7 onwards and does not require the installation of Rust. Additionally, Ruff can be used independently as a linter or formatter, and can be used alongside a type checker for more comprehensive error detection.'}" + " 'output': \" Ruff has over 900 rules, compared to Flake8's ~409 rules. Ruff also has the ability to automatically fix its own lint violations, while Flake8 does not. Additionally, Ruff does not support custom lint rules, but instead implements popular Flake8 plugins natively. Ruff also has a slightly different approach to line-length enforcement compared to Flake8.\"}" ] }, - "execution_count": 50, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -514,7 +982,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 41, "id": "d397a233", "metadata": { "tags": [] @@ -537,7 +1005,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 42, "id": "06157240", "metadata": { "tags": [] @@ -553,30 +1021,33 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 43, "id": "b492b520", "metadata": { "tags": [] }, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" + ] + }, { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m I should use the Ruff QA System to answer the first question and the State of Union QA System to answer the second question.\n", - "Action: Ruff QA System\n", - "Action Input: What tool does ruff use to run over Jupyter Notebooks?\u001b[0m\n", - "Observation: \u001b[33;1m\u001b[1;3m Ruff integrates with nbQA, a tool for running linters and code formatters over Jupyter Notebooks.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m I should use the State of Union QA System to answer the second question.\n", + "\u001b[32;1m\u001b[1;3m I should check if the president mentioned any tools related to Jupyter Notebooks in the state of the union address.\n", "Action: State of Union QA System\n", - "Action Input: Did the president mention that tool in the state of the union?\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m\n", - "No, the president did not mention a specific tool in the state of the union.\u001b[0m\n", + "Action Input: \"What tools were mentioned in the state of the union address related to Jupyter Notebooks?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m None. The state of the union address did not mention any tools related to Jupyter Notebooks.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3m I should check if ruff uses any tools to run over Jupyter Notebooks.\n", + "Action: Ruff QA System\n", + "Action Input: \"What tools does ruff use to run over Jupyter Notebooks?\"\u001b[0m\n", + "Observation: \u001b[33;1m\u001b[1;3m Ruff uses nbQA, a tool for running linters and code formatters over Jupyter Notebooks.\u001b[0m\n", "Thought:\u001b[32;1m\u001b[1;3m I now know the final answer.\n", - "Final Answer: No, the president did not mention a specific tool in the state of the union.\u001b[0m\n", + "Final Answer: Ruff uses nbQA to run over Jupyter Notebooks. The president did not mention this tool in the state of the union address.\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n" ] @@ -585,10 +1056,10 @@ "data": { "text/plain": [ "{'input': 'What tool does ruff use to run over Jupyter Notebooks? Did the president mention that tool in the state of the union?',\n", - " 'output': 'No, the president did not mention a specific tool in the state of the union.'}" + " 'output': 'Ruff uses nbQA to run over Jupyter Notebooks. The president did not mention this tool in the state of the union address.'}" ] }, - "execution_count": 57, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -602,7 +1073,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": ".venv", "language": "python", "name": "python3" }, @@ -616,7 +1087,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.12.10" } }, "nbformat": 4, From d144376fd088e2882f03997404cc05fe48569b85 Mon Sep 17 00:00:00 2001 From: Diana Rama Date: Sat, 6 Jun 2026 13:06:40 +0200 Subject: [PATCH 2/3] Add files via upload --- lab-agent-vector-store.ipynb | 255 ++++++++++++++++------------------- 1 file changed, 114 insertions(+), 141 deletions(-) diff --git a/lab-agent-vector-store.ipynb b/lab-agent-vector-store.ipynb index f8d985c..5be5f54 100644 --- a/lab-agent-vector-store.ipynb +++ b/lab-agent-vector-store.ipynb @@ -34,7 +34,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 1, "id": "12df91e0-7322-43c2-96cd-0159d017a1e1", "metadata": { "tags": [] @@ -167,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 2, "id": "def6ed68", "metadata": {}, "outputs": [ @@ -423,7 +423,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 3, "id": "2868cff1-a3ef-426f-b8d7-7fe89047a5b7", "metadata": { "tags": [] @@ -439,23 +439,59 @@ }, { "cell_type": "code", - "execution_count": 21, - "id": "aeff3a2d-b0cc-429f-a34c-4381d71f1a5f", - "metadata": { - "tags": [] - }, - "outputs": [], + "execution_count": 4, + "id": "e2124853", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sk-proj-eewGaMw\n" + ] + } + ], "source": [ "import os\n", - "from dotenv import load_dotenv, find_dotenv\n", - "_ = load_dotenv(find_dotenv())\n", + "from dotenv import load_dotenv\n", + "\n", + "env_path = r\"E:\\AI\\Ironhack\\Leasons\\Week16\\lab-agent-vector-store-main\\lab-agent-vector-store-main\\.env\"\n", + "\n", + "load_dotenv(env_path, override=True)\n", + "\n", + "OPENAI_API_KEY = os.getenv(\"OPENAI_API_KEY\").strip()\n", + "os.environ[\"OPENAI_API_KEY\"] = OPENAI_API_KEY\n", + "\n", + "print(OPENAI_API_KEY[:15])" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "26619849", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Embeddings loaded successfully!\n" + ] + } + ], + "source": [ + "from langchain_openai import OpenAIEmbeddings\n", + "\n", + "embeddings = OpenAIEmbeddings(\n", + " openai_api_key=OPENAI_API_KEY\n", + ")\n", "\n", - "OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')" + "print(\"Embeddings loaded successfully!\")" ] }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 6, "id": "f16d010b", "metadata": {}, "outputs": [], @@ -466,7 +502,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 7, "id": "14331eec-fd46-42e0-b6e7-adaf21824ef7", "metadata": { "tags": [] @@ -478,7 +514,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 8, "id": "0b7b772b", "metadata": { "tags": [] @@ -492,57 +528,12 @@ " relevant_parts.append(p)\n", " if relevant_parts[-3:] == [\"langchain\", \"docs\", \"modules\"]:\n", " break\n", - "doc_path = str(Path(*relevant_parts) / \"state_of_the_union.txt\")" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "id": "32b55162", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "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\n" - ] - } - ], - "source": [ - "import os\n", - "from dotenv import load_dotenv\n", - "\n", - "env_path = r\"E:\\AI\\Ironhack\\Leasons\\Week16\\lab-agent-vector-store-main\\lab-agent-vector-store-main\\.env\"\n", - "\n", - "load_dotenv(env_path, override=True)\n", - "\n", - "print(os.getenv(\"OPENAI_API_KEY\"))" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "id": "1413cf79", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "e:\\AI\\Ironhack\\Leasons\\Week16\\lab-agent-vector-store-main\\lab-agent-vector-store-main\n" - ] - } - ], - "source": [ - "import os\n", - "\n", - "print(os.getcwd())" + "doc_path = str(Path(*relevant_parts) / \"sonnets.txt\")" ] }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 9, "id": "f2675861", "metadata": { "tags": [] @@ -559,27 +550,29 @@ "docsearch = Chroma.from_documents(\n", " texts,\n", " embeddings,\n", - " collection_name=\"state-of-union\"\n", + " collection_name=\"sonnets\"\n", ")" ] }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 10, "id": "bc5403d4", "metadata": { "tags": [] }, "outputs": [], "source": [ - "state_of_union = RetrievalQA.from_chain_type(\n", - " llm=llm, chain_type=\"stuff\", retriever=docsearch.as_retriever()\n", + "sonnets_qa = RetrievalQA.from_chain_type(\n", + " llm=llm,\n", + " chain_type=\"stuff\",\n", + " retriever=docsearch.as_retriever()\n", ")" ] }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 11, "id": "1431cded", "metadata": { "tags": [] @@ -599,7 +592,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 12, "id": "915d3ff3", "metadata": { "tags": [] @@ -611,7 +604,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 13, "id": "96a2edf8", "metadata": { "tags": [] @@ -647,7 +640,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 14, "id": "eb142786", "metadata": { "tags": [] @@ -661,7 +654,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 16, "id": "850bc4e9", "metadata": { "tags": [] @@ -670,21 +663,23 @@ "source": [ "tools = [\n", " Tool(\n", - " name=\"State of Union QA System\",\n", - " func=state_of_union.run,\n", - " description=\"useful for when you need to answer questions about the most recent state of the union address. Input should be a fully formed question.\",\n", + " name=\"Sonnets QA System\",\n", + " func=sonnets_qa.run,\n", + " description=\"useful for answering questions about Shakespeare's sonnets. Input should be a fully formed question.\",\n", + " return_direct=True,\n", " ),\n", " Tool(\n", " name=\"Ruff QA System\",\n", " func=ruff.run,\n", - " description=\"useful for when you need to answer questions about ruff (a python linter). Input should be a fully formed question.\",\n", + " description=\"useful for when you need to answer questions about ruff, a python linter. Input should be a fully formed question.\",\n", + " return_direct=True,\n", " ),\n", "]" ] }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 17, "id": "fc47f230", "metadata": { "tags": [] @@ -694,7 +689,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "C:\\Users\\diana\\AppData\\Local\\Temp\\ipykernel_42408\\1834837320.py:3: LangChainDeprecationWarning: The function `initialize_agent` was deprecated in LangChain 0.1.0 and will be removed in 1.0. Use Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc. instead.\n", + "C:\\Users\\diana\\AppData\\Local\\Temp\\ipykernel_21784\\1834837320.py:3: LangChainDeprecationWarning: The function `initialize_agent` was deprecated in LangChain 0.1.0 and will be removed in 1.0. Use Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc. instead.\n", " agent = initialize_agent(\n" ] } @@ -709,7 +704,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 19, "id": "10ca2db8", "metadata": { "tags": [] @@ -726,12 +721,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "\u001b[32;1m\u001b[1;3m I should use the State of Union QA System to answer this question.\n", - "Action: State of Union QA System\n", - "Action Input: \"What did Biden say about Ketanji Brown Jackson in the state of the union address?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, and praised her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m I now know the final answer.\n", - "Final Answer: Biden nominated Ketanji Brown Jackson to serve on the Supreme Court and praised her as a top legal mind.\u001b[0m\n", + "\u001b[32;1m\u001b[1;3m I should use the Sonnets QA System to answer this question.\n", + "Action: Sonnets QA System\n", + "Action Input: \"How does Shakespeare describe love in the sonnets?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m In the sonnets, Shakespeare describes love as something that is constantly changing and evolving, but also something that is enduring and can withstand the test of time. He also portrays love as a force that can be both joyful and painful, and something that can be strengthened or weakened by external factors such as time and circumstance. Additionally, Shakespeare emphasizes the importance of true love being more than just a superficial show, but rather a deep and genuine connection between two people.\u001b[0m\n", + "\u001b[32;1m\u001b[1;3m\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n" ] @@ -739,24 +733,24 @@ { "data": { "text/plain": [ - "{'input': 'What did biden say about ketanji brown jackson in the state of the union address?',\n", - " 'output': 'Biden nominated Ketanji Brown Jackson to serve on the Supreme Court and praised her as a top legal mind.'}" + "{'input': 'How does Shakespeare describe love in the sonnets?',\n", + " 'output': ' In the sonnets, Shakespeare describes love as something that is constantly changing and evolving, but also something that is enduring and can withstand the test of time. He also portrays love as a force that can be both joyful and painful, and something that can be strengthened or weakened by external factors such as time and circumstance. Additionally, Shakespeare emphasizes the importance of true love being more than just a superficial show, but rather a deep and genuine connection between two people.'}" ] }, - "execution_count": 35, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "agent.invoke(\n", - " \"What did biden say about ketanji brown jackson in the state of the union address?\"\n", + " \"How does Shakespeare describe love in the sonnets?\"\n", ")" ] }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 20, "id": "4e91b811", "metadata": { "tags": [] @@ -773,36 +767,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "\u001b[32;1m\u001b[1;3m Ruff is a python linter that has some unique features compared to flake8, so it's worth exploring the differences.\n", - "Action: Ruff QA System\n", - "Action Input: \"What are the unique features of ruff compared to flake8?\"\u001b[0m\n", - "Observation: \u001b[33;1m\u001b[1;3m Ruff has over 900 rules, compared to Flake8's ~409 rules. Ruff also has the ability to automatically fix its own lint violations, while Flake8 does not. Additionally, Ruff does not support custom lint rules, but instead implements popular Flake8 plugins natively. Ruff also has a slightly different approach to line-length enforcement compared to Flake8.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m Based on these unique features, it seems like Ruff may be a more comprehensive and user-friendly linter compared to Flake8.\n", - "Action: State of Union QA System\n", - "Action Input: \"What is the current state of Ruff compared to Flake8?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m I don't know.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about Ruff and Flake8, so let's try asking a more general question.\n", - "Action: State of Union QA System\n", - "Action Input: \"What is the current state of python linters?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m I don't know.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about python linters, so let's try asking a more general question.\n", - "Action: State of Union QA System\n", - "Action Input: \"What is the current state of python development tools?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m I don't know.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about python development tools, so let's try asking a more general question.\n", - "Action: State of Union QA System\n", - "Action Input: \"What is the current state of software development tools?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m I don't know. This context does not mention anything about software development tools.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about software development tools, so let's try asking a more general question.\n", - "Action: State of Union QA System\n", - "Action Input: \"What is the current state of technology tools?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m I don't know.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m It seems like the State of Union QA System may not have information specifically about technology tools, so let's try asking a more general question.\n", - "Action: State of Union QA System\n", - "Action Input: \"What is the current state of technology?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m The current state of technology is constantly evolving and advancing, with new innovations and developments being made every day.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m I now know the final answer.\n", - "Final Answer: The current state of technology is constantly evolving and advancing, with new innovations and developments being made every day.\u001b[0m\n", + "\u001b[32;1m\u001b[1;3m We should use the Sonnets QA System to answer this question.\n", + "Action: Sonnets QA System\n", + "Action Input: \"What emotions are expressed throughout the sonnets?\"\u001b[0m\n", + "Observation: \u001b[36;1m\u001b[1;3m The sonnets express a range of emotions, including love, desire, sadness, fear, and hope. In Sonnet I, the speaker expresses desire for beauty to continue through procreation. In Sonnet II, the speaker reflects on the fleeting nature of beauty and the power of time. In Sonnet LXVI, the speaker expresses defiance against death and the desire for his love to be remembered. In Sonnet CVIII, the speaker reflects on the power of love to outlast even the most powerful rulers and monuments. Overall, the sonnets convey a complex and intense emotional journey.\u001b[0m\n", + "\u001b[32;1m\u001b[1;3m\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n" ] @@ -810,17 +779,19 @@ { "data": { "text/plain": [ - "{'input': 'Why use ruff over flake8?',\n", - " 'output': 'The current state of technology is constantly evolving and advancing, with new innovations and developments being made every day.'}" + "{'input': 'What emotions are expressed throughout the sonnets?',\n", + " 'output': ' The sonnets express a range of emotions, including love, desire, sadness, fear, and hope. In Sonnet I, the speaker expresses desire for beauty to continue through procreation. In Sonnet II, the speaker reflects on the fleeting nature of beauty and the power of time. In Sonnet LXVI, the speaker expresses defiance against death and the desire for his love to be remembered. In Sonnet CVIII, the speaker reflects on the power of love to outlast even the most powerful rulers and monuments. Overall, the sonnets convey a complex and intense emotional journey.'}" ] }, - "execution_count": 36, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "agent.invoke(\"Why use ruff over flake8?\")" + "agent.invoke(\n", + " \"What emotions are expressed throughout the sonnets?\"\n", + ")" ] }, { @@ -843,7 +814,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 21, "id": "f59b377e", "metadata": { "tags": [] @@ -852,15 +823,15 @@ "source": [ "tools = [\n", " Tool(\n", - " name=\"State of Union QA System\",\n", - " func=state_of_union.run,\n", - " description=\"useful for when you need to answer questions about the most recent state of the union address. Input should be a fully formed question.\",\n", + " name=\"Sonnets QA System\",\n", + " func=sonnets_qa.run,\n", + " description=\"useful for answering questions about Shakespeare's sonnets. Input should be a fully formed question.\",\n", " return_direct=True,\n", " ),\n", " Tool(\n", " name=\"Ruff QA System\",\n", " func=ruff.run,\n", - " description=\"useful for when you need to answer questions about ruff (a python linter). Input should be a fully formed question.\",\n", + " description=\"useful for when you need to answer questions about ruff, a python linter. Input should be a fully formed question.\",\n", " return_direct=True,\n", " ),\n", "]" @@ -868,7 +839,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "id": "8615707a", "metadata": { "tags": [] @@ -882,7 +853,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "id": "36e718a9", "metadata": { "tags": [] @@ -922,13 +893,13 @@ ], "source": [ "agent.invoke(\n", - " \"What did biden say about ketanji brown jackson in the state of the union address?\"\n", + " \"What are the main themes in Shakespeare's sonnets?\"\n", ")" ] }, { "cell_type": "code", - "execution_count": 40, + "execution_count": null, "id": "edfd0a1a", "metadata": { "tags": [] @@ -967,7 +938,9 @@ } ], "source": [ - "agent.invoke(\"Why use ruff over flake8?\")" + "agent.invoke(\n", + " \"What emotions are expressed throughout the sonnets?\"\n", + ")" ] }, { @@ -982,7 +955,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "id": "d397a233", "metadata": { "tags": [] @@ -991,21 +964,21 @@ "source": [ "tools = [\n", " Tool(\n", - " name=\"State of Union QA System\",\n", - " func=state_of_union.run,\n", - " description=\"useful for when you need to answer questions about the most recent state of the union address. Input should be a fully formed question, not referencing any obscure pronouns from the conversation before.\",\n", + " name=\"Sonnets QA System\",\n", + " func=sonnets_qa.run,\n", + " description=\"useful for answering questions about Shakespeare's sonnets. Input should be a fully formed question.\",\n", " ),\n", " Tool(\n", " name=\"Ruff QA System\",\n", " func=ruff.run,\n", - " description=\"useful for when you need to answer questions about ruff (a python linter). Input should be a fully formed question, not referencing any obscure pronouns from the conversation before.\",\n", + " description=\"useful for when you need to answer questions about ruff, a python linter. Input should be a fully formed question.\",\n", " ),\n", "]" ] }, { "cell_type": "code", - "execution_count": 42, + "execution_count": null, "id": "06157240", "metadata": { "tags": [] @@ -1021,7 +994,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": null, "id": "b492b520", "metadata": { "tags": [] @@ -1066,7 +1039,7 @@ ], "source": [ "agent.invoke(\n", - " \"What tool does ruff use to run over Jupyter Notebooks? Did the president mention that tool in the state of the union?\"\n", + " \"What tool does Ruff use to run over Jupyter Notebooks? Are Jupyter Notebooks mentioned in Shakespeare's sonnets?\"\n", ")" ] } From cc13b2c9b8bff42365183ec5f2222ac1a6895272 Mon Sep 17 00:00:00 2001 From: Diana Rama Date: Sat, 6 Jun 2026 13:08:18 +0200 Subject: [PATCH 3/3] Delete lab-agent-vector-store.ipynb --- lab-agent-vector-store.ipynb | 1068 ---------------------------------- 1 file changed, 1068 deletions(-) delete mode 100644 lab-agent-vector-store.ipynb diff --git a/lab-agent-vector-store.ipynb b/lab-agent-vector-store.ipynb deleted file mode 100644 index 5be5f54..0000000 --- a/lab-agent-vector-store.ipynb +++ /dev/null @@ -1,1068 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "efad6479-7fb1-40c4-8610-8963f8de307f", - "metadata": {}, - "source": [ - "# Lab | Agent & Vector store\n", - "\n", - "**Change the state union dataset and replicate this lab by updating the prompts accordingly.**\n", - "\n", - "One such dataset is the [sonnets.txt](https://github.com/martin-gorner/tensorflow-rnn-shakespeare/blob/master/shakespeare/sonnets.txt) dataset or any other data of your choice from the same git." - ] - }, - { - "cell_type": "markdown", - "id": "68b24990", - "metadata": {}, - "source": [ - "# Combine agents and vector stores\n", - "\n", - "This notebook covers how to combine agents and vector stores. The use case for this is that you've ingested your data into a vector store and want to interact with it in an agentic manner.\n", - "\n", - "The recommended method for doing so is to create a `RetrievalQA` and then use that as a tool in the overall agent. Let's take a look at doing this below. You can do this with multiple different vector DBs, and use the agent as a way to route between them. There are two different ways of doing this - you can either let the agent use the vector stores as normal tools, or you can set `return_direct=True` to really just use the agent as a router." - ] - }, - { - "cell_type": "markdown", - "id": "9b22020a", - "metadata": {}, - "source": [ - "## Create the vector store" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "12df91e0-7322-43c2-96cd-0159d017a1e1", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: chromadb in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (1.5.9)\n", - "Requirement already satisfied: langchain in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.2.17)\n", - "Requirement already satisfied: langchain_community in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.2.19)\n", - "Requirement already satisfied: langchain_openai in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.1.25)\n", - "Requirement already satisfied: build>=1.0.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.5.0)\n", - "Requirement already satisfied: pydantic>=2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (2.13.4)\n", - "Requirement already satisfied: pydantic-settings>=2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (2.14.1)\n", - "Requirement already satisfied: pybase64>=1.4.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.4.3)\n", - "Requirement already satisfied: uvicorn>=0.18.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (0.48.0)\n", - "Requirement already satisfied: numpy>=1.22.5 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.26.4)\n", - "Requirement already satisfied: typing-extensions>=4.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (4.15.0)\n", - "Requirement already satisfied: onnxruntime>=1.14.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.26.0)\n", - "Requirement already satisfied: opentelemetry-api>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", - "Requirement already satisfied: opentelemetry-exporter-otlp-proto-grpc>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", - "Requirement already satisfied: opentelemetry-sdk>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", - "Requirement already satisfied: tokenizers>=0.13.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.19.1)\n", - "Requirement already satisfied: pypika>=0.48.9 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.51.1)\n", - "Requirement already satisfied: tqdm>=4.65.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (4.67.3)\n", - "Requirement already satisfied: overrides>=7.3.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (7.7.0)\n", - "Requirement already satisfied: importlib-resources in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (7.1.0)\n", - "Requirement already satisfied: grpcio>=1.58.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.80.0)\n", - "Requirement already satisfied: bcrypt>=4.0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (5.0.0)\n", - "Requirement already satisfied: typer>=0.9.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.25.1)\n", - "Requirement already satisfied: kubernetes>=28.1.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (36.0.0)\n", - "Requirement already satisfied: tenacity>=8.2.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (8.5.0)\n", - "Requirement already satisfied: pyyaml>=6.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (6.0.3)\n", - "Requirement already satisfied: mmh3>=4.0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (5.2.1)\n", - "Requirement already satisfied: orjson>=3.9.12 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (3.11.9)\n", - "Requirement already satisfied: httpx>=0.27.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.28.1)\n", - "Requirement already satisfied: rich>=10.11.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (15.0.0)\n", - "Requirement already satisfied: jsonschema>=4.19.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (4.26.0)\n", - "Requirement already satisfied: SQLAlchemy<3,>=1.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (2.0.50)\n", - "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (3.13.5)\n", - "Requirement already satisfied: langchain-core<0.3.0,>=0.2.43 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (0.2.43)\n", - "Requirement already satisfied: langchain-text-splitters<0.3.0,>=0.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (0.2.4)\n", - "Requirement already satisfied: langsmith<0.2.0,>=0.1.17 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (0.1.147)\n", - "Requirement already satisfied: requests<3,>=2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain) (2.34.2)\n", - "Requirement already satisfied: aiohappyeyeballs>=2.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (2.6.2)\n", - "Requirement already satisfied: aiosignal>=1.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.4.0)\n", - "Requirement already satisfied: attrs>=17.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (26.1.0)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.8.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (6.7.1)\n", - "Requirement already satisfied: propcache>=0.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (0.5.2)\n", - "Requirement already satisfied: yarl<2.0,>=1.17.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.24.2)\n", - "Requirement already satisfied: jsonpatch<2.0,>=1.33 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain) (1.33)\n", - "Requirement already satisfied: packaging<25,>=23.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain) (24.2)\n", - "Requirement already satisfied: jsonpointer>=1.9 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonpatch<2.0,>=1.33->langchain-core<0.3.0,>=0.2.43->langchain) (3.1.1)\n", - "Requirement already satisfied: requests-toolbelt<2.0.0,>=1.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langsmith<0.2.0,>=0.1.17->langchain) (1.0.0)\n", - "Requirement already satisfied: anyio in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx>=0.27.0->chromadb) (4.13.0)\n", - "Requirement already satisfied: certifi in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx>=0.27.0->chromadb) (2026.5.20)\n", - "Requirement already satisfied: httpcore==1.* in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx>=0.27.0->chromadb) (1.0.9)\n", - "Requirement already satisfied: idna in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx>=0.27.0->chromadb) (3.16)\n", - "Requirement already satisfied: h11>=0.16 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpcore==1.*->httpx>=0.27.0->chromadb) (0.16.0)\n", - "Requirement already satisfied: annotated-types>=0.6.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic>=2.0->chromadb) (0.7.0)\n", - "Requirement already satisfied: pydantic-core==2.46.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic>=2.0->chromadb) (2.46.4)\n", - "Requirement already satisfied: typing-inspection>=0.4.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic>=2.0->chromadb) (0.4.2)\n", - "Requirement already satisfied: charset_normalizer<4,>=2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests<3,>=2->langchain) (3.4.7)\n", - "Requirement already satisfied: urllib3<3,>=1.26 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests<3,>=2->langchain) (2.7.0)\n", - "Requirement already satisfied: greenlet>=1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from SQLAlchemy<3,>=1.4->langchain) (3.5.1)\n", - "Requirement already satisfied: dataclasses-json<0.7,>=0.5.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain_community) (0.6.7)\n", - "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain_community) (3.26.2)\n", - "Requirement already satisfied: typing-inspect<1,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain_community) (0.9.0)\n", - "Requirement already satisfied: mypy-extensions>=0.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain_community) (1.1.0)\n", - "Requirement already satisfied: openai<2.0.0,>=1.40.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain_openai) (1.109.1)\n", - "Requirement already satisfied: tiktoken<1,>=0.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain_openai) (0.13.0)\n", - "Requirement already satisfied: distro<2,>=1.7.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain_openai) (1.9.0)\n", - "Requirement already satisfied: jiter<1,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain_openai) (0.15.0)\n", - "Requirement already satisfied: sniffio in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain_openai) (1.3.1)\n", - "Requirement already satisfied: regex in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from tiktoken<1,>=0.7->langchain_openai) (2026.5.9)\n", - "Requirement already satisfied: pyproject_hooks in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from build>=1.0.3->chromadb) (1.2.0)\n", - "Requirement already satisfied: colorama in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from build>=1.0.3->chromadb) (0.4.6)\n", - "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (2025.9.1)\n", - "Requirement already satisfied: referencing>=0.28.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.37.0)\n", - "Requirement already satisfied: rpds-py>=0.25.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.30.0)\n", - "Requirement already satisfied: six>=1.9.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (1.17.0)\n", - "Requirement already satisfied: python-dateutil>=2.5.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (2.9.0.post0)\n", - "Requirement already satisfied: websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (1.9.0)\n", - "Requirement already satisfied: requests-oauthlib in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (2.0.0)\n", - "Requirement already satisfied: durationpy>=0.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (0.10)\n", - "Requirement already satisfied: flatbuffers in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from onnxruntime>=1.14.1->chromadb) (25.12.19)\n", - "Requirement already satisfied: protobuf in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from onnxruntime>=1.14.1->chromadb) (6.33.6)\n", - "Requirement already satisfied: googleapis-common-protos~=1.57 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.75.0)\n", - "Requirement already satisfied: opentelemetry-exporter-otlp-proto-common==1.42.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.42.1)\n", - "Requirement already satisfied: opentelemetry-proto==1.42.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.42.1)\n", - "Requirement already satisfied: opentelemetry-semantic-conventions==0.63b1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-sdk>=1.2.0->chromadb) (0.63b1)\n", - "Requirement already satisfied: python-dotenv>=0.21.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic-settings>=2.0->chromadb) (1.2.2)\n", - "Requirement already satisfied: markdown-it-py>=2.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from rich>=10.11.0->chromadb) (4.2.0)\n", - "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from rich>=10.11.0->chromadb) (2.20.0)\n", - "Requirement already satisfied: mdurl~=0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->chromadb) (0.1.2)\n", - "Requirement already satisfied: huggingface-hub<1.0,>=0.16.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from tokenizers>=0.13.2->chromadb) (0.36.2)\n", - "Requirement already satisfied: filelock in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb) (3.29.0)\n", - "Requirement already satisfied: fsspec>=2023.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb) (2024.3.1)\n", - "Requirement already satisfied: click>=8.2.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (8.4.1)\n", - "Requirement already satisfied: shellingham>=1.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (1.5.4)\n", - "Requirement already satisfied: annotated-doc>=0.0.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (0.0.4)\n", - "Requirement already satisfied: httptools>=0.6.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (0.8.0)\n", - "Requirement already satisfied: watchfiles>=0.20 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (1.2.0)\n", - "Requirement already satisfied: websockets>=10.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (16.0)\n", - "Requirement already satisfied: oauthlib>=3.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests-oauthlib->kubernetes>=28.1.0->chromadb) (3.3.1)\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "\n", - "[notice] A new release of pip is available: 26.1.1 -> 26.1.2\n", - "[notice] To update, run: python.exe -m pip install --upgrade pip\n" - ] - } - ], - "source": [ - "!pip install chromadb langchain langchain_community langchain_openai" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "def6ed68", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: langchain==0.2.17 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.2.17)\n", - "Requirement already satisfied: langchain-community in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.2.19)\n", - "Collecting langchain-community\n", - " Using cached langchain_community-0.4.2-py3-none-any.whl.metadata (3.4 kB)\n", - "Requirement already satisfied: langchain-openai in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.1.25)\n", - "Collecting langchain-openai\n", - " Using cached langchain_openai-1.2.2-py3-none-any.whl.metadata (3.1 kB)\n", - "Requirement already satisfied: chromadb in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (1.5.9)\n", - "Requirement already satisfied: tiktoken in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (0.13.0)\n", - "Requirement already satisfied: PyYAML>=5.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (6.0.3)\n", - "Requirement already satisfied: SQLAlchemy<3,>=1.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (2.0.50)\n", - "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (3.13.5)\n", - "Requirement already satisfied: langchain-core<0.3.0,>=0.2.43 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (0.2.43)\n", - "Requirement already satisfied: langchain-text-splitters<0.3.0,>=0.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (0.2.4)\n", - "Requirement already satisfied: langsmith<0.2.0,>=0.1.17 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (0.1.147)\n", - "Requirement already satisfied: numpy<2.0.0,>=1.26.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (1.26.4)\n", - "Requirement already satisfied: pydantic<3,>=1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (2.13.4)\n", - "Requirement already satisfied: requests<3,>=2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (2.34.2)\n", - "Requirement already satisfied: tenacity!=8.4.0,<9.0.0,>=8.1.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain==0.2.17) (8.5.0)\n", - "Requirement already satisfied: aiohappyeyeballs>=2.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (2.6.2)\n", - "Requirement already satisfied: aiosignal>=1.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (1.4.0)\n", - "Requirement already satisfied: attrs>=17.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (26.1.0)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (1.8.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (6.7.1)\n", - "Requirement already satisfied: propcache>=0.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (0.5.2)\n", - "Requirement already satisfied: yarl<2.0,>=1.17.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.17) (1.24.2)\n", - "Requirement already satisfied: jsonpatch<2.0,>=1.33 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain==0.2.17) (1.33)\n", - "Requirement already satisfied: packaging<25,>=23.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain==0.2.17) (24.2)\n", - "Requirement already satisfied: typing-extensions>=4.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-core<0.3.0,>=0.2.43->langchain==0.2.17) (4.15.0)\n", - "Requirement already satisfied: jsonpointer>=1.9 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonpatch<2.0,>=1.33->langchain-core<0.3.0,>=0.2.43->langchain==0.2.17) (3.1.1)\n", - "Requirement already satisfied: httpx<1,>=0.23.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (0.28.1)\n", - "Requirement already satisfied: orjson<4.0.0,>=3.9.14 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (3.11.9)\n", - "Requirement already satisfied: requests-toolbelt<2.0.0,>=1.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (1.0.0)\n", - "Requirement already satisfied: anyio in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (4.13.0)\n", - "Requirement already satisfied: certifi in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (2026.5.20)\n", - "Requirement already satisfied: httpcore==1.* in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (1.0.9)\n", - "Requirement already satisfied: idna in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (3.16)\n", - "Requirement already satisfied: h11>=0.16 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from httpcore==1.*->httpx<1,>=0.23.0->langsmith<0.2.0,>=0.1.17->langchain==0.2.17) (0.16.0)\n", - "Requirement already satisfied: annotated-types>=0.6.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic<3,>=1->langchain==0.2.17) (0.7.0)\n", - "Requirement already satisfied: pydantic-core==2.46.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic<3,>=1->langchain==0.2.17) (2.46.4)\n", - "Requirement already satisfied: typing-inspection>=0.4.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic<3,>=1->langchain==0.2.17) (0.4.2)\n", - "Requirement already satisfied: charset_normalizer<4,>=2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests<3,>=2->langchain==0.2.17) (3.4.7)\n", - "Requirement already satisfied: urllib3<3,>=1.26 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests<3,>=2->langchain==0.2.17) (2.7.0)\n", - "Requirement already satisfied: greenlet>=1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from SQLAlchemy<3,>=1.4->langchain==0.2.17) (3.5.1)\n", - "Requirement already satisfied: httpx-sse<1.0.0,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-community) (0.4.3)\n", - "Requirement already satisfied: langchain-classic<2.0.0,>=1.0.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-community) (1.0.7)\n", - "INFO: pip is looking at multiple versions of langchain-community to determine which version is compatible with other requirements. This could take a while.\n", - "Collecting langchain-community\n", - " Using cached langchain_community-0.4.1-py3-none-any.whl.metadata (3.0 kB)\n", - " Using cached langchain_community-0.4-py3-none-any.whl.metadata (3.0 kB)\n", - " Using cached langchain_community-0.3.31-py3-none-any.whl.metadata (3.0 kB)\n", - " Using cached langchain_community-0.3.30-py3-none-any.whl.metadata (3.0 kB)\n", - " Using cached langchain_community-0.3.29-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.28-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.27-py3-none-any.whl.metadata (2.9 kB)\n", - "INFO: pip is still looking at multiple versions of langchain-community to determine which version is compatible with other requirements. This could take a while.\n", - " Using cached langchain_community-0.3.26-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.25-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.24-py3-none-any.whl.metadata (2.5 kB)\n", - " Using cached langchain_community-0.3.23-py3-none-any.whl.metadata (2.5 kB)\n", - " Using cached langchain_community-0.3.22-py3-none-any.whl.metadata (2.4 kB)\n", - "INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.\n", - " Using cached langchain_community-0.3.21-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_community-0.3.20-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_community-0.3.19-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_community-0.3.18-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_community-0.3.17-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_community-0.3.16-py3-none-any.whl.metadata (2.9 kB)\n", - "Requirement already satisfied: dataclasses-json<0.7,>=0.5.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-community) (0.6.7)\n", - " Using cached langchain_community-0.3.15-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.14-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.13-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.12-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.11-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.10-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.9-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.8-py3-none-any.whl.metadata (2.9 kB)\n", - "Collecting SQLAlchemy<3,>=1.4 (from langchain==0.2.17)\n", - " Using cached SQLAlchemy-2.0.35-cp312-cp312-win_amd64.whl.metadata (9.9 kB)\n", - "Collecting langchain-community\n", - " Using cached langchain_community-0.3.7-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.6-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.5-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.4-py3-none-any.whl.metadata (2.9 kB)\n", - " Using cached langchain_community-0.3.3-py3-none-any.whl.metadata (2.8 kB)\n", - " Using cached langchain_community-0.3.2-py3-none-any.whl.metadata (2.8 kB)\n", - " Using cached langchain_community-0.3.1-py3-none-any.whl.metadata (2.8 kB)\n", - " Using cached langchain_community-0.3.0-py3-none-any.whl.metadata (2.8 kB)\n", - "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community) (3.26.2)\n", - "Requirement already satisfied: typing-inspect<1,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community) (0.9.0)\n", - "Requirement already satisfied: mypy-extensions>=0.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain-community) (1.1.0)\n", - "INFO: pip is looking at multiple versions of langchain-openai to determine which version is compatible with other requirements. This could take a while.\n", - "Collecting langchain-openai\n", - " Using cached langchain_openai-1.2.1-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.2.0-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.1.16-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.1.15-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.1.14-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.1.13-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.1.12-py3-none-any.whl.metadata (3.1 kB)\n", - "INFO: pip is still looking at multiple versions of langchain-openai to determine which version is compatible with other requirements. This could take a while.\n", - " Using cached langchain_openai-1.1.11-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.1.10-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.1.9-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.1.8-py3-none-any.whl.metadata (3.1 kB)\n", - " Using cached langchain_openai-1.1.7-py3-none-any.whl.metadata (2.6 kB)\n", - "INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.\n", - " Using cached langchain_openai-1.1.6-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-1.1.5-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-1.1.4-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-1.1.3-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-1.1.2-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-1.1.1-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-1.1.0-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-1.0.3-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-1.0.2-py3-none-any.whl.metadata (1.8 kB)\n", - " Using cached langchain_openai-1.0.1-py3-none-any.whl.metadata (1.8 kB)\n", - " Using cached langchain_openai-1.0.0-py3-none-any.whl.metadata (1.8 kB)\n", - " Using cached langchain_openai-0.3.35-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_openai-0.3.34-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_openai-0.3.33-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_openai-0.3.32-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_openai-0.3.31-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_openai-0.3.30-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_openai-0.3.29-py3-none-any.whl.metadata (2.4 kB)\n", - " Using cached langchain_openai-0.3.28-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.27-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.26-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.25-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.24-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.23-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.22-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.21-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.20-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.19-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.18-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.17-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.16-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.15-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.14-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.13-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.12-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.11-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.10-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.9-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.8-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.7-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.6-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.5-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.4-py3-none-any.whl.metadata (2.3 kB)\n", - " Using cached langchain_openai-0.3.3-py3-none-any.whl.metadata (2.7 kB)\n", - " Using cached langchain_openai-0.3.2-py3-none-any.whl.metadata (2.7 kB)\n", - " Using cached langchain_openai-0.3.1-py3-none-any.whl.metadata (2.7 kB)\n", - " Using cached langchain_openai-0.3.0-py3-none-any.whl.metadata (2.7 kB)\n", - " Using cached langchain_openai-0.2.14-py3-none-any.whl.metadata (2.7 kB)\n", - " Using cached langchain_openai-0.2.13-py3-none-any.whl.metadata (2.7 kB)\n", - " Using cached langchain_openai-0.2.12-py3-none-any.whl.metadata (2.7 kB)\n", - " Using cached langchain_openai-0.2.11-py3-none-any.whl.metadata (2.7 kB)\n", - " Using cached langchain_openai-0.2.10-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.9-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.8-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.7-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.6-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.5-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.4-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.3-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.2-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.1-py3-none-any.whl.metadata (2.6 kB)\n", - " Using cached langchain_openai-0.2.0-py3-none-any.whl.metadata (2.6 kB)\n", - "Requirement already satisfied: openai<2.0.0,>=1.40.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from langchain-openai) (1.109.1)\n", - "Requirement already satisfied: regex in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from tiktoken) (2026.5.9)\n", - "Requirement already satisfied: distro<2,>=1.7.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain-openai) (1.9.0)\n", - "Requirement already satisfied: jiter<1,>=0.4.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain-openai) (0.15.0)\n", - "Requirement already satisfied: sniffio in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain-openai) (1.3.1)\n", - "Requirement already satisfied: tqdm>4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from openai<2.0.0,>=1.40.0->langchain-openai) (4.67.3)\n", - "Requirement already satisfied: build>=1.0.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.5.0)\n", - "Requirement already satisfied: pydantic-settings>=2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (2.14.1)\n", - "Requirement already satisfied: pybase64>=1.4.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.4.3)\n", - "Requirement already satisfied: uvicorn>=0.18.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (0.48.0)\n", - "Requirement already satisfied: onnxruntime>=1.14.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.26.0)\n", - "Requirement already satisfied: opentelemetry-api>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", - "Requirement already satisfied: opentelemetry-exporter-otlp-proto-grpc>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", - "Requirement already satisfied: opentelemetry-sdk>=1.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.42.1)\n", - "Requirement already satisfied: tokenizers>=0.13.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.19.1)\n", - "Requirement already satisfied: pypika>=0.48.9 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.51.1)\n", - "Requirement already satisfied: overrides>=7.3.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (7.7.0)\n", - "Requirement already satisfied: importlib-resources in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (7.1.0)\n", - "Requirement already satisfied: grpcio>=1.58.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (1.80.0)\n", - "Requirement already satisfied: bcrypt>=4.0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (5.0.0)\n", - "Requirement already satisfied: typer>=0.9.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (0.25.1)\n", - "Requirement already satisfied: kubernetes>=28.1.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (36.0.0)\n", - "Requirement already satisfied: mmh3>=4.0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (5.2.1)\n", - "Requirement already satisfied: rich>=10.11.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (15.0.0)\n", - "Requirement already satisfied: jsonschema>=4.19.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from chromadb) (4.26.0)\n", - "Requirement already satisfied: pyproject_hooks in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from build>=1.0.3->chromadb) (1.2.0)\n", - "Requirement already satisfied: colorama in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from build>=1.0.3->chromadb) (0.4.6)\n", - "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (2025.9.1)\n", - "Requirement already satisfied: referencing>=0.28.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.37.0)\n", - "Requirement already satisfied: rpds-py>=0.25.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.30.0)\n", - "Requirement already satisfied: six>=1.9.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (1.17.0)\n", - "Requirement already satisfied: python-dateutil>=2.5.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (2.9.0.post0)\n", - "Requirement already satisfied: websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (1.9.0)\n", - "Requirement already satisfied: requests-oauthlib in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (2.0.0)\n", - "Requirement already satisfied: durationpy>=0.7 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from kubernetes>=28.1.0->chromadb) (0.10)\n", - "Requirement already satisfied: flatbuffers in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from onnxruntime>=1.14.1->chromadb) (25.12.19)\n", - "Requirement already satisfied: protobuf in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from onnxruntime>=1.14.1->chromadb) (6.33.6)\n", - "Requirement already satisfied: googleapis-common-protos~=1.57 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.75.0)\n", - "Requirement already satisfied: opentelemetry-exporter-otlp-proto-common==1.42.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.42.1)\n", - "Requirement already satisfied: opentelemetry-proto==1.42.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb) (1.42.1)\n", - "Requirement already satisfied: opentelemetry-semantic-conventions==0.63b1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from opentelemetry-sdk>=1.2.0->chromadb) (0.63b1)\n", - "Requirement already satisfied: python-dotenv>=0.21.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from pydantic-settings>=2.0->chromadb) (1.2.2)\n", - "Requirement already satisfied: markdown-it-py>=2.2.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from rich>=10.11.0->chromadb) (4.2.0)\n", - "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from rich>=10.11.0->chromadb) (2.20.0)\n", - "Requirement already satisfied: mdurl~=0.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->chromadb) (0.1.2)\n", - "Requirement already satisfied: huggingface-hub<1.0,>=0.16.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from tokenizers>=0.13.2->chromadb) (0.36.2)\n", - "Requirement already satisfied: filelock in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb) (3.29.0)\n", - "Requirement already satisfied: fsspec>=2023.5.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb) (2024.3.1)\n", - "Requirement already satisfied: click>=8.2.1 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (8.4.1)\n", - "Requirement already satisfied: shellingham>=1.3.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (1.5.4)\n", - "Requirement already satisfied: annotated-doc>=0.0.2 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from typer>=0.9.0->chromadb) (0.0.4)\n", - "Requirement already satisfied: httptools>=0.6.3 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (0.8.0)\n", - "Requirement already satisfied: watchfiles>=0.20 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (1.2.0)\n", - "Requirement already satisfied: websockets>=10.4 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from uvicorn[standard]>=0.18.3->chromadb) (16.0)\n", - "Requirement already satisfied: oauthlib>=3.0.0 in e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages (from requests-oauthlib->kubernetes>=28.1.0->chromadb) (3.3.1)\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~angchain-community (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "WARNING: Ignoring invalid distribution ~atasets (e:\\AI\\Ironhack\\Projekt\\automated-customer-reviews\\.venv\\Lib\\site-packages)\n", - "\n", - "[notice] A new release of pip is available: 26.1.1 -> 26.1.2\n", - "[notice] To update, run: python.exe -m pip install --upgrade pip\n" - ] - } - ], - "source": [ - "!pip install -U langchain==0.2.17 langchain-community langchain-openai chromadb tiktoken" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "2868cff1-a3ef-426f-b8d7-7fe89047a5b7", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "from langchain.chains import RetrievalQA\n", - "from langchain_community.vectorstores import Chroma\n", - "from langchain_openai import OpenAI, OpenAIEmbeddings\n", - "from langchain_text_splitters import CharacterTextSplitter\n", - "from langchain_community.document_loaders import TextLoader" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "e2124853", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "sk-proj-eewGaMw\n" - ] - } - ], - "source": [ - "import os\n", - "from dotenv import load_dotenv\n", - "\n", - "env_path = r\"E:\\AI\\Ironhack\\Leasons\\Week16\\lab-agent-vector-store-main\\lab-agent-vector-store-main\\.env\"\n", - "\n", - "load_dotenv(env_path, override=True)\n", - "\n", - "OPENAI_API_KEY = os.getenv(\"OPENAI_API_KEY\").strip()\n", - "os.environ[\"OPENAI_API_KEY\"] = OPENAI_API_KEY\n", - "\n", - "print(OPENAI_API_KEY[:15])" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "26619849", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Embeddings loaded successfully!\n" - ] - } - ], - "source": [ - "from langchain_openai import OpenAIEmbeddings\n", - "\n", - "embeddings = OpenAIEmbeddings(\n", - " openai_api_key=OPENAI_API_KEY\n", - ")\n", - "\n", - "print(\"Embeddings loaded successfully!\")" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "f16d010b", - "metadata": {}, - "outputs": [], - "source": [ - "# If you're using colab, run this\n", - "#os.environ['OPENAI_API_KEY'] = \"YOUR_OPENAI_API_KEY\"" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "14331eec-fd46-42e0-b6e7-adaf21824ef7", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "llm = OpenAI(temperature=0)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "0b7b772b", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "from pathlib import Path\n", - "\n", - "relevant_parts = []\n", - "for p in Path(\".\").absolute().parts:\n", - " relevant_parts.append(p)\n", - " if relevant_parts[-3:] == [\"langchain\", \"docs\", \"modules\"]:\n", - " break\n", - "doc_path = str(Path(*relevant_parts) / \"sonnets.txt\")" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "f2675861", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "loader = TextLoader(doc_path, encoding=\"utf-8\")\n", - "documents = loader.load()\n", - "\n", - "text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)\n", - "texts = text_splitter.split_documents(documents)\n", - "\n", - "embeddings = OpenAIEmbeddings()\n", - "docsearch = Chroma.from_documents(\n", - " texts,\n", - " embeddings,\n", - " collection_name=\"sonnets\"\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "bc5403d4", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "sonnets_qa = RetrievalQA.from_chain_type(\n", - " llm=llm,\n", - " chain_type=\"stuff\",\n", - " retriever=docsearch.as_retriever()\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "1431cded", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "USER_AGENT environment variable not set, consider setting it to identify your requests.\n" - ] - } - ], - "source": [ - "from langchain_community.document_loaders import WebBaseLoader" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "915d3ff3", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "loader = WebBaseLoader(\"https://beta.ruff.rs/docs/faq/\")" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "96a2edf8", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Created a chunk of size 2122, which is longer than the specified 1000\n", - "Created a chunk of size 3187, which is longer than the specified 1000\n", - "Created a chunk of size 1017, which is longer than the specified 1000\n", - "Created a chunk of size 2321, which is longer than the specified 1000\n" - ] - } - ], - "source": [ - "docs = loader.load()\n", - "ruff_texts = text_splitter.split_documents(docs)\n", - "ruff_db = Chroma.from_documents(ruff_texts, embeddings, collection_name=\"ruff\")\n", - "ruff = RetrievalQA.from_chain_type(\n", - " llm=llm, chain_type=\"stuff\", retriever=ruff_db.as_retriever()\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "c0a6c031", - "metadata": {}, - "source": [ - "## Create the Agent" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "eb142786", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# Import things that are needed generically\n", - "from langchain.agents import AgentType, Tool, initialize_agent\n", - "from langchain_openai import OpenAI" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "850bc4e9", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "tools = [\n", - " Tool(\n", - " name=\"Sonnets QA System\",\n", - " func=sonnets_qa.run,\n", - " description=\"useful for answering questions about Shakespeare's sonnets. Input should be a fully formed question.\",\n", - " return_direct=True,\n", - " ),\n", - " Tool(\n", - " name=\"Ruff QA System\",\n", - " func=ruff.run,\n", - " description=\"useful for when you need to answer questions about ruff, a python linter. Input should be a fully formed question.\",\n", - " return_direct=True,\n", - " ),\n", - "]" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "fc47f230", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\diana\\AppData\\Local\\Temp\\ipykernel_21784\\1834837320.py:3: LangChainDeprecationWarning: The function `initialize_agent` was deprecated in LangChain 0.1.0 and will be removed in 1.0. Use Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc. instead.\n", - " agent = initialize_agent(\n" - ] - } - ], - "source": [ - "# Construct the agent. We will use the default agent type here.\n", - "# See documentation for a full list of options.\n", - "agent = initialize_agent(\n", - " tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "10ca2db8", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[32;1m\u001b[1;3m I should use the Sonnets QA System to answer this question.\n", - "Action: Sonnets QA System\n", - "Action Input: \"How does Shakespeare describe love in the sonnets?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m In the sonnets, Shakespeare describes love as something that is constantly changing and evolving, but also something that is enduring and can withstand the test of time. He also portrays love as a force that can be both joyful and painful, and something that can be strengthened or weakened by external factors such as time and circumstance. Additionally, Shakespeare emphasizes the importance of true love being more than just a superficial show, but rather a deep and genuine connection between two people.\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\u001b[0m\n", - "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" - ] - }, - { - "data": { - "text/plain": [ - "{'input': 'How does Shakespeare describe love in the sonnets?',\n", - " 'output': ' In the sonnets, Shakespeare describes love as something that is constantly changing and evolving, but also something that is enduring and can withstand the test of time. He also portrays love as a force that can be both joyful and painful, and something that can be strengthened or weakened by external factors such as time and circumstance. Additionally, Shakespeare emphasizes the importance of true love being more than just a superficial show, but rather a deep and genuine connection between two people.'}" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "agent.invoke(\n", - " \"How does Shakespeare describe love in the sonnets?\"\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "4e91b811", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[32;1m\u001b[1;3m We should use the Sonnets QA System to answer this question.\n", - "Action: Sonnets QA System\n", - "Action Input: \"What emotions are expressed throughout the sonnets?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m The sonnets express a range of emotions, including love, desire, sadness, fear, and hope. In Sonnet I, the speaker expresses desire for beauty to continue through procreation. In Sonnet II, the speaker reflects on the fleeting nature of beauty and the power of time. In Sonnet LXVI, the speaker expresses defiance against death and the desire for his love to be remembered. In Sonnet CVIII, the speaker reflects on the power of love to outlast even the most powerful rulers and monuments. Overall, the sonnets convey a complex and intense emotional journey.\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\u001b[0m\n", - "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" - ] - }, - { - "data": { - "text/plain": [ - "{'input': 'What emotions are expressed throughout the sonnets?',\n", - " 'output': ' The sonnets express a range of emotions, including love, desire, sadness, fear, and hope. In Sonnet I, the speaker expresses desire for beauty to continue through procreation. In Sonnet II, the speaker reflects on the fleeting nature of beauty and the power of time. In Sonnet LXVI, the speaker expresses defiance against death and the desire for his love to be remembered. In Sonnet CVIII, the speaker reflects on the power of love to outlast even the most powerful rulers and monuments. Overall, the sonnets convey a complex and intense emotional journey.'}" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "agent.invoke(\n", - " \"What emotions are expressed throughout the sonnets?\"\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "787a9b5e", - "metadata": {}, - "source": [ - "## Use the Agent solely as a router" - ] - }, - { - "cell_type": "markdown", - "id": "9161ba91", - "metadata": {}, - "source": [ - "You can also set `return_direct=True` if you intend to use the agent as a router and just want to directly return the result of the RetrievalQAChain.\n", - "\n", - "Notice that in the above examples the agent did some extra work after querying the RetrievalQAChain. You can avoid that and just return the result directly." - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "id": "f59b377e", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "tools = [\n", - " Tool(\n", - " name=\"Sonnets QA System\",\n", - " func=sonnets_qa.run,\n", - " description=\"useful for answering questions about Shakespeare's sonnets. Input should be a fully formed question.\",\n", - " return_direct=True,\n", - " ),\n", - " Tool(\n", - " name=\"Ruff QA System\",\n", - " func=ruff.run,\n", - " description=\"useful for when you need to answer questions about ruff, a python linter. Input should be a fully formed question.\",\n", - " return_direct=True,\n", - " ),\n", - "]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8615707a", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "agent = initialize_agent(\n", - " tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "36e718a9", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[32;1m\u001b[1;3m I should use the State of Union QA System to answer this question.\n", - "Action: State of Union QA System\n", - "Action Input: \"What did Biden say about Ketanji Brown Jackson in the state of the union address?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, and praised her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\u001b[0m\n", - "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" - ] - }, - { - "data": { - "text/plain": [ - "{'input': 'What did biden say about ketanji brown jackson in the state of the union address?',\n", - " 'output': \" Biden mentioned that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson to serve on the United States Supreme Court, and praised her as one of the nation's top legal minds who will continue Justice Breyer's legacy of excellence.\"}" - ] - }, - "execution_count": 39, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "agent.invoke(\n", - " \"What are the main themes in Shakespeare's sonnets?\"\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "edfd0a1a", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[32;1m\u001b[1;3m Ruff is a python linter that has some unique features compared to flake8, so it's worth exploring the differences.\n", - "Action: Ruff QA System\n", - "Action Input: \"What are the unique features of ruff compared to flake8?\"\u001b[0m\n", - "Observation: \u001b[33;1m\u001b[1;3m Ruff has over 900 rules, compared to Flake8's ~409 rules. Ruff also has the ability to automatically fix its own lint violations, while Flake8 does not. Additionally, Ruff does not support custom lint rules, but instead implements popular Flake8 plugins natively. Ruff also has a slightly different approach to line-length enforcement compared to Flake8.\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\u001b[0m\n", - "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" - ] - }, - { - "data": { - "text/plain": [ - "{'input': 'Why use ruff over flake8?',\n", - " 'output': \" Ruff has over 900 rules, compared to Flake8's ~409 rules. Ruff also has the ability to automatically fix its own lint violations, while Flake8 does not. Additionally, Ruff does not support custom lint rules, but instead implements popular Flake8 plugins natively. Ruff also has a slightly different approach to line-length enforcement compared to Flake8.\"}" - ] - }, - "execution_count": 40, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "agent.invoke(\n", - " \"What emotions are expressed throughout the sonnets?\"\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "49a0cbbe", - "metadata": {}, - "source": [ - "## Multi-Hop vector store reasoning\n", - "\n", - "Because vector stores are easily usable as tools in agents, it is easy to use answer multi-hop questions that depend on vector stores using the existing agent framework." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "d397a233", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "tools = [\n", - " Tool(\n", - " name=\"Sonnets QA System\",\n", - " func=sonnets_qa.run,\n", - " description=\"useful for answering questions about Shakespeare's sonnets. Input should be a fully formed question.\",\n", - " ),\n", - " Tool(\n", - " name=\"Ruff QA System\",\n", - " func=ruff.run,\n", - " description=\"useful for when you need to answer questions about ruff, a python linter. Input should be a fully formed question.\",\n", - " ),\n", - "]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "06157240", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# Construct the agent. We will use the default agent type here.\n", - "# See documentation for a full list of options.\n", - "agent = initialize_agent(\n", - " tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b492b520", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Error in StdOutCallbackHandler.on_chain_start callback: AttributeError(\"'NoneType' object has no attribute 'get'\")\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[32;1m\u001b[1;3m I should check if the president mentioned any tools related to Jupyter Notebooks in the state of the union address.\n", - "Action: State of Union QA System\n", - "Action Input: \"What tools were mentioned in the state of the union address related to Jupyter Notebooks?\"\u001b[0m\n", - "Observation: \u001b[36;1m\u001b[1;3m None. The state of the union address did not mention any tools related to Jupyter Notebooks.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m I should check if ruff uses any tools to run over Jupyter Notebooks.\n", - "Action: Ruff QA System\n", - "Action Input: \"What tools does ruff use to run over Jupyter Notebooks?\"\u001b[0m\n", - "Observation: \u001b[33;1m\u001b[1;3m Ruff uses nbQA, a tool for running linters and code formatters over Jupyter Notebooks.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3m I now know the final answer.\n", - "Final Answer: Ruff uses nbQA to run over Jupyter Notebooks. The president did not mention this tool in the state of the union address.\u001b[0m\n", - "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" - ] - }, - { - "data": { - "text/plain": [ - "{'input': 'What tool does ruff use to run over Jupyter Notebooks? Did the president mention that tool in the state of the union?',\n", - " 'output': 'Ruff uses nbQA to run over Jupyter Notebooks. The president did not mention this tool in the state of the union address.'}" - ] - }, - "execution_count": 43, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "agent.invoke(\n", - " \"What tool does Ruff use to run over Jupyter Notebooks? Are Jupyter Notebooks mentioned in Shakespeare's sonnets?\"\n", - ")" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.10" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}