{ "cells": [ { "cell_type": "code", "execution_count": 3, "id": "3cb079ba", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting boto3==1.28.44\n", " Downloading boto3-1.28.44-py3-none-any.whl.metadata (6.7 kB)\n", "Collecting botocore<1.32.0,>=1.31.44 (from boto3==1.28.44)\n", " Downloading botocore-1.31.85-py3-none-any.whl.metadata (6.1 kB)\n", "Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from boto3==1.28.44) (1.0.1)\n", "Collecting s3transfer<0.7.0,>=0.6.0 (from boto3==1.28.44)\n", " Downloading s3transfer-0.6.2-py3-none-any.whl.metadata (1.8 kB)\n", "Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from botocore<1.32.0,>=1.31.44->boto3==1.28.44) (2.9.0)\n", "Collecting urllib3<2.1,>=1.25.4 (from botocore<1.32.0,>=1.31.44->boto3==1.28.44)\n", " Downloading urllib3-2.0.7-py3-none-any.whl.metadata (6.6 kB)\n", "Requirement already satisfied: six>=1.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.32.0,>=1.31.44->boto3==1.28.44) (1.16.0)\n", "Downloading boto3-1.28.44-py3-none-any.whl (135 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m135.8/135.8 kB\u001b[0m \u001b[31m6.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading botocore-1.31.85-py3-none-any.whl (11.3 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.3/11.3 MB\u001b[0m \u001b[31m92.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m0:01\u001b[0m\n", "\u001b[?25hDownloading s3transfer-0.6.2-py3-none-any.whl (79 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m79.8/79.8 kB\u001b[0m \u001b[31m13.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading urllib3-2.0.7-py3-none-any.whl (124 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m124.2/124.2 kB\u001b[0m \u001b[31m20.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: urllib3, botocore, s3transfer, boto3\n", " Attempting uninstall: urllib3\n", " Found existing installation: urllib3 2.2.1\n", " Uninstalling urllib3-2.2.1:\n", " Successfully uninstalled urllib3-2.2.1\n", " Attempting uninstall: botocore\n", " Found existing installation: botocore 1.34.101\n", " Uninstalling botocore-1.34.101:\n", " Successfully uninstalled botocore-1.34.101\n", " Attempting uninstall: s3transfer\n", " Found existing installation: s3transfer 0.10.1\n", " Uninstalling s3transfer-0.10.1:\n", " Successfully uninstalled s3transfer-0.10.1\n", " Attempting uninstall: boto3\n", " Found existing installation: boto3 1.34.101\n", " Uninstalling boto3-1.34.101:\n", " Successfully uninstalled boto3-1.34.101\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "awscli 1.32.101 requires botocore==1.34.101, but you have botocore 1.31.85 which is incompatible.\n", "awscli 1.32.101 requires s3transfer<0.11.0,>=0.10.0, but you have s3transfer 0.6.2 which is incompatible.\n", "sagemaker 2.219.0 requires boto3<2.0,>=1.33.3, but you have boto3 1.28.44 which is incompatible.\n", "sparkmagic 0.21.0 requires pandas<2.0.0,>=0.17.1, but you have pandas 2.2.1 which is incompatible.\n", "sphinx 7.2.6 requires docutils<0.21,>=0.18.1, but you have docutils 0.16 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed boto3-1.28.44 botocore-1.31.85 s3transfer-0.6.2 urllib3-2.0.7\n", "Collecting docx==0.2.4\n", " Downloading docx-0.2.4.tar.gz (54 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.9/54.9 kB\u001b[0m \u001b[31m4.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n", "\u001b[?25hCollecting lxml (from docx==0.2.4)\n", " Downloading lxml-5.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.4 kB)\n", "Requirement already satisfied: Pillow>=2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from docx==0.2.4) (10.2.0)\n", "Downloading lxml-5.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.0 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.0/5.0 MB\u001b[0m \u001b[31m55.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", "\u001b[?25hBuilding wheels for collected packages: docx\n", " Building wheel for docx (setup.py) ... \u001b[?25ldone\n", "\u001b[?25h Created wheel for docx: filename=docx-0.2.4-py3-none-any.whl size=53895 sha256=95ee7562fbf76e3f8f45492dfc3ff7802626fe7573e681d40e6bb9e1ee6a85fd\n", " Stored in directory: /home/ec2-user/.cache/pip/wheels/81/f5/1d/e09ba2c1907a43a4146d1189ae4733ca1a3bfe27ee39507767\n", "Successfully built docx\n", "Installing collected packages: lxml, docx\n", "Successfully installed docx-0.2.4 lxml-5.2.2\n", "Collecting httpx==0.26.0 (from httpx[http2]==0.26.0)\n", " Downloading httpx-0.26.0-py3-none-any.whl.metadata (7.6 kB)\n", "Requirement already satisfied: anyio in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx==0.26.0->httpx[http2]==0.26.0) (4.3.0)\n", "Requirement already satisfied: certifi in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx==0.26.0->httpx[http2]==0.26.0) (2024.2.2)\n", "Requirement already satisfied: httpcore==1.* in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx==0.26.0->httpx[http2]==0.26.0) (1.0.4)\n", "Requirement already satisfied: idna in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx==0.26.0->httpx[http2]==0.26.0) (3.6)\n", "Requirement already satisfied: sniffio in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx==0.26.0->httpx[http2]==0.26.0) (1.3.1)\n", "Requirement already satisfied: h2<5,>=3 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx[http2]==0.26.0) (4.1.0)\n", "Requirement already satisfied: h11<0.15,>=0.13 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpcore==1.*->httpx==0.26.0->httpx[http2]==0.26.0) (0.14.0)\n", "Requirement already satisfied: hyperframe<7,>=6.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from h2<5,>=3->httpx[http2]==0.26.0) (6.0.1)\n", "Requirement already satisfied: hpack<5,>=4.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from h2<5,>=3->httpx[http2]==0.26.0) (4.0.0)\n", "Requirement already satisfied: exceptiongroup>=1.0.2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from anyio->httpx==0.26.0->httpx[http2]==0.26.0) (1.2.0)\n", "Requirement already satisfied: typing-extensions>=4.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from anyio->httpx==0.26.0->httpx[http2]==0.26.0) (4.10.0)\n", "Downloading httpx-0.26.0-py3-none-any.whl (75 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.9/75.9 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: httpx\n", " Attempting uninstall: httpx\n", " Found existing installation: httpx 0.27.0\n", " Uninstalling httpx-0.27.0:\n", " Successfully uninstalled httpx-0.27.0\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "sparkmagic 0.21.0 requires pandas<2.0.0,>=0.17.1, but you have pandas 2.2.1 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed httpx-0.26.0\n", "Collecting langchain==0.2.0\n", " Downloading langchain-0.2.0-py3-none-any.whl.metadata (13 kB)\n", "Requirement already satisfied: PyYAML>=5.3 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain==0.2.0) (6.0.1)\n", "Requirement already satisfied: SQLAlchemy<3,>=1.4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain==0.2.0) (2.0.29)\n", "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain==0.2.0) (3.9.3)\n", "Requirement already satisfied: async-timeout<5.0.0,>=4.0.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain==0.2.0) (4.0.3)\n", "Collecting dataclasses-json<0.7,>=0.5.7 (from langchain==0.2.0)\n", " Downloading dataclasses_json-0.6.7-py3-none-any.whl.metadata (25 kB)\n", "Collecting langchain-core<0.3.0,>=0.2.0 (from langchain==0.2.0)\n", " Downloading langchain_core-0.2.8-py3-none-any.whl.metadata (5.8 kB)\n", "Collecting langchain-text-splitters<0.3.0,>=0.2.0 (from langchain==0.2.0)\n", " Downloading langchain_text_splitters-0.2.1-py3-none-any.whl.metadata (2.2 kB)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Collecting langsmith<0.2.0,>=0.1.17 (from langchain==0.2.0)\n", " Downloading langsmith-0.1.79-py3-none-any.whl.metadata (13 kB)\n", "Requirement already satisfied: numpy<2,>=1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain==0.2.0) (1.22.4)\n", "Collecting pydantic<3,>=1 (from langchain==0.2.0)\n", " Downloading pydantic-2.7.4-py3-none-any.whl.metadata (109 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m109.4/109.4 kB\u001b[0m \u001b[31m7.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: requests<3,>=2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain==0.2.0) (2.31.0)\n", "Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain==0.2.0) (8.2.3)\n", "Requirement already satisfied: aiosignal>=1.1.2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.0) (1.3.1)\n", "Requirement already satisfied: attrs>=17.3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.0) (23.2.0)\n", "Requirement already satisfied: frozenlist>=1.1.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.0) (1.4.1)\n", "Requirement already satisfied: multidict<7.0,>=4.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.0) (6.0.5)\n", "Requirement already satisfied: yarl<2.0,>=1.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.2.0) (1.9.4)\n", "Collecting marshmallow<4.0.0,>=3.18.0 (from dataclasses-json<0.7,>=0.5.7->langchain==0.2.0)\n", " Downloading marshmallow-3.21.3-py3-none-any.whl.metadata (7.1 kB)\n", "Collecting typing-inspect<1,>=0.4.0 (from dataclasses-json<0.7,>=0.5.7->langchain==0.2.0)\n", " Downloading typing_inspect-0.9.0-py3-none-any.whl.metadata (1.5 kB)\n", "Collecting jsonpatch<2.0,>=1.33 (from langchain-core<0.3.0,>=0.2.0->langchain==0.2.0)\n", " Downloading jsonpatch-1.33-py2.py3-none-any.whl.metadata (3.0 kB)\n", "Collecting packaging<25,>=23.2 (from langchain-core<0.3.0,>=0.2.0->langchain==0.2.0)\n", " Downloading packaging-24.1-py3-none-any.whl.metadata (3.2 kB)\n", "Collecting orjson<4.0.0,>=3.9.14 (from langsmith<0.2.0,>=0.1.17->langchain==0.2.0)\n", " Downloading orjson-3.10.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (49 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.7/49.7 kB\u001b[0m \u001b[31m541.6 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", "\u001b[?25hCollecting annotated-types>=0.4.0 (from pydantic<3,>=1->langchain==0.2.0)\n", " Downloading annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)\n", "Collecting pydantic-core==2.18.4 (from pydantic<3,>=1->langchain==0.2.0)\n", " Downloading pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.5 kB)\n", "Requirement already satisfied: typing-extensions>=4.6.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pydantic<3,>=1->langchain==0.2.0) (4.10.0)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2->langchain==0.2.0) (3.3.2)\n", "Requirement already satisfied: idna<4,>=2.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2->langchain==0.2.0) (3.6)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2->langchain==0.2.0) (2.0.7)\n", "Requirement already satisfied: certifi>=2017.4.17 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2->langchain==0.2.0) (2024.2.2)\n", "Requirement already satisfied: greenlet!=0.4.17 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from SQLAlchemy<3,>=1.4->langchain==0.2.0) (3.0.3)\n", "Requirement already satisfied: jsonpointer>=1.9 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonpatch<2.0,>=1.33->langchain-core<0.3.0,>=0.2.0->langchain==0.2.0) (2.4)\n", "Requirement already satisfied: mypy-extensions>=0.3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain==0.2.0) (1.0.0)\n", "Downloading langchain-0.2.0-py3-none-any.whl (973 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m973.7/973.7 kB\u001b[0m \u001b[31m8.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[?25hDownloading dataclasses_json-0.6.7-py3-none-any.whl (28 kB)\n", "Downloading langchain_core-0.2.8-py3-none-any.whl (315 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m315.8/315.8 kB\u001b[0m \u001b[31m2.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mta \u001b[36m0:00:01\u001b[0m\n", "\u001b[?25hDownloading langchain_text_splitters-0.2.1-py3-none-any.whl (23 kB)\n", "Downloading langsmith-0.1.79-py3-none-any.whl (125 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m125.3/125.3 kB\u001b[0m \u001b[31m2.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[?25hDownloading pydantic-2.7.4-py3-none-any.whl (409 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m409.0/409.0 kB\u001b[0m \u001b[31m9.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[?25hDownloading pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m31.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[?25hDownloading annotated_types-0.7.0-py3-none-any.whl (13 kB)\n", "Downloading jsonpatch-1.33-py2.py3-none-any.whl (12 kB)\n", "Downloading marshmallow-3.21.3-py3-none-any.whl (49 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.2/49.2 kB\u001b[0m \u001b[31m8.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading orjson-3.10.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (144 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m145.0/145.0 kB\u001b[0m \u001b[31m25.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading packaging-24.1-py3-none-any.whl (53 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.0/54.0 kB\u001b[0m \u001b[31m8.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading typing_inspect-0.9.0-py3-none-any.whl (8.8 kB)\n", "Installing collected packages: typing-inspect, pydantic-core, packaging, orjson, jsonpatch, annotated-types, pydantic, marshmallow, langsmith, dataclasses-json, langchain-core, langchain-text-splitters, langchain\n", " Attempting uninstall: packaging\n", " Found existing installation: packaging 21.3\n", " Uninstalling packaging-21.3:\n", " Successfully uninstalled packaging-21.3\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "sagemaker 2.219.0 requires boto3<2.0,>=1.33.3, but you have boto3 1.28.44 which is incompatible.\n", "sparkmagic 0.21.0 requires pandas<2.0.0,>=0.17.1, but you have pandas 2.2.1 which is incompatible.\n", "sphinx 7.2.6 requires docutils<0.21,>=0.18.1, but you have docutils 0.16 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed annotated-types-0.7.0 dataclasses-json-0.6.7 jsonpatch-1.33 langchain-0.2.0 langchain-core-0.2.8 langchain-text-splitters-0.2.1 langsmith-0.1.79 marshmallow-3.21.3 orjson-3.10.5 packaging-24.1 pydantic-2.7.4 pydantic-core-2.18.4 typing-inspect-0.9.0\n", "Collecting openai==1.30.1\n", " Downloading openai-1.30.1-py3-none-any.whl.metadata (21 kB)\n", "Requirement already satisfied: anyio<5,>=3.5.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from openai==1.30.1) (4.3.0)\n", "Collecting distro<2,>=1.7.0 (from openai==1.30.1)\n", " Downloading distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)\n", "Requirement already satisfied: httpx<1,>=0.23.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from openai==1.30.1) (0.26.0)\n", "Requirement already satisfied: pydantic<3,>=1.9.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from openai==1.30.1) (2.7.4)\n", "Requirement already satisfied: sniffio in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from openai==1.30.1) (1.3.1)\n", "Requirement already satisfied: tqdm>4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from openai==1.30.1) (4.66.2)\n", "Requirement already satisfied: typing-extensions<5,>=4.7 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from openai==1.30.1) (4.10.0)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: idna>=2.8 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from anyio<5,>=3.5.0->openai==1.30.1) (3.6)\n", "Requirement already satisfied: exceptiongroup>=1.0.2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from anyio<5,>=3.5.0->openai==1.30.1) (1.2.0)\n", "Requirement already satisfied: certifi in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx<1,>=0.23.0->openai==1.30.1) (2024.2.2)\n", "Requirement already satisfied: httpcore==1.* in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx<1,>=0.23.0->openai==1.30.1) (1.0.4)\n", "Requirement already satisfied: h11<0.15,>=0.13 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpcore==1.*->httpx<1,>=0.23.0->openai==1.30.1) (0.14.0)\n", "Requirement already satisfied: annotated-types>=0.4.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pydantic<3,>=1.9.0->openai==1.30.1) (0.7.0)\n", "Requirement already satisfied: pydantic-core==2.18.4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pydantic<3,>=1.9.0->openai==1.30.1) (2.18.4)\n", "Downloading openai-1.30.1-py3-none-any.whl (320 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m320.6/320.6 kB\u001b[0m \u001b[31m4.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[?25hDownloading distro-1.9.0-py3-none-any.whl (20 kB)\n", "Installing collected packages: distro, openai\n", "Successfully installed distro-1.9.0 openai-1.30.1\n", "Collecting pandas==2.2.2\n", " Downloading pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)\n", "Requirement already satisfied: numpy>=1.22.4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pandas==2.2.2) (1.22.4)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pandas==2.2.2) (2.9.0)\n", "Requirement already satisfied: pytz>=2020.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pandas==2.2.2) (2024.1)\n", "Requirement already satisfied: tzdata>=2022.7 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pandas==2.2.2) (2024.1)\n", "Requirement already satisfied: six>=1.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas==2.2.2) (1.16.0)\n", "Downloading pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.0/13.0 MB\u001b[0m \u001b[31m56.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", "\u001b[?25hInstalling collected packages: pandas\n", " Attempting uninstall: pandas\n", " Found existing installation: pandas 2.2.1\n", " Uninstalling pandas-2.2.1:\n", " Successfully uninstalled pandas-2.2.1\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "autovizwidget 0.21.0 requires pandas<2.0.0,>=0.20.1, but you have pandas 2.2.2 which is incompatible.\n", "hdijupyterutils 0.21.0 requires pandas<2.0.0,>=0.17.1, but you have pandas 2.2.2 which is incompatible.\n", "sagemaker 2.219.0 requires boto3<2.0,>=1.33.3, but you have boto3 1.28.44 which is incompatible.\n", "sparkmagic 0.21.0 requires pandas<2.0.0,>=0.17.1, but you have pandas 2.2.2 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed pandas-2.2.2\n", "Collecting pinecone-client==4.1.0\n", " Downloading pinecone_client-4.1.0-py3-none-any.whl.metadata (16 kB)\n", "Requirement already satisfied: certifi>=2019.11.17 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pinecone-client==4.1.0) (2024.2.2)\n", "Requirement already satisfied: tqdm>=4.64.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pinecone-client==4.1.0) (4.66.2)\n", "Requirement already satisfied: typing-extensions>=3.7.4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pinecone-client==4.1.0) (4.10.0)\n", "Requirement already satisfied: urllib3>=1.26.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pinecone-client==4.1.0) (2.0.7)\n", "Downloading pinecone_client-4.1.0-py3-none-any.whl (215 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m215.5/215.5 kB\u001b[0m \u001b[31m10.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: pinecone-client\n", "Successfully installed pinecone-client-4.1.0\n", "Collecting streamlit==1.32.2\n", " Downloading streamlit-1.32.2-py2.py3-none-any.whl.metadata (8.5 kB)\n", "Collecting altair<6,>=4.0 (from streamlit==1.32.2)\n", " Downloading altair-5.3.0-py3-none-any.whl.metadata (9.2 kB)\n", "Requirement already satisfied: blinker<2,>=1.0.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (1.7.0)\n", "Collecting cachetools<6,>=4.0 (from streamlit==1.32.2)\n", " Downloading cachetools-5.3.3-py3-none-any.whl.metadata (5.3 kB)\n", "Requirement already satisfied: click<9,>=7.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (8.1.7)\n", "Requirement already satisfied: numpy<2,>=1.19.3 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (1.22.4)\n", "Collecting packaging<24,>=16.8 (from streamlit==1.32.2)\n", " Downloading packaging-23.2-py3-none-any.whl.metadata (3.2 kB)\n", "Requirement already satisfied: pandas<3,>=1.3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (2.2.2)\n", "Requirement already satisfied: pillow<11,>=7.1.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (10.2.0)\n", "Requirement already satisfied: protobuf<5,>=3.20 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (4.25.3)\n", "Requirement already satisfied: pyarrow>=7.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (15.0.2)\n", "Requirement already satisfied: requests<3,>=2.27 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (2.31.0)\n", "Requirement already satisfied: rich<14,>=10.14.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (13.7.1)\n", "Requirement already satisfied: tenacity<9,>=8.1.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (8.2.3)\n", "Requirement already satisfied: toml<2,>=0.10.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (0.10.2)\n", "Requirement already satisfied: typing-extensions<5,>=4.3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (4.10.0)\n", "Collecting gitpython!=3.1.19,<4,>=3.0.7 (from streamlit==1.32.2)\n", " Using cached GitPython-3.1.43-py3-none-any.whl.metadata (13 kB)\n", "Collecting pydeck<1,>=0.8.0b4 (from streamlit==1.32.2)\n", " Downloading pydeck-0.9.1-py2.py3-none-any.whl.metadata (4.1 kB)\n", "Requirement already satisfied: tornado<7,>=6.0.3 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (6.4)\n", "Requirement already satisfied: watchdog>=2.1.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from streamlit==1.32.2) (4.0.0)\n", "Requirement already satisfied: jinja2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from altair<6,>=4.0->streamlit==1.32.2) (3.1.3)\n", "Requirement already satisfied: jsonschema>=3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from altair<6,>=4.0->streamlit==1.32.2) (4.21.1)\n", "Requirement already satisfied: toolz in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from altair<6,>=4.0->streamlit==1.32.2) (0.12.1)\n", "Collecting gitdb<5,>=4.0.1 (from gitpython!=3.1.19,<4,>=3.0.7->streamlit==1.32.2)\n", " Using cached gitdb-4.0.11-py3-none-any.whl.metadata (1.2 kB)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pandas<3,>=1.3.0->streamlit==1.32.2) (2.9.0)\n", "Requirement already satisfied: pytz>=2020.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pandas<3,>=1.3.0->streamlit==1.32.2) (2024.1)\n", "Requirement already satisfied: tzdata>=2022.7 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pandas<3,>=1.3.0->streamlit==1.32.2) (2024.1)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: charset-normalizer<4,>=2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2.27->streamlit==1.32.2) (3.3.2)\n", "Requirement already satisfied: idna<4,>=2.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2.27->streamlit==1.32.2) (3.6)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2.27->streamlit==1.32.2) (2.0.7)\n", "Requirement already satisfied: certifi>=2017.4.17 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2.27->streamlit==1.32.2) (2024.2.2)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from rich<14,>=10.14.0->streamlit==1.32.2) (3.0.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from rich<14,>=10.14.0->streamlit==1.32.2) (2.17.2)\n", "Collecting smmap<6,>=3.0.1 (from gitdb<5,>=4.0.1->gitpython!=3.1.19,<4,>=3.0.7->streamlit==1.32.2)\n", " Using cached smmap-5.0.1-py3-none-any.whl.metadata (4.3 kB)\n", "Requirement already satisfied: MarkupSafe>=2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jinja2->altair<6,>=4.0->streamlit==1.32.2) (2.1.5)\n", "Requirement already satisfied: attrs>=22.2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6,>=4.0->streamlit==1.32.2) (23.2.0)\n", "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6,>=4.0->streamlit==1.32.2) (2023.12.1)\n", "Requirement already satisfied: referencing>=0.28.4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6,>=4.0->streamlit==1.32.2) (0.34.0)\n", "Requirement already satisfied: rpds-py>=0.7.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6,>=4.0->streamlit==1.32.2) (0.18.0)\n", "Requirement already satisfied: mdurl~=0.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich<14,>=10.14.0->streamlit==1.32.2) (0.1.2)\n", "Requirement already satisfied: six>=1.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas<3,>=1.3.0->streamlit==1.32.2) (1.16.0)\n", "Downloading streamlit-1.32.2-py2.py3-none-any.whl (8.1 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8.1/8.1 MB\u001b[0m \u001b[31m102.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", "\u001b[?25hDownloading altair-5.3.0-py3-none-any.whl (857 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m857.8/857.8 kB\u001b[0m \u001b[31m18.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\n", "\u001b[?25hDownloading cachetools-5.3.3-py3-none-any.whl (9.3 kB)\n", "Using cached GitPython-3.1.43-py3-none-any.whl (207 kB)\n", "Downloading packaging-23.2-py3-none-any.whl (53 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m53.0/53.0 kB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading pydeck-0.9.1-py2.py3-none-any.whl (6.9 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m6.9/6.9 MB\u001b[0m \u001b[31m96.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m00:01\u001b[0m\n", "\u001b[?25hUsing cached gitdb-4.0.11-py3-none-any.whl (62 kB)\n", "Using cached smmap-5.0.1-py3-none-any.whl (24 kB)\n", "Installing collected packages: smmap, packaging, cachetools, pydeck, gitdb, gitpython, altair, streamlit\n", " Attempting uninstall: packaging\n", " Found existing installation: packaging 24.1\n", " Uninstalling packaging-24.1:\n", " Successfully uninstalled packaging-24.1\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "sagemaker 2.219.0 requires boto3<2.0,>=1.33.3, but you have boto3 1.28.44 which is incompatible.\n", "sparkmagic 0.21.0 requires pandas<2.0.0,>=0.17.1, but you have pandas 2.2.2 which is incompatible.\n", "sphinx 7.2.6 requires docutils<0.21,>=0.18.1, but you have docutils 0.16 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed altair-5.3.0 cachetools-5.3.3 gitdb-4.0.11 gitpython-3.1.43 packaging-23.2 pydeck-0.9.1 smmap-5.0.1 streamlit-1.32.2\n", "Collecting requests==2.28.1\n", " Downloading requests-2.28.1-py3-none-any.whl.metadata (4.6 kB)\n", "Collecting charset-normalizer<3,>=2 (from requests==2.28.1)\n", " Downloading charset_normalizer-2.1.1-py3-none-any.whl.metadata (11 kB)\n", "Requirement already satisfied: idna<4,>=2.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests==2.28.1) (3.6)\n", "Collecting urllib3<1.27,>=1.21.1 (from requests==2.28.1)\n", " Downloading urllib3-1.26.19-py2.py3-none-any.whl.metadata (49 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.3/49.3 kB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: certifi>=2017.4.17 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests==2.28.1) (2024.2.2)\n", "Downloading requests-2.28.1-py3-none-any.whl (62 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.8/62.8 kB\u001b[0m \u001b[31m7.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)\n", "Downloading urllib3-1.26.19-py2.py3-none-any.whl (143 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m143.9/143.9 kB\u001b[0m \u001b[31m14.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: urllib3, charset-normalizer, requests\n", " Attempting uninstall: urllib3\n", " Found existing installation: urllib3 2.0.7\n", " Uninstalling urllib3-2.0.7:\n", " Successfully uninstalled urllib3-2.0.7\n", " Attempting uninstall: charset-normalizer\n", " Found existing installation: charset-normalizer 3.3.2\n", " Uninstalling charset-normalizer-3.3.2:\n", " Successfully uninstalled charset-normalizer-3.3.2\n", " Attempting uninstall: requests\n", " Found existing installation: requests 2.31.0\n", " Uninstalling requests-2.31.0:\n", " Successfully uninstalled requests-2.31.0\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "jupyterlab-server 2.25.4 requires requests>=2.31, but you have requests 2.28.1 which is incompatible.\n", "sagemaker 2.219.0 requires boto3<2.0,>=1.33.3, but you have boto3 1.28.44 which is incompatible.\n", "sparkmagic 0.21.0 requires pandas<2.0.0,>=0.17.1, but you have pandas 2.2.2 which is incompatible.\n", "sphinx 7.2.6 requires docutils<0.21,>=0.18.1, but you have docutils 0.16 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed charset-normalizer-2.1.1 requests-2.28.1 urllib3-1.26.19\n", "Collecting python-docx==0.8.11\n", " Downloading python-docx-0.8.11.tar.gz (5.6 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.6/5.6 MB\u001b[0m \u001b[31m25.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n", "\u001b[?25hRequirement already satisfied: lxml>=2.3.2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from python-docx==0.8.11) (5.2.2)\n", "Building wheels for collected packages: python-docx\n", " Building wheel for python-docx (setup.py) ... \u001b[?25ldone\n", "\u001b[?25h Created wheel for python-docx: filename=python_docx-0.8.11-py3-none-any.whl size=184488 sha256=1beea9ffacd183f8637c48e55e4ecb5a01557173f2b87cf7bee13b186b97942e\n", " Stored in directory: /home/ec2-user/.cache/pip/wheels/80/27/06/837436d4c3bd989b957a91679966f207bfd71d358d63a8194d\n", "Successfully built python-docx\n", "Installing collected packages: python-docx\n", "Successfully installed python-docx-0.8.11\n", "Collecting langchain-community\n", " Downloading langchain_community-0.2.5-py3-none-any.whl.metadata (2.5 kB)\n", "Requirement already satisfied: PyYAML>=5.3 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-community) (6.0.1)\n", "Requirement already satisfied: SQLAlchemy<3,>=1.4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-community) (2.0.29)\n", "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-community) (3.9.3)\n", "Requirement already satisfied: dataclasses-json<0.7,>=0.5.7 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-community) (0.6.7)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Collecting langchain<0.3.0,>=0.2.5 (from langchain-community)\n", " Downloading langchain-0.2.5-py3-none-any.whl.metadata (7.0 kB)\n", "Requirement already satisfied: langchain-core<0.3.0,>=0.2.7 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-community) (0.2.8)\n", "Requirement already satisfied: langsmith<0.2.0,>=0.1.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-community) (0.1.79)\n", "Requirement already satisfied: numpy<2,>=1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-community) (1.22.4)\n", "Requirement already satisfied: requests<3,>=2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-community) (2.28.1)\n", "Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-community) (8.2.3)\n", "Requirement already satisfied: aiosignal>=1.1.2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community) (1.3.1)\n", "Requirement already satisfied: attrs>=17.3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community) (23.2.0)\n", "Requirement already satisfied: frozenlist>=1.1.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community) (1.4.1)\n", "Requirement already satisfied: multidict<7.0,>=4.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community) (6.0.5)\n", "Requirement already satisfied: yarl<2.0,>=1.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community) (1.9.4)\n", "Requirement already satisfied: async-timeout<5.0,>=4.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community) (4.0.3)\n", "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community) (3.21.3)\n", "Requirement already satisfied: typing-inspect<1,>=0.4.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community) (0.9.0)\n", "Requirement already satisfied: langchain-text-splitters<0.3.0,>=0.2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain<0.3.0,>=0.2.5->langchain-community) (0.2.1)\n", "Requirement already satisfied: pydantic<3,>=1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain<0.3.0,>=0.2.5->langchain-community) (2.7.4)\n", "Requirement already satisfied: jsonpatch<2.0,>=1.33 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-core<0.3.0,>=0.2.7->langchain-community) (1.33)\n", "Requirement already satisfied: packaging<25,>=23.2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langchain-core<0.3.0,>=0.2.7->langchain-community) (23.2)\n", "Requirement already satisfied: orjson<4.0.0,>=3.9.14 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from langsmith<0.2.0,>=0.1.0->langchain-community) (3.10.5)\n", "Requirement already satisfied: charset-normalizer<3,>=2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2->langchain-community) (2.1.1)\n", "Requirement already satisfied: idna<4,>=2.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2->langchain-community) (3.6)\n", "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2->langchain-community) (1.26.19)\n", "Requirement already satisfied: certifi>=2017.4.17 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests<3,>=2->langchain-community) (2024.2.2)\n", "Requirement already satisfied: typing-extensions>=4.6.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from SQLAlchemy<3,>=1.4->langchain-community) (4.10.0)\n", "Requirement already satisfied: greenlet!=0.4.17 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from SQLAlchemy<3,>=1.4->langchain-community) (3.0.3)\n", "Requirement already satisfied: jsonpointer>=1.9 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonpatch<2.0,>=1.33->langchain-core<0.3.0,>=0.2.7->langchain-community) (2.4)\n", "Requirement already satisfied: annotated-types>=0.4.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pydantic<3,>=1->langchain<0.3.0,>=0.2.5->langchain-community) (0.7.0)\n", "Requirement already satisfied: pydantic-core==2.18.4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pydantic<3,>=1->langchain<0.3.0,>=0.2.5->langchain-community) (2.18.4)\n", "Requirement already satisfied: mypy-extensions>=0.3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain-community) (1.0.0)\n", "Downloading langchain_community-0.2.5-py3-none-any.whl (2.2 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.2/2.2 MB\u001b[0m \u001b[31m62.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[?25hDownloading langchain-0.2.5-py3-none-any.whl (974 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m974.6/974.6 kB\u001b[0m \u001b[31m14.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\n", "\u001b[?25hInstalling collected packages: langchain, langchain-community\n", " Attempting uninstall: langchain\n", " Found existing installation: langchain 0.2.0\n", " Uninstalling langchain-0.2.0:\n", " Successfully uninstalled langchain-0.2.0\n", "Successfully installed langchain-0.2.5 langchain-community-0.2.5\n", "Collecting gradio\n", " Downloading gradio-4.36.1-py3-none-any.whl.metadata (15 kB)\n", "Collecting aiofiles<24.0,>=22.0 (from gradio)\n", " Downloading aiofiles-23.2.1-py3-none-any.whl.metadata (9.7 kB)\n", "Requirement already satisfied: altair<6.0,>=4.2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (5.3.0)\n", "Collecting fastapi (from gradio)\n", " Downloading fastapi-0.111.0-py3-none-any.whl.metadata (25 kB)\n", "Collecting ffmpy (from gradio)\n", " Downloading ffmpy-0.3.2.tar.gz (5.5 kB)\n", " Preparing metadata (setup.py) ... \u001b[?25ldone\n", "\u001b[?25hCollecting gradio-client==1.0.1 (from gradio)\n", " Downloading gradio_client-1.0.1-py3-none-any.whl.metadata (7.1 kB)\n", "Requirement already satisfied: httpx>=0.24.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (0.26.0)\n", "Collecting huggingface-hub>=0.19.3 (from gradio)\n", " Downloading huggingface_hub-0.23.4-py3-none-any.whl.metadata (12 kB)\n", "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (6.4.0)\n", "Requirement already satisfied: jinja2<4.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (3.1.3)\n", "Requirement already satisfied: markupsafe~=2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (2.1.5)\n", "Requirement already satisfied: matplotlib~=3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (3.8.3)\n", "Requirement already satisfied: numpy<3.0,>=1.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (1.22.4)\n", "Requirement already satisfied: orjson~=3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (3.10.5)\n", "Requirement already satisfied: packaging in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (23.2)\n", "Requirement already satisfied: pandas<3.0,>=1.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (2.2.2)\n", "Requirement already satisfied: pillow<11.0,>=8.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (10.2.0)\n", "Requirement already satisfied: pydantic>=2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (2.7.4)\n", "Collecting pydub (from gradio)\n", " Downloading pydub-0.25.1-py2.py3-none-any.whl.metadata (1.4 kB)\n", "Collecting python-multipart>=0.0.9 (from gradio)\n", " Downloading python_multipart-0.0.9-py3-none-any.whl.metadata (2.5 kB)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: pyyaml<7.0,>=5.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (6.0.1)\n", "Collecting ruff>=0.2.2 (from gradio)\n", " Downloading ruff-0.4.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (24 kB)\n", "Collecting semantic-version~=2.0 (from gradio)\n", " Downloading semantic_version-2.10.0-py2.py3-none-any.whl.metadata (9.7 kB)\n", "Collecting tomlkit==0.12.0 (from gradio)\n", " Downloading tomlkit-0.12.0-py3-none-any.whl.metadata (2.7 kB)\n", "Collecting typer<1.0,>=0.12 (from gradio)\n", " Downloading typer-0.12.3-py3-none-any.whl.metadata (15 kB)\n", "Requirement already satisfied: typing-extensions~=4.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio) (4.10.0)\n", "Collecting urllib3~=2.0 (from gradio)\n", " Downloading urllib3-2.2.2-py3-none-any.whl.metadata (6.4 kB)\n", "Collecting uvicorn>=0.14.0 (from gradio)\n", " Downloading uvicorn-0.30.1-py3-none-any.whl.metadata (6.3 kB)\n", "Requirement already satisfied: fsspec in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from gradio-client==1.0.1->gradio) (2024.3.1)\n", "Collecting websockets<12.0,>=10.0 (from gradio-client==1.0.1->gradio)\n", " Downloading websockets-11.0.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)\n", "Requirement already satisfied: jsonschema>=3.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.21.1)\n", "Requirement already satisfied: toolz in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.1)\n", "Requirement already satisfied: anyio in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (4.3.0)\n", "Requirement already satisfied: certifi in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (2024.2.2)\n", "Requirement already satisfied: httpcore==1.* in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (1.0.4)\n", "Requirement already satisfied: idna in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (3.6)\n", "Requirement already satisfied: sniffio in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (1.3.1)\n", "Requirement already satisfied: h11<0.15,>=0.13 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from httpcore==1.*->httpx>=0.24.1->gradio) (0.14.0)\n", "Requirement already satisfied: filelock in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (3.13.3)\n", "Requirement already satisfied: requests in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (2.28.1)\n", "Requirement already satisfied: tqdm>=4.42.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (4.66.2)\n", "Requirement already satisfied: contourpy>=1.0.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.2.0)\n", "Requirement already satisfied: cycler>=0.10 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\n", "Requirement already satisfied: fonttools>=4.22.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.50.0)\n", "Requirement already satisfied: kiwisolver>=1.3.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n", "Requirement already satisfied: pyparsing>=2.3.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.2)\n", "Requirement already satisfied: python-dateutil>=2.7 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.9.0)\n", "Requirement already satisfied: pytz>=2020.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2024.1)\n", "Requirement already satisfied: tzdata>=2022.7 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2024.1)\n", "Requirement already satisfied: annotated-types>=0.4.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (0.7.0)\n", "Requirement already satisfied: pydantic-core==2.18.4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (2.18.4)\n", "Requirement already satisfied: click>=8.0.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from typer<1.0,>=0.12->gradio) (8.1.7)\n", "Collecting shellingham>=1.3.0 (from typer<1.0,>=0.12->gradio)\n", " Downloading shellingham-1.5.4-py2.py3-none-any.whl.metadata (3.5 kB)\n", "Requirement already satisfied: rich>=10.11.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from typer<1.0,>=0.12->gradio) (13.7.1)\n", "Collecting starlette<0.38.0,>=0.37.2 (from fastapi->gradio)\n", " Downloading starlette-0.37.2-py3-none-any.whl.metadata (5.9 kB)\n", "Collecting fastapi-cli>=0.0.2 (from fastapi->gradio)\n", " Downloading fastapi_cli-0.0.4-py3-none-any.whl.metadata (7.0 kB)\n", "Requirement already satisfied: ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,>=4.0.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from fastapi->gradio) (5.9.0)\n", "Collecting email_validator>=2.0.0 (from fastapi->gradio)\n", " Downloading email_validator-2.1.2-py3-none-any.whl.metadata (26 kB)\n", "Collecting dnspython>=2.0.0 (from email_validator>=2.0.0->fastapi->gradio)\n", " Downloading dnspython-2.6.1-py3-none-any.whl.metadata (5.8 kB)\n", "Requirement already satisfied: attrs>=22.2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.2.0)\n", "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.12.1)\n", "Requirement already satisfied: referencing>=0.28.4 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.34.0)\n", "Requirement already satisfied: rpds-py>=0.7.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.18.0)\n", "Requirement already satisfied: six>=1.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (3.0.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (2.17.2)\n", "Requirement already satisfied: exceptiongroup>=1.0.2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from anyio->httpx>=0.24.1->gradio) (1.2.0)\n", "Collecting httptools>=0.5.0 (from uvicorn[standard]>=0.12.0->fastapi->gradio)\n", " Downloading httptools-0.6.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.6 kB)\n", "Collecting python-dotenv>=0.13 (from uvicorn[standard]>=0.12.0->fastapi->gradio)\n", " Downloading python_dotenv-1.0.1-py3-none-any.whl.metadata (23 kB)\n", "Collecting uvloop!=0.15.0,!=0.15.1,>=0.14.0 (from uvicorn[standard]>=0.12.0->fastapi->gradio)\n", " Downloading uvloop-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.9 kB)\n", "Collecting watchfiles>=0.13 (from uvicorn[standard]>=0.12.0->fastapi->gradio)\n", " Downloading watchfiles-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.9 kB)\n", "Requirement already satisfied: charset-normalizer<3,>=2 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (2.1.1)\n", "INFO: pip is looking at multiple versions of requests to determine which version is compatible with other requirements. This could take a while.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Collecting requests (from huggingface-hub>=0.19.3->gradio)\n", " Downloading requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)\n", "Requirement already satisfied: mdurl~=0.1 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<1.0,>=0.12->gradio) (0.1.2)\n", "Downloading gradio-4.36.1-py3-none-any.whl (12.3 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.3/12.3 MB\u001b[0m \u001b[31m29.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m0:01\u001b[0m\n", "\u001b[?25hDownloading gradio_client-1.0.1-py3-none-any.whl (318 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m318.1/318.1 kB\u001b[0m \u001b[31m23.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading tomlkit-0.12.0-py3-none-any.whl (37 kB)\n", "Downloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n", "Downloading huggingface_hub-0.23.4-py3-none-any.whl (402 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m402.6/402.6 kB\u001b[0m \u001b[31m56.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading python_multipart-0.0.9-py3-none-any.whl (22 kB)\n", "Downloading ruff-0.4.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.8 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8.8/8.8 MB\u001b[0m \u001b[31m89.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m00:01\u001b[0m\n", "\u001b[?25hDownloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n", "Downloading typer-0.12.3-py3-none-any.whl (47 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m47.2/47.2 kB\u001b[0m \u001b[31m767.4 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", "\u001b[?25hDownloading urllib3-2.2.2-py3-none-any.whl (121 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m121.4/121.4 kB\u001b[0m \u001b[31m17.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading uvicorn-0.30.1-py3-none-any.whl (62 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.4/62.4 kB\u001b[0m \u001b[31m12.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading fastapi-0.111.0-py3-none-any.whl (91 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.0/92.0 kB\u001b[0m \u001b[31m16.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n", "Downloading email_validator-2.1.2-py3-none-any.whl (30 kB)\n", "Downloading fastapi_cli-0.0.4-py3-none-any.whl (9.5 kB)\n", "Downloading shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)\n", "Downloading starlette-0.37.2-py3-none-any.whl (71 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m71.9/71.9 kB\u001b[0m \u001b[31m7.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading websockets-11.0.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (129 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m22.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading requests-2.32.3-py3-none-any.whl (64 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m64.9/64.9 kB\u001b[0m \u001b[31m11.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading dnspython-2.6.1-py3-none-any.whl (307 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m307.7/307.7 kB\u001b[0m \u001b[31m29.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading httptools-0.6.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (341 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m341.4/341.4 kB\u001b[0m \u001b[31m44.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading python_dotenv-1.0.1-py3-none-any.whl (19 kB)\n", "Downloading uvloop-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.4/3.4 MB\u001b[0m \u001b[31m27.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[?25hDownloading watchfiles-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m16.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\n", "\u001b[?25hBuilding wheels for collected packages: ffmpy\n", " Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n", "\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.2-py3-none-any.whl size=5584 sha256=0397b4aac7e8bc2cd10586f4161b48a2c33365d31a941eaaf05df08b9e661664\n", " Stored in directory: /home/ec2-user/.cache/pip/wheels/bd/65/9a/671fc6dcde07d4418df0c592f8df512b26d7a0029c2a23dd81\n", "Successfully built ffmpy\n", "Installing collected packages: pydub, ffmpy, websockets, uvloop, uvicorn, urllib3, tomlkit, shellingham, semantic-version, ruff, python-multipart, python-dotenv, httptools, dnspython, aiofiles, watchfiles, starlette, requests, email_validator, typer, huggingface-hub, gradio-client, fastapi-cli, fastapi, gradio\n", " Attempting uninstall: urllib3\n", " Found existing installation: urllib3 1.26.19\n", " Uninstalling urllib3-1.26.19:\n", " Successfully uninstalled urllib3-1.26.19\n", " Attempting uninstall: tomlkit\n", " Found existing installation: tomlkit 0.12.4\n", " Uninstalling tomlkit-0.12.4:\n", " Successfully uninstalled tomlkit-0.12.4\n", " Attempting uninstall: requests\n", " Found existing installation: requests 2.28.1\n", " Uninstalling requests-2.28.1:\n", " Successfully uninstalled requests-2.28.1\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "botocore 1.31.85 requires urllib3<2.1,>=1.25.4; python_version >= \"3.10\", but you have urllib3 2.2.2 which is incompatible.\n", "sagemaker 2.219.0 requires boto3<2.0,>=1.33.3, but you have boto3 1.28.44 which is incompatible.\n", "sparkmagic 0.21.0 requires pandas<2.0.0,>=0.17.1, but you have pandas 2.2.2 which is incompatible.\n", "sphinx 7.2.6 requires docutils<0.21,>=0.18.1, but you have docutils 0.16 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed aiofiles-23.2.1 dnspython-2.6.1 email_validator-2.1.2 fastapi-0.111.0 fastapi-cli-0.0.4 ffmpy-0.3.2 gradio-4.36.1 gradio-client-1.0.1 httptools-0.6.1 huggingface-hub-0.23.4 pydub-0.25.1 python-dotenv-1.0.1 python-multipart-0.0.9 requests-2.32.3 ruff-0.4.9 semantic-version-2.10.0 shellingham-1.5.4 starlette-0.37.2 tomlkit-0.12.0 typer-0.12.3 urllib3-2.2.2 uvicorn-0.30.1 uvloop-0.19.0 watchfiles-0.22.0 websockets-11.0.3\n" ] } ], "source": [ "!pip install boto3==1.28.44\n", "!pip install docx==0.2.4\n", "!pip install httpx[http2]==0.26.0\n", "!pip install langchain==0.2.0\n", "!pip install openai==1.30.1\n", "!pip install pandas==2.2.2\n", "!pip install pinecone-client==4.1.0\n", "!pip install streamlit==1.32.2\n", "!pip install requests==2.28.1\n", "!pip install python-docx==0.8.11\n", "!pip install langchain-community\n", "!pip install gradio" ] }, { "cell_type": "code", "execution_count": 73, "id": "35eed6ac", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total number of document IDs: 9\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host 'ktbot-fshno4r.svc.aped-4627-b74a.pinecone.io'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\n", " \"https://urllib3.readthedocs.io/en/latest/advanced-usage.html\"\n", "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host 'api.nlp.dev.uptimize.merckgroup.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\n", " \"https://urllib3.readthedocs.io/en/latest/advanced-usage.html\"\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "{'results': [], 'matches': [{'id': 'gtn/input/knowledge_base/AUTOMATED FORECASTING PROCESS 4.docx-1', 'score': 0.879279137, 'values': []}, {'id': 'gtn/input/knowledge_base/automated adjustments process 3.docx-7', 'score': 0.827985406, 'values': []}], 'namespace': '', 'usage': {'readUnits': 5}}\n", "Question: What should be the S3 bucket for final Forecast dump exported from SAC?\n", "Documents: ['Step:8:- \\nExport the finalized forecast dump from SAP Analytics Cloud(SAC).', 'AUTOMATED ADJUSTMENTS PROCESS\\nStep:1:- \\nLoad the final Forecast dump exported from SAC into S3 bucket with path S3://emd-forecast/gtn/output/SAC_forecast_dump\\nStep:2:- \\nLoad business files into S3 bucket with path S3://emd-forecast/gtn/output/business_files\\nStep:3:- \\nLoad Mapping template for all the families into S3 bucket with path S3://emd-forecast/gtn/output\\nStep:4:- \\nRun Datacleaning.ipynb to convert the business files into readable and understandable format.\\nStep:5:- \\nRun Units_gross_']\n", "The S3 bucket for the final Forecast dump exported from SAC should be S3://emd-forecast/gtn/output/SAC_forecast_dump.\n" ] } ], "source": [ "import os\n", "from docx import Document\n", "from langchain_text_splitters import RecursiveCharacterTextSplitter\n", "from openai import AzureOpenAI\n", "import httpx\n", "import requests\n", "import json\n", "import openai\n", "import pinecone\n", "from langchain.document_loaders import DirectoryLoader\n", "from langchain.text_splitter import RecursiveCharacterTextSplitter\n", "from langchain.embeddings.openai import OpenAIEmbeddings\n", "from langchain.vectorstores import Pinecone\n", "from langchain.llms import OpenAI\n", "from langchain.chains.question_answering import load_qa_chain\n", "import boto3\n", "# Initialize a session using Amazon S3\n", "s3 = boto3.client('s3')\n", "import io\n", "import pinecone\n", "from pinecone import Pinecone, ServerlessSpec\n", "import requests\n", "from pinecone import Pinecone\n", "httpx_client = httpx.Client(http2=True, verify='cacert.pem')\n", "\n", "# Initialize AzureOpenAI client with the HTTP client\n", "client = AzureOpenAI(\n", " azure_endpoint=\"https://api.nlp.dev.uptimize.merckgroup.com\",\n", " api_key='c6140592-6c65-4261-a959-2e2ba099526d',\n", " api_version=\"2023-09-01-preview\",\n", " http_client=httpx_client\n", ")\n", "\n", "# Initialize Pinecone client\n", "pc = Pinecone(\n", " api_key=\"8f0e6749-4859-4eb8-a8cf-4e2e72cf4bc1\"\n", ")\n", "\n", "# Connect to the index\n", "index_name = \"ktbot\"\n", "index = pc.Index(index_name)\n", "\n", "# Collect all document IDs with pagination\n", "doc_ids = []\n", "limit = 90 # Maximum number of vector IDs per request\n", "next_token = None\n", "\n", "while True:\n", " response = index.list_paginated(namespace=None, limit=limit, pagination_token=next_token)\n", " \n", " # Collect IDs from the response\n", " doc_ids.extend([v.id for v in response.vectors])\n", " \n", " # Update the next_token for pagination\n", " next_token = response.next_page_token\n", " \n", " # Break the loop if there is no next token\n", " if not next_token:\n", " break\n", "\n", "\n", "print(f\"Total number of document IDs: {len(doc_ids)}\")\n", "\n", "# Construct the API endpoint for fetching embeddings\n", "base_url = \"https://ktbot-fshno4r.svc.aped-4627-b74a.pinecone.io\"\n", "endpoint = \"/vectors/fetch\"\n", "\n", "# Prepare headers\n", "api_key = \"8f0e6749-4859-4eb8-a8cf-4e2e72cf4bc1\"\n", "headers = {\n", " \"Content-Type\": \"application/json\",\n", " \"Api-Key\": api_key\n", "}\n", "\n", "# Dictionary to store the full text for each document chunk\n", "doc_text_dict = {}\n", "\n", "# Function to fetch embedding for a given document ID\n", "def fetch_metadata(doc_id):\n", " url = f\"{base_url}{endpoint}?ids={doc_id}\"\n", " try:\n", " # Send the GET request to fetch metadata\n", " response = requests.get(url, headers=headers)\n", " response.raise_for_status() # Raise an exception for HTTP errors\n", "\n", " # Check HTTP response status\n", " if response.status_code == 200:\n", " # Attempt to parse JSON response\n", " try:\n", " data = response.json()\n", " if \"vectors\" in data and doc_id in data[\"vectors\"]:\n", " vector_data = data[\"vectors\"][doc_id]\n", " return vector_data.get('metadata', {}).get('text', '') # Return the text from metadata\n", " else:\n", " print(f\"No metadata found for document ID: {doc_id}\")\n", " return None\n", " except ValueError:\n", " print(\"Response is not valid JSON.\")\n", " print(\"Response content:\", response.text)\n", " return None\n", " else:\n", " print(f\"Failed to fetch metadata: {response.status_code} - {response.text}\")\n", " return None\n", "\n", " except requests.exceptions.RequestException as e:\n", " print(f\"Error fetching document: {e}\")\n", " return None\n", "\n", "# Fetch metadata for all document IDs and populate the doc_text_dict\n", "for doc_id in doc_ids:\n", " text = fetch_metadata(doc_id)\n", " if text:\n", " doc_text_dict[doc_id] = text\n", "\n", "\n", "\n", "# Preprocess the id to extract a consistent format\n", "# Preprocess the id to extract a consistent format\n", "def preprocess_id(id_str):\n", " if id_str.startswith(\"page_content=\"):\n", " return id_str.split(\"=\")[1].strip(\"'\")\n", " else:\n", " return id_str\n", "\n", "\n", "\n", "# Update the get_similar_docs function to preprocess the id before retrieval\n", "def get_similar_docs(query, k=2, score=False):\n", " # Generate the embedding for the query\n", " query_embedding_response = client.embeddings.create(input=query, model=\"text-embedding-ada-002-v2\")\n", " query_embedding = query_embedding_response.data[0].embedding\n", " \n", " # Search the Pinecone index for similar documents\n", " query_payload = {\n", " \"top_k\": k,\n", " \"include_values\": score,\n", " \"vector\": query_embedding\n", " }\n", " query_endpoint = f\"{base_url}/query\"\n", " query_response = requests.post(query_endpoint, headers=headers, json=query_payload, verify=False)\n", " \n", " # Extract and return the similar documents\n", " if query_response.status_code == 200:\n", " search_results = query_response.json()\n", " print(search_results)\n", " similar_docs = [doc_text_dict[preprocess_id(match['id'])] for match in search_results['matches']]\n", " return similar_docs\n", " else:\n", " print(f\"Failed to retrieve similar documents: {query_response.status_code} - {query_response.reason}\")\n", " print(\"Response content:\", query_response.text)\n", " return []\n", "\n", "\n", "def get_answer(query):\n", " similar_docs = get_similar_docs(query)\n", " combined_message = f\"Question: {query}\\nDocuments: {similar_docs}\"\n", " print(combined_message)\n", " openai_key = 'c6140592-6c65-4261-a959-2e2ba099526d'\n", " openai_url = \"https://api.nlp.dev.uptimize.merckgroup.com/openai/deployments/gpt-4-turbo/chat/completions?api-version=2023-09-01-preview\"\n", " headers = {\n", " \"Content-Type\": \"application/json\",\n", " \"x-api-key\": openai_key,\n", " \"region\": \"EU\"\n", " }\n", " \n", " payload = {\n", " \"model\": \"gpt-4-turbo\",\n", " \"messages\": [\n", " {\"role\": \"user\", \"content\": combined_message}\n", " ],\n", " \"max_tokens\": 1024,\n", " \"n\": 1,\n", " \"temperature\": 0\n", " }\n", "\n", " try:\n", " response = requests.post(openai_url, headers=headers, data=json.dumps(payload), verify=False)\n", " response.raise_for_status() # Raise an exception for HTTP errors\n", " ChatGPT_reply = response.json()[\"choices\"][0][\"message\"][\"content\"]\n", " return ChatGPT_reply\n", " except requests.exceptions.RequestException as e:\n", " print(\"ERROR\")\n", " print(e)\n", " raise Exception(f'Request failed: {e}')\n", "\n", "# Example usage:\n", "query = \"What should be the S3 bucket for final Forecast dump exported from SAC?\"\n", "answer = get_answer(query)\n", "print(answer)\n" ] }, { "cell_type": "code", "execution_count": 75, "id": "27ed9037", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Running on local URL: http://127.0.0.1:7860\n", "Running on public URL: https://0e7b0972f54b527958.gradio.live\n", "\n", "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n" ] }, { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Keyboard interruption in main thread... closing server.\n", "Killing tunnel 127.0.0.1:7860 <> https://0e7b0972f54b527958.gradio.live\n" ] }, { "ename": "TypeError", "evalue": "EventListener._setup..event_trigger() got an unexpected keyword argument '_js'", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[75], line 49\u001b[0m\n\u001b[1;32m 47\u001b[0m \u001b[38;5;66;03m# Apply custom CSS using JavaScript\u001b[39;00m\n\u001b[1;32m 48\u001b[0m block\u001b[38;5;241m.\u001b[39mlaunch(debug\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m, inbrowser\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m,share\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[0;32m---> 49\u001b[0m \u001b[43mblock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m_js\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\"\"\u001b[39;49m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;124;43m (function() \u001b[39;49m\u001b[38;5;124;43m{\u001b[39;49m\n\u001b[1;32m 51\u001b[0m \u001b[38;5;124;43m var style = document.createElement(\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mstyle\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m);\u001b[39;49m\n\u001b[1;32m 52\u001b[0m \u001b[38;5;124;43m style.innerHTML = `\u001b[39;49m\n\u001b[1;32m 53\u001b[0m \u001b[38;5;124;43m #message-box textarea \u001b[39;49m\u001b[38;5;124;43m{\u001b[39;49m\n\u001b[1;32m 54\u001b[0m \u001b[38;5;124;43m border: 1px solid black !important;\u001b[39;49m\n\u001b[1;32m 55\u001b[0m \u001b[38;5;124;43m }\u001b[39;49m\n\u001b[1;32m 56\u001b[0m \u001b[38;5;124;43m `;\u001b[39;49m\n\u001b[1;32m 57\u001b[0m \u001b[38;5;124;43m document.head.appendChild(style);\u001b[39;49m\n\u001b[1;32m 58\u001b[0m \u001b[38;5;124;43m })();\u001b[39;49m\n\u001b[1;32m 59\u001b[0m \u001b[38;5;124;43m\"\"\"\u001b[39;49m\u001b[43m)\u001b[49m\n", "\u001b[0;31mTypeError\u001b[0m: EventListener._setup..event_trigger() got an unexpected keyword argument '_js'" ] } ], "source": [ "import base64\n", "import gradio as gr\n", "bucket_name='emd-forecast'\n", "file_key = 'gtn/input/logo_ktbot.PNG'\n", "\n", "# Download the file from S3\n", "response = s3.get_object(Bucket=bucket_name, Key=file_key)\n", "file_content = response['Body'].read()\n", "\n", "# Encode the file content in base64\n", "png_base64 = base64.b64encode(file_content).decode('utf-8')\n", "png_data_url = f\"data:image/png;base64,{png_base64}\"\n", "\n", "\n", "\n", "\n", "def message_and_history(input, history):\n", " history = history or []\n", " s = list(sum(history, ()))\n", " s.append(input)\n", " inp = ' '.join(s)\n", " output = get_answer(inp)\n", " history.append((input, output))\n", " return history, history\n", "\n", "\n", "block = gr.Blocks(theme=gr.themes.Soft())\n", "\n", "with block:\n", " with gr.Row():\n", " with gr.Column(scale=1, min_width=300):\n", " gr.Markdown(f\"\"\"\n", "
\n", " \"Logo\"\n", "
\n", "\n", " \"\"\")\n", " with gr.Column(scale=2):\n", " chatbot = gr.Chatbot(label=\"KT Bot\")\n", " message = gr.Textbox(placeholder=\"Your KT bot, ask me anything...\",label=\"Query\")\n", " state = gr.State()\n", " submit = gr.Button(\"SEND\")\n", " submit.click(message_and_history, \n", " inputs=[message, state], \n", " outputs=[chatbot, state])\n", "\n", "# Apply custom CSS using JavaScript\n", "block.launch(debug=True, inbrowser=True,share=True)\n", "block.load(None, None, None, _js=\"\"\"\n", " (function() {\n", " var style = document.createElement('style');\n", " style.innerHTML = `\n", " #message-box textarea {\n", " border: 1px solid black !important;\n", " }\n", " `;\n", " document.head.appendChild(style);\n", " })();\n", "\"\"\")\n" ] }, { "cell_type": "code", "execution_count": 8, "id": "2ed00191", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: urllib3 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (1.26.18)\n", "Collecting urllib3\n", " Using cached urllib3-2.2.1-py3-none-any.whl.metadata (6.4 kB)\n", "Requirement already satisfied: pyopenssl in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (24.0.0)\n", "Collecting pyopenssl\n", " Downloading pyOpenSSL-24.1.0-py3-none-any.whl.metadata (12 kB)\n", "Requirement already satisfied: cryptography<43,>=41.0.5 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from pyopenssl) (42.0.5)\n", "Requirement already satisfied: cffi>=1.12 in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from cryptography<43,>=41.0.5->pyopenssl) (1.16.0)\n", "Requirement already satisfied: pycparser in /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages (from cffi>=1.12->cryptography<43,>=41.0.5->pyopenssl) (2.21)\n", "Using cached urllib3-2.2.1-py3-none-any.whl (121 kB)\n", "Downloading pyOpenSSL-24.1.0-py3-none-any.whl (56 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.9/56.9 kB\u001b[0m \u001b[31m8.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: urllib3, pyopenssl\n", " Attempting uninstall: urllib3\n", " Found existing installation: urllib3 1.26.18\n", " Uninstalling urllib3-1.26.18:\n", " Successfully uninstalled urllib3-1.26.18\n", " Attempting uninstall: pyopenssl\n", " Found existing installation: pyOpenSSL 24.0.0\n", " Uninstalling pyOpenSSL-24.0.0:\n", " Successfully uninstalled pyOpenSSL-24.0.0\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "botocore 1.31.85 requires urllib3<2.1,>=1.25.4; python_version >= \"3.10\", but you have urllib3 2.2.1 which is incompatible.\n", "requests 2.28.1 requires urllib3<1.27,>=1.21.1, but you have urllib3 2.2.1 which is incompatible.\n", "sagemaker 2.219.0 requires boto3<2.0,>=1.33.3, but you have boto3 1.28.44 which is incompatible.\n", "sparkmagic 0.21.0 requires pandas<2.0.0,>=0.17.1, but you have pandas 2.2.2 which is incompatible.\n", "sphinx 7.2.6 requires docutils<0.21,>=0.18.1, but you have docutils 0.16 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed pyopenssl-24.1.0 urllib3-2.2.1\n" ] } ], "source": [ "!pip install --upgrade urllib3 pyopenssl\n" ] }, { "cell_type": "code", "execution_count": null, "id": "b80e67ff", "metadata": {}, "outputs": [], "source": [ "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" ] }, { "cell_type": "code", "execution_count": 79, "id": "0751314c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Need \u001b[32m'write'\u001b[0m access token to create a Spaces repo.\n", "\n", " _| _| _| _| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_|_| _|_| _|_|_| _|_|_|_|\n", " _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n", " _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_| _|_|_|_| _| _|_|_|\n", " _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n", " _| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|\n", "\n", " To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .\n", "Enter your token (input will not be visible): \n", "\u001b[31mAborted.\u001b[0m\n" ] } ], "source": [ "!gradio deploy" ] }, { "cell_type": "code", "execution_count": null, "id": "870ba009", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Need \u001b[32m'write'\u001b[0m access token to create a Spaces repo.\r\n", "\r\n", " _| _| _| _| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_|_| _|_| _|_|_| _|_|_|_|\r\n", " _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\r\n", " _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_| _|_|_|_| _| _|_|_|\r\n", " _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\r\n", " _| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|\r\n", "\r\n", " A token is already saved on your machine. Run `huggingface-cli whoami` to get more information or `huggingface-cli logout` if you want to log out.\r\n", " Setting a new token will erase the existing one.\r\n", " To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .\r\n", "Enter your token (input will not be visible): " ] } ], "source": [ "!gradio deploy\n" ] }, { "cell_type": "code", "execution_count": null, "id": "ec155eeb", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "conda_python3", "language": "python", "name": "conda_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.10.14" } }, "nbformat": 4, "nbformat_minor": 5 }