Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
4.5 kB · 262 lines
Nix
at litex
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder, poetry-core, numpy, pyyaml, sqlalchemy, requests, async-timeout, aiohttp, numexpr, openapi-schema-pydantic, dataclasses-json, tqdm, tenacity, bash # optional dependencies, anthropic, cohere, openai, nlpcloud, huggingface-hub, manifest-ml, torch, transformers, qdrant-client, sentence-transformers, azure-identity, azure-cosmos, azure-core, elasticsearch, opensearch-py, google-search-results, faiss, spacy, nltk, beautifulsoup4, tiktoken, jinja2, pinecone-client, weaviate-client, redis, google-api-python-client, pypdf, networkx, psycopg2, boto3, pyowm, pytesseract, html2text, atlassian-python-api, duckduckgo-search, lark, jq, steamship, pdfminer-six, lxml, chardet, requests-toolbelt, neo4j, langchainplus-sdk # test dependencies, pytest-vcr, pytest-asyncio, pytest-mock, pytest-socket, pandas, toml, freezegun, responses, pexpect, pytestCheckHook, pythonRelaxDepsHook}:
buildPythonPackage rec { pname = "langchain"; version = "0.0.195"; format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchFromGitHub { owner = "hwchase17"; repo = "langchain"; rev = "refs/tags/v${version}"; hash = "sha256-PUBFAAqCAshUkASsGnFNQ5+Xh6416ISkMqJ0bYcx7WI="; };
postPatch = '' substituteInPlace langchain/utilities/bash.py \ --replace '"env", ["-i", "bash", ' '"${lib.getExe bash}", [' substituteInPlace tests/unit_tests/test_bash.py \ --replace "/bin/sh" "${bash}/bin/sh" '';
nativeBuildInputs = [ poetry-core pythonRelaxDepsHook ];
buildInputs = [ bash ];
propagatedBuildInputs = [ numpy pyyaml sqlalchemy requests aiohttp numexpr openapi-schema-pydantic dataclasses-json tqdm tenacity ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ] ++ passthru.optional-dependencies.all;
passthru.optional-dependencies = { llms = [ anthropic cohere openai nlpcloud huggingface-hub manifest-ml torch transformers ]; qdrant = [ qdrant-client ]; openai = [ openai ]; text_helpers = [ chardet ]; cohere = [ cohere ]; docarray = [ # docarray ]; embeddings = [ sentence-transformers ]; azure = [ azure-identity azure-cosmos openai azure-core ]; all = [ anthropic cohere openai nlpcloud huggingface-hub # jina manifest-ml elasticsearch opensearch-py google-search-results faiss sentence-transformers transformers spacy nltk # wikipedia beautifulsoup4 tiktoken torch jinja2 pinecone-client # pinecone-text weaviate-client redis google-api-python-client # wolframalpha qdrant-client # tensorflow-text pypdf networkx # nomic # aleph-alpha-client # deeplake # pgvector psycopg2 boto3 pyowm pytesseract html2text atlassian-python-api # gptcache duckduckgo-search # arxiv azure-identity # clickhouse-connect azure-cosmos # lancedb # langkit lark pexpect # pyvespa # O365 jq # docarray steamship pdfminer-six lxml requests-toolbelt neo4j # openlm # azure-ai-formrecognizer # azure-ai-vision # azure-cognitiveservices-speech langchainplus-sdk ]; };
pythonRelaxDeps = [ "langchainplus-sdk" ];
nativeCheckInputs = [ pytestCheckHook pytest-vcr pytest-mock pytest-socket pytest-asyncio pandas toml freezegun responses ];
pytestFlagsArray = [ # integration_tests have many network, db access and require `OPENAI_API_KEY`, etc. "tests/unit_tests" ];
disabledTests = [ # these tests have db access "test_table_info" "test_sql_database_run"
# these tests have network access "test_socket_disabled" ];
meta = with lib; { description = "Building applications with LLMs through composability"; homepage = "https://github.com/hwchase17/langchain"; changelog = "https://github.com/hwchase17/langchain/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ natsukium ]; };}