From 96727d49e9e17b86f1c7bafdaf16bfc3fe2015f8 Mon Sep 17 00:00:00 2001 From: martinb-bb <105685594+martinb-bb@users.noreply.github.com> Date: Fri, 7 Jul 2023 10:50:40 -0400 Subject: [PATCH] [Update] bump langchain and llama (#5202) * bump langchain and llama * Pin scipy --------- Co-authored-by: James Maslek --- openbb_terminal/helper_funcs.py | 2 +- poetry.lock | 45 ++++++++++++++++++++++++--------- pyproject.toml | 6 ++--- requirements-full.txt | 5 ++-- requirements.txt | 5 ++-- 5 files changed, 43 insertions(+), 20 deletions(-) diff --git a/openbb_terminal/helper_funcs.py b/openbb_terminal/helper_funcs.py index 6a5987af2ab..b28ec28bd24 100644 --- a/openbb_terminal/helper_funcs.py +++ b/openbb_terminal/helper_funcs.py @@ -2170,7 +2170,7 @@ def query_LLM_local(query_text, gpt_model): # define LLM llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.5, model_name=gpt_model)) # define prompt helper - prompt_helper = PromptHelper(max_input_size=4096, num_output=256) + prompt_helper = PromptHelper(context_window=4096, num_output=256) service_context = ServiceContext.from_defaults( llm_predictor=llm_predictor, prompt_helper=prompt_helper ) diff --git a/poetry.lock b/poetry.lock index 5ef0e62ecd2..6828ebc17b1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3364,19 +3364,20 @@ files = [ [[package]] name = "langchain" -version = "0.0.191" +version = "0.0.225" description = "Building applications with LLMs through composability" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langchain-0.0.191-py3-none-any.whl", hash = "sha256:2da000e79ce5f6a6c9be3b65362d41f3bf036ca0b4884488e54cf12726a4e5d2"}, - {file = "langchain-0.0.191.tar.gz", hash = "sha256:5b3321f441c95bd3630a2dd42bd33cd7fca45b593fdc75ca96cb9cd76f71a9c7"}, + {file = "langchain-0.0.225-py3-none-any.whl", hash = "sha256:a72132ceb22f9a9fcad944778fd351d33b63e27a9c03f61d17e4e52fad37fe47"}, + {file = "langchain-0.0.225.tar.gz", hash = "sha256:986e0838faef3c344d8c00b0079814ca357a39b17f7642e06beb075d3c59c770"}, ] [package.dependencies] aiohttp = ">=3.8.3,<4.0.0" async-timeout = {version = ">=4.0.0,<5.0.0", markers = "python_version < \"3.11\""} dataclasses-json = ">=0.5.7,<0.6.0" +langchainplus-sdk = ">=0.0.20,<0.0.21" numexpr = ">=2.8.4,<3.0.0" numpy = ">=1,<2" openapi-schema-pydantic = ">=1.2,<2.0" @@ -3387,17 +3388,35 @@ SQLAlchemy = ">=1.4,<3" tenacity = ">=8.1.0,<9.0.0" [package.extras] -all = ["O365 (>=2.0.26,<3.0.0)", "aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.2.6,<0.3.0)", "arxiv (>=1.4,<2.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "beautifulsoup4 (>=4,<5)", "clickhouse-connect (>=0.5.14,<0.6.0)", "cohere (>=3,<4)", "deeplake (>=3.3.0,<4.0.0)", "docarray[hnswlib] (>=0.32.0,<0.33.0)", "duckduckgo-search (>=2.8.6,<3.0.0)", "elasticsearch (>=8,<9)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-auth (>=2.18.1,<3.0.0)", "google-search-results (>=2,<3)", "gptcache (>=0.1.7)", "html2text (>=2020.1.16,<2021.0.0)", "huggingface_hub (>=0,<1)", "jina (>=3.14,<4.0)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lancedb (>=0.1,<0.2)", "langkit (>=0.0.1.dev3,<0.1.0)", "lark (>=1.1.5,<2.0.0)", "lxml (>=4.9.2,<5.0.0)", "manifest-ml (>=0.0.1,<0.0.2)", "momento (>=1.5.0,<2.0.0)", "neo4j (>=5.8.1,<6.0.0)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "opensearch-py (>=2.0.0,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pexpect (>=4.8.0,<5.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "pinecone-text (>=0.4.2,<0.5.0)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pymongo (>=4.3.3,<5.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pytesseract (>=0.3.10,<0.4.0)", "pyvespa (>=0.33.0,<0.34.0)", "qdrant-client (>=1.1.2,<2.0.0)", "redis (>=4,<5)", "requests-toolbelt (>=1.0.0,<2.0.0)", "sentence-transformers (>=2,<3)", "spacy (>=3,<4)", "steamship (>=2.16.9,<3.0.0)", "tensorflow-text (>=2.11.0,<3.0.0)", "tigrisdb (>=1.0.0b6,<2.0.0)", "tiktoken (>=0.3.2,<0.4.0)", "torch (>=1,<3)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] -azure = ["azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-core (>=1.26.4,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "openai (>=0,<1)"] +all = ["O365 (>=2.0.26,<3.0.0)", "aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.3,<0.4)", "arxiv (>=1.4,<2.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "awadb (>=0.3.3,<0.4.0)", "azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "beautifulsoup4 (>=4,<5)", "clarifai (==9.1.0)", "clickhouse-connect (>=0.5.14,<0.6.0)", "cohere (>=3,<4)", "deeplake (>=3.6.2,<4.0.0)", "docarray[hnswlib] (>=0.32.0,<0.33.0)", "duckduckgo-search (>=3.8.3,<4.0.0)", "elasticsearch (>=8,<9)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-auth (>=2.18.1,<3.0.0)", "google-search-results (>=2,<3)", "gptcache (>=0.1.7)", "html2text (>=2020.1.16,<2021.0.0)", "huggingface_hub (>=0,<1)", "jina (>=3.14,<4.0)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lancedb (>=0.1,<0.2)", "langkit (>=0.0.1.dev3,<0.1.0)", "lark (>=1.1.5,<2.0.0)", "lxml (>=4.9.2,<5.0.0)", "manifest-ml (>=0.0.1,<0.0.2)", "marqo (>=0.9.1,<0.10.0)", "momento (>=1.5.0,<2.0.0)", "nebula3-python (>=3.4.0,<4.0.0)", "neo4j (>=5.8.1,<6.0.0)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "octoai-sdk (>=0.1.1,<0.2.0)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "opensearch-py (>=2.0.0,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pexpect (>=4.8.0,<5.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "pinecone-text (>=0.4.2,<0.5.0)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pymongo (>=4.3.3,<5.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pytesseract (>=0.3.10,<0.4.0)", "pyvespa (>=0.33.0,<0.34.0)", "qdrant-client (>=1.1.2,<2.0.0)", "rdflib (>=6.3.2,<7.0.0)", "redis (>=4,<5)", "requests-toolbelt (>=1.0.0,<2.0.0)", "sentence-transformers (>=2,<3)", "singlestoredb (>=0.7.1,<0.8.0)", "spacy (>=3,<4)", "steamship (>=2.16.9,<3.0.0)", "tensorflow-text (>=2.11.0,<3.0.0)", "tigrisdb (>=1.0.0b6,<2.0.0)", "tiktoken (>=0.3.2,<0.4.0)", "torch (>=1,<3)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] +azure = ["azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-core (>=1.26.4,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "azure-search-documents (==11.4.0a20230509004)", "openai (>=0,<1)"] +clarifai = ["clarifai (==9.1.0)"] cohere = ["cohere (>=3,<4)"] docarray = ["docarray[hnswlib] (>=0.32.0,<0.33.0)"] embeddings = ["sentence-transformers (>=2,<3)"] -extended-testing = ["atlassian-python-api (>=3.36.0,<4.0.0)", "beautifulsoup4 (>=4,<5)", "bibtexparser (>=1.4.0,<2.0.0)", "chardet (>=5.1.0,<6.0.0)", "gql (>=3.4.1,<4.0.0)", "html2text (>=2020.1.16,<2021.0.0)", "jq (>=1.4.1,<2.0.0)", "lxml (>=4.9.2,<5.0.0)", "pandas (>=2.0.1,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "psychicapi (>=0.5,<0.6)", "py-trello (>=0.19.0,<0.20.0)", "pymupdf (>=1.22.3,<2.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pypdfium2 (>=4.10.0,<5.0.0)", "pyspark (>=3.4.0,<4.0.0)", "requests-toolbelt (>=1.0.0,<2.0.0)", "scikit-learn (>=1.2.2,<2.0.0)", "telethon (>=1.28.5,<2.0.0)", "tqdm (>=4.48.0)", "zep-python (>=0.31)"] -llms = ["anthropic (>=0.2.6,<0.3.0)", "cohere (>=3,<4)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "torch (>=1,<3)", "transformers (>=4,<5)"] +extended-testing = ["atlassian-python-api (>=3.36.0,<4.0.0)", "beautifulsoup4 (>=4,<5)", "bibtexparser (>=1.4.0,<2.0.0)", "cassio (>=0.0.7,<0.0.8)", "chardet (>=5.1.0,<6.0.0)", "esprima (>=4.0.1,<5.0.0)", "gql (>=3.4.1,<4.0.0)", "html2text (>=2020.1.16,<2021.0.0)", "jq (>=1.4.1,<2.0.0)", "lxml (>=4.9.2,<5.0.0)", "openai (>=0,<1)", "pandas (>=2.0.1,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pgvector (>=0.1.6,<0.2.0)", "psychicapi (>=0.8.0,<0.9.0)", "py-trello (>=0.19.0,<0.20.0)", "pymupdf (>=1.22.3,<2.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pypdfium2 (>=4.10.0,<5.0.0)", "pyspark (>=3.4.0,<4.0.0)", "requests-toolbelt (>=1.0.0,<2.0.0)", "scikit-learn (>=1.2.2,<2.0.0)", "streamlit (>=1.18.0,<2.0.0)", "telethon (>=1.28.5,<2.0.0)", "tqdm (>=4.48.0)", "zep-python (>=0.32)"] +javascript = ["esprima (>=4.0.1,<5.0.0)"] +llms = ["anthropic (>=0.3,<0.4)", "clarifai (==9.1.0)", "cohere (>=3,<4)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "openllm (>=0.1.19)", "openlm (>=0.0.5,<0.0.6)", "torch (>=1,<3)", "transformers (>=4,<5)"] openai = ["openai (>=0,<1)", "tiktoken (>=0.3.2,<0.4.0)"] qdrant = ["qdrant-client (>=1.1.2,<2.0.0)"] text-helpers = ["chardet (>=5.1.0,<6.0.0)"] +[[package]] +name = "langchainplus-sdk" +version = "0.0.20" +description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." +optional = false +python-versions = ">=3.8.1,<4.0" +files = [ + {file = "langchainplus_sdk-0.0.20-py3-none-any.whl", hash = "sha256:07a869d476755803aa04c4986ce78d00c2fe4ff584c0eaa57d7570c9664188db"}, + {file = "langchainplus_sdk-0.0.20.tar.gz", hash = "sha256:3d300e2e3290f68cc9d842c059f9458deba60e776c9e790309688cad1bfbb219"}, +] + +[package.dependencies] +pydantic = ">=1,<2" +requests = ">=2,<3" +tenacity = ">=8.1.0,<9.0.0" + [[package]] name = "lazy-object-proxy" version = "1.9.0" @@ -3507,19 +3526,21 @@ statsmodels = ">=0.11" [[package]] name = "llama-index" -version = "0.6.20" +version = "0.7.2" description = "Interface between LLMs and your data" optional = false python-versions = "*" files = [ - {file = "llama_index-0.6.20-py3-none-any.whl", hash = "sha256:04a8bc7c785d64bb980e52a0382febb0c550143b5d6994df4c97dbc182f7a521"}, - {file = "llama_index-0.6.20.tar.gz", hash = "sha256:9e04ea07a5feda5bf465dfc0a381c3c59264707328dfedb6e95e815892aa89de"}, + {file = "llama_index-0.7.2-py3-none-any.whl", hash = "sha256:22da2712c53680c025c76cb0d1c0fe46ae82ee440025f37924e43e6b72eb2f4a"}, + {file = "llama_index-0.7.2.tar.gz", hash = "sha256:33f10f22337a80f81a7227531c533a52e972940b07e2979ef395b3923bbdd587"}, ] [package.dependencies] +beautifulsoup4 = "*" dataclasses-json = "*" fsspec = ">=2023.5.0" -langchain = ">=0.0.154" +langchain = ">=0.0.218" +nest-asyncio = "*" numpy = "*" openai = ">=0.26.4" pandas = "*" @@ -9707,4 +9728,4 @@ optimization = ["Riskfolio-Lib"] [metadata] lock-version = "2.0" python-versions = "^3.8.1,<3.11, !=3.9.7" -content-hash = "58b8a23e28572359e1a9c2623c1f6ff2f2c9cae369ee40c2748909e73f3862af" +content-hash = "13a3bdc087b09c648051f81e611fe9804c011b5dc565bce8f71b0fdce55449a6" diff --git a/pyproject.toml b/pyproject.toml index 12f45f1880f..6694e4d2f3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ openbb = 'terminal:main' [tool.poetry.dependencies] python = "^3.8.1,<3.11, !=3.9.7" -scipy = "^1.9.3" +scipy = "1.10.1" #Pinning on July 6 for pip issues iso8601 = "^0.1.14" FundamentalAnalysis = "^0.2.6" requests = "^2.25.1" @@ -116,8 +116,8 @@ pydantic = "^1.10.5" posthog = "^3.0.1" reportlab = "<4" #Pinning due to build error on MacOs arch = "^5.5.0" -llama-index = "^0.6.20" -langchain = "^0.0.191" +llama-index = "^0.7.2" +langchain = "^0.0.225" diff --git a/requirements-full.txt b/requirements-full.txt index 43a290b16dc..f04a7465d46 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -141,11 +141,12 @@ jupyterlab-widgets==3.0.5 ; python_full_version >= "3.8.1" and python_full_versi jupyterlab==3.5.3 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" kiwisolver==1.4.4 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" korean-lunar-calendar==0.3.1 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" -langchain==0.0.191 ; python_full_version >= "3.8.1" and python_version < "3.11" and python_full_version != "3.9.7" +langchain==0.0.225 ; python_full_version >= "3.8.1" and python_version < "3.11" and python_full_version != "3.9.7" +langchainplus-sdk==0.0.20 ; python_full_version >= "3.8.1" and python_version < "3.11" and python_full_version != "3.9.7" lazy-object-proxy==1.9.0 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" lightgbm==3.3.5 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" linearmodels==4.27 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" -llama-index==0.6.20 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" +llama-index==0.7.2 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" llvmlite==0.39.1 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" loguru==0.6.0 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" lunarcalendar==0.0.9 ; python_full_version >= "3.8.1" and python_version < "3.11" and python_full_version != "3.9.7" diff --git a/requirements.txt b/requirements.txt index bc2caeabfdd..12f5bc68018 100644 --- a/requirements.txt +++ b/requirements.txt @@ -105,9 +105,10 @@ jupyterlab-widgets==3.0.5 ; python_full_version >= "3.8.1" and python_full_versi jupyterlab==3.5.3 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" kiwisolver==1.4.4 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" korean-lunar-calendar==0.3.1 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" -langchain==0.0.191 ; python_full_version >= "3.8.1" and python_version < "3.11" and python_full_version != "3.9.7" +langchain==0.0.225 ; python_full_version >= "3.8.1" and python_version < "3.11" and python_full_version != "3.9.7" +langchainplus-sdk==0.0.20 ; python_full_version >= "3.8.1" and python_version < "3.11" and python_full_version != "3.9.7" linearmodels==4.27 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" -llama-index==0.6.20 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" +llama-index==0.7.2 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" loguru==0.6.0 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" lxml==4.9.2 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11" markupsafe==2.1.2 ; python_full_version >= "3.8.1" and python_full_version != "3.9.7" and python_version < "3.11"