From 8a4ebcf26203dc68b45ae1f466d7ede41602a375 Mon Sep 17 00:00:00 2001 From: natsukium Date: Mon, 7 Aug 2023 22:50:53 +0900 Subject: [PATCH] python310Packages.langchain: clean up dependencies --- .../python-modules/langchain/default.nix | 171 ++++++++++-------- 1 file changed, 100 insertions(+), 71 deletions(-) diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix index db707d5c40f2..0a2f4ecf46ef 100644 --- a/pkgs/development/python-modules/langchain/default.nix +++ b/pkgs/development/python-modules/langchain/default.nix @@ -1,81 +1,86 @@ { lib +, bash , buildPythonPackage , fetchFromGitHub , pythonOlder +, pythonRelaxDepsHook , poetry-core -, numpy -, pyyaml -, sqlalchemy -, requests -, async-timeout , aiohttp -, numexpr -, openapi-schema-pydantic +, async-timeout , dataclasses-json -, tqdm +, langsmith +, numexpr +, numpy +, openapi-schema-pydantic +, pydantic +, pyyaml +, requests +, sqlalchemy , tenacity -, bash # optional dependencies , anthropic +, atlassian-python-api +, azure-core +, azure-cosmos +, azure-identity +, beautifulsoup4 +, chardet , clarifai , cohere -, openai -, nlpcloud +, duckduckgo-search +, elasticsearch +, esprima +, faiss +, google-api-python-client +, google-auth +, google-search-results +, gptcache +, html2text , huggingface-hub +, jinja2 +, jq +, lark +, librosa +, lxml , manifest-ml +, neo4j +, networkx +, nlpcloud +, nltk +, openai +, opensearch-py +, pdfminer-six +, pgvector +, pinecone-client +, psycopg2 +, pyowm +, pypdf +, pytesseract +, python-arango +, qdrant-client +, rdflib +, redis +, requests-toolbelt +, sentence-transformers +, spacy +, steamship +, tiktoken , torch , transformers -, qdrant-client -, sentence-transformers -, azure-identity -, azure-cosmos -, azure-core -, elasticsearch -, opensearch-py -, google-search-results -, faiss -, spacy -, nltk -, wikipedia -, beautifulsoup4 -, tiktoken -, jinja2 -, pinecone-client , weaviate-client -, redis -, google-api-python-client -, pypdf -, networkx -, pgvector -, psycopg2 -, boto3 -, pyowm -, pytesseract -, html2text -, atlassian-python-api -, duckduckgo-search -, lark -, jq -, steamship -, pdfminer-six -, lxml -, chardet -, requests-toolbelt -, neo4j -, langsmith +, wikipedia # test dependencies -, pytest-vcr +, freezegun +, pandas +, pexpect , pytest-asyncio , pytest-mock , pytest-socket -, pandas +, pytest-vcr +, pytestCheckHook +, responses , syrupy , toml -, freezegun -, responses -, pexpect -, pytestCheckHook -, pythonRelaxDepsHook }: buildPythonPackage rec { @@ -111,19 +116,20 @@ buildPythonPackage rec { ]; propagatedBuildInputs = [ - numpy - pyyaml + pydantic sqlalchemy requests - aiohttp - numexpr + pyyaml + numpy openapi-schema-pydantic dataclasses-json - tqdm tenacity + aiohttp + numexpr + langsmith ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout - ] ++ passthru.optional-dependencies.all; + ]; passthru.optional-dependencies = { llms = [ @@ -131,17 +137,21 @@ buildPythonPackage rec { clarifai cohere openai + # openllm + # openlm nlpcloud huggingface-hub manifest-ml torch transformers + # xinference ]; qdrant = [ qdrant-client ]; openai = [ openai + tiktoken ]; text_helpers = [ chardet @@ -158,11 +168,18 @@ buildPythonPackage rec { embeddings = [ sentence-transformers ]; + javascript = [ + esprima + ]; azure = [ azure-identity azure-cosmos openai azure-core + # azure-ai-formrecognizer + # azure-ai-vision + # azure-cognitiveservices-speech + # azure-search-documents ]; all = [ anthropic @@ -191,6 +208,7 @@ buildPythonPackage rec { weaviate-client redis google-api-python-client + google-auth # wolframalpha qdrant-client # tensorflow-text @@ -199,14 +217,14 @@ buildPythonPackage rec { # nomic # aleph-alpha-client # deeplake + # libdeeplake pgvector psycopg2 - boto3 pyowm pytesseract html2text atlassian-python-api - # gptcache + gptcache duckduckgo-search # arxiv azure-identity @@ -229,22 +247,33 @@ buildPythonPackage rec { # azure-ai-formrecognizer # azure-ai-vision # azure-cognitiveservices-speech - langsmith + # momento + # singlestoredb + # tigrisdb + # nebula3-python + # awadb + # esprima + # octoai-sdk + rdflib + # amadeus + # xinference + librosa + python-arango ]; }; nativeCheckInputs = [ - pytestCheckHook - pytest-vcr + freezegun + pandas + pytest-asyncio pytest-mock pytest-socket - pytest-asyncio - pandas + pytest-vcr + pytestCheckHook + responses syrupy toml - freezegun - responses - ]; + ] ++ passthru.optional-dependencies.all; pytestFlagsArray = [ # integration_tests have many network, db access and require `OPENAI_API_KEY`, etc.