1{ lib 2, bash 3, buildPythonPackage 4, fetchFromGitHub 5, pythonOlder 6, pythonRelaxDepsHook 7, poetry-core 8, aiohttp 9, anyio 10, async-timeout 11, dataclasses-json 12, jsonpatch 13, langsmith 14, numpy 15, pydantic 16, pyyaml 17, requests 18, sqlalchemy 19, tenacity 20 # optional dependencies 21, atlassian-python-api 22, azure-core 23, azure-cosmos 24, azure-identity 25, beautifulsoup4 26, chardet 27, clarifai 28, cohere 29, duckduckgo-search 30, elasticsearch 31, esprima 32, faiss 33, google-api-python-client 34, google-auth 35, google-search-results 36, gptcache 37, html2text 38, huggingface-hub 39, jinja2 40, jq 41, lark 42, librosa 43, lxml 44, manifest-ml 45, neo4j 46, networkx 47, nlpcloud 48, nltk 49, openai 50, opensearch-py 51, pdfminer-six 52, pgvector 53, pinecone-client 54, psycopg2 55, pymongo 56, pyowm 57, pypdf 58, pytesseract 59, python-arango 60, qdrant-client 61, rdflib 62, redis 63, requests-toolbelt 64, sentence-transformers 65, tiktoken 66, torch 67, transformers 68, typer 69, weaviate-client 70, wikipedia 71 # test dependencies 72, freezegun 73, pandas 74, pexpect 75, pytest-asyncio 76, pytest-mock 77, pytest-socket 78, pytestCheckHook 79, requests-mock 80, responses 81, syrupy 82, toml 83}: 84 85buildPythonPackage rec { 86 pname = "langchain"; 87 version = "0.0.334"; 88 pyproject = true; 89 90 disabled = pythonOlder "3.8"; 91 92 src = fetchFromGitHub { 93 owner = "hwchase17"; 94 repo = "langchain"; 95 rev = "refs/tags/v${version}"; 96 hash = "sha256-mXPqc8wF9DhEtITm8h5R9kHBcMJ7AEK4kL5Z7V2p8NE="; 97 }; 98 99 sourceRoot = "${src.name}/libs/langchain"; 100 101 nativeBuildInputs = [ 102 poetry-core 103 pythonRelaxDepsHook 104 ]; 105 106 buildInputs = [ 107 bash 108 ]; 109 110 propagatedBuildInputs = [ 111 pydantic 112 sqlalchemy 113 requests 114 pyyaml 115 numpy 116 dataclasses-json 117 tenacity 118 aiohttp 119 langsmith 120 anyio 121 jsonpatch 122 ] ++ lib.optionals (pythonOlder "3.11") [ 123 async-timeout 124 ]; 125 126 passthru.optional-dependencies = { 127 llms = [ 128 clarifai 129 cohere 130 openai 131 # openlm 132 nlpcloud 133 huggingface-hub 134 manifest-ml 135 torch 136 transformers 137 ]; 138 qdrant = [ 139 qdrant-client 140 ]; 141 openai = [ 142 openai 143 tiktoken 144 ]; 145 text_helpers = [ 146 chardet 147 ]; 148 clarifai = [ 149 clarifai 150 ]; 151 cohere = [ 152 cohere 153 ]; 154 docarray = [ 155 # docarray 156 ]; 157 embeddings = [ 158 sentence-transformers 159 ]; 160 javascript = [ 161 esprima 162 ]; 163 azure = [ 164 azure-identity 165 azure-cosmos 166 openai 167 azure-core 168 # azure-ai-formrecognizer 169 # azure-ai-vision 170 # azure-cognitiveservices-speech 171 # azure-search-documents 172 ]; 173 all = [ 174 clarifai 175 cohere 176 openai 177 nlpcloud 178 huggingface-hub 179 manifest-ml 180 elasticsearch 181 opensearch-py 182 google-search-results 183 faiss 184 sentence-transformers 185 transformers 186 nltk 187 wikipedia 188 beautifulsoup4 189 tiktoken 190 torch 191 jinja2 192 pinecone-client 193 # pinecone-text 194 # marqo 195 pymongo 196 weaviate-client 197 redis 198 google-api-python-client 199 google-auth 200 # wolframalpha 201 qdrant-client 202 # tensorflow-text 203 pypdf 204 networkx 205 # nomic 206 # aleph-alpha-client 207 # deeplake 208 # libdeeplake 209 pgvector 210 psycopg2 211 pyowm 212 pytesseract 213 html2text 214 atlassian-python-api 215 gptcache 216 duckduckgo-search 217 # arxiv 218 azure-identity 219 # clickhouse-connect 220 azure-cosmos 221 # lancedb 222 # langkit 223 lark 224 pexpect 225 # pyvespa 226 # O365 227 jq 228 # docarray 229 pdfminer-six 230 lxml 231 requests-toolbelt 232 neo4j 233 # openlm 234 # azure-ai-formrecognizer 235 # azure-ai-vision 236 # azure-cognitiveservices-speech 237 # momento 238 # singlestoredb 239 # tigrisdb 240 # nebula3-python 241 # awadb 242 esprima 243 rdflib 244 # amadeus 245 librosa 246 python-arango 247 ]; 248 cli = [ 249 typer 250 ]; 251 }; 252 253 nativeCheckInputs = [ 254 freezegun 255 lark 256 pandas 257 pytest-asyncio 258 pytest-mock 259 pytest-socket 260 pytestCheckHook 261 requests-mock 262 responses 263 syrupy 264 toml 265 ]; 266 267 pytestFlagsArray = [ 268 # integration_tests have many network, db access and require `OPENAI_API_KEY`, etc. 269 "tests/unit_tests" 270 "--only-core" 271 ]; 272 273 disabledTests = [ 274 # these tests have db access 275 "test_table_info" 276 "test_sql_database_run" 277 278 # these tests have network access 279 "test_socket_disabled" 280 ]; 281 282 pythonImportsCheck = [ 283 "langchain" 284 ]; 285 286 meta = with lib; { 287 description = "Building applications with LLMs through composability"; 288 homepage = "https://github.com/hwchase17/langchain"; 289 changelog = "https://github.com/hwchase17/langchain/releases/tag/v${version}"; 290 license = licenses.mit; 291 maintainers = with maintainers; [ natsukium ]; 292 }; 293}