2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
2024-06-05 15:53:02 +00:00
|
|
|
fetchFromGitHub,
|
2024-04-21 15:54:59 +00:00
|
|
|
poetry-core,
|
|
|
|
pythonOlder,
|
|
|
|
aiohttp,
|
|
|
|
dataclasses-json,
|
2024-06-05 15:53:02 +00:00
|
|
|
langchain,
|
2024-04-21 15:54:59 +00:00
|
|
|
langchain-core,
|
|
|
|
langsmith,
|
2024-07-27 06:49:29 +00:00
|
|
|
httpx,
|
2024-06-05 15:53:02 +00:00
|
|
|
lark,
|
2024-04-21 15:54:59 +00:00
|
|
|
numpy,
|
2024-06-05 15:53:02 +00:00
|
|
|
pandas,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytest-mock,
|
|
|
|
pytestCheckHook,
|
2024-04-21 15:54:59 +00:00
|
|
|
pyyaml,
|
|
|
|
requests,
|
2024-06-05 15:53:02 +00:00
|
|
|
requests-mock,
|
|
|
|
responses,
|
2024-04-21 15:54:59 +00:00
|
|
|
sqlalchemy,
|
2024-06-05 15:53:02 +00:00
|
|
|
syrupy,
|
2024-04-21 15:54:59 +00:00
|
|
|
tenacity,
|
2024-06-05 15:53:02 +00:00
|
|
|
toml,
|
2024-04-21 15:54:59 +00:00
|
|
|
typer,
|
2024-01-25 14:12:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "langchain-community";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.2.7";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "langchain-ai";
|
|
|
|
repo = "langchain";
|
2024-07-27 06:49:29 +00:00
|
|
|
rev = "refs/tags/langchain-community==${version}";
|
|
|
|
hash = "sha256-r0YSJkYPcwjHyw1xST5Zrgg9USjN9GOsvhV97imSFCQ=";
|
2024-01-25 14:12:00 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
sourceRoot = "${src.name}/libs/community";
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
preConfigure = ''
|
|
|
|
ln -s ${src}/libs/standard-tests/langchain_standard_tests ./langchain_standard_tests
|
|
|
|
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail "path = \"../standard-tests\"" "path = \"./langchain_standard_tests\""
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ poetry-core ];
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2024-01-25 14:12:00 +00:00
|
|
|
aiohttp
|
|
|
|
dataclasses-json
|
|
|
|
langchain-core
|
2024-06-05 15:53:02 +00:00
|
|
|
langchain
|
2024-01-25 14:12:00 +00:00
|
|
|
langsmith
|
|
|
|
numpy
|
|
|
|
pyyaml
|
|
|
|
requests
|
|
|
|
sqlalchemy
|
|
|
|
tenacity
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
optional-dependencies = {
|
2024-04-21 15:54:59 +00:00
|
|
|
cli = [ typer ];
|
2024-01-25 14:12:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "langchain_community" ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
2024-07-27 06:49:29 +00:00
|
|
|
httpx
|
2024-06-05 15:53:02 +00:00
|
|
|
lark
|
|
|
|
pandas
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
|
|
|
requests-mock
|
|
|
|
responses
|
|
|
|
syrupy
|
|
|
|
toml
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [ "tests/unit_tests" ];
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = langchain-core.updateScript;
|
|
|
|
};
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Test require network access
|
|
|
|
"test_ovhcloud_embed_documents"
|
2024-07-27 06:49:29 +00:00
|
|
|
# duckdb-engine needs python-wasmer which is not yet available in Python 3.12
|
|
|
|
# See https://github.com/NixOS/nixpkgs/pull/326337 and https://github.com/wasmerio/wasmer-python/issues/778
|
|
|
|
"test_table_info"
|
|
|
|
"test_sql_database_run"
|
2024-06-20 14:57:18 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
2024-07-27 06:49:29 +00:00
|
|
|
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-community==${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
description = "Community contributed LangChain integrations";
|
|
|
|
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/community";
|
2024-06-20 14:57:18 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ natsukium ];
|
2024-01-25 14:12:00 +00:00
|
|
|
};
|
|
|
|
}
|