2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiohttp,
|
|
|
|
async-timeout,
|
|
|
|
bash,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
freezegun,
|
|
|
|
langchain-core,
|
|
|
|
langchain-text-splitters,
|
|
|
|
langsmith,
|
|
|
|
lark,
|
|
|
|
numpy,
|
|
|
|
pandas,
|
|
|
|
poetry-core,
|
|
|
|
pydantic,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytest-mock,
|
|
|
|
pytest-socket,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pyyaml,
|
|
|
|
requests-mock,
|
|
|
|
requests,
|
|
|
|
responses,
|
|
|
|
sqlalchemy,
|
|
|
|
syrupy,
|
|
|
|
tenacity,
|
|
|
|
toml,
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "langchain";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "0.2.5";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-01-25 14:12:00 +00:00
|
|
|
owner = "langchain-ai";
|
2023-05-24 13:37:59 +00:00
|
|
|
repo = "langchain";
|
2024-06-05 15:53:02 +00:00
|
|
|
rev = "refs/tags/langchain==${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-WaJRXvA/SImTSgAkk06vmOtTbsYYs8nTChFLzmsFz7Q=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
sourceRoot = "${src.name}/libs/langchain";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ poetry-core ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
buildInputs = [ bash ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2024-02-29 20:09:43 +00:00
|
|
|
aiohttp
|
|
|
|
langchain-core
|
2024-04-21 15:54:59 +00:00
|
|
|
langchain-text-splitters
|
2024-02-29 20:09:43 +00:00
|
|
|
langsmith
|
|
|
|
numpy
|
2023-08-10 07:59:29 +00:00
|
|
|
pydantic
|
|
|
|
pyyaml
|
2024-02-29 20:09:43 +00:00
|
|
|
requests
|
|
|
|
sqlalchemy
|
2024-01-25 14:12:00 +00:00
|
|
|
tenacity
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2023-08-10 07:59:29 +00:00
|
|
|
freezegun
|
2023-11-16 04:20:00 +00:00
|
|
|
lark
|
2023-08-10 07:59:29 +00:00
|
|
|
pandas
|
|
|
|
pytest-asyncio
|
2023-05-24 13:37:59 +00:00
|
|
|
pytest-mock
|
2023-07-15 17:15:38 +00:00
|
|
|
pytest-socket
|
2023-08-10 07:59:29 +00:00
|
|
|
pytestCheckHook
|
2023-11-16 04:20:00 +00:00
|
|
|
requests-mock
|
2023-08-10 07:59:29 +00:00
|
|
|
responses
|
2023-07-15 17:15:38 +00:00
|
|
|
syrupy
|
2023-05-24 13:37:59 +00:00
|
|
|
toml
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
pytestFlagsArray = [
|
2024-04-21 15:54:59 +00:00
|
|
|
# integration_tests require network access, database access and require `OPENAI_API_KEY`, etc.
|
2023-05-24 13:37:59 +00:00
|
|
|
"tests/unit_tests"
|
2023-11-16 04:20:00 +00:00
|
|
|
"--only-core"
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2024-04-21 15:54:59 +00:00
|
|
|
# These tests have database access
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_table_info"
|
|
|
|
"test_sql_database_run"
|
2024-04-21 15:54:59 +00:00
|
|
|
# These tests have network access
|
2023-07-15 17:15:38 +00:00
|
|
|
"test_socket_disabled"
|
2024-04-21 15:54:59 +00:00
|
|
|
"test_openai_agent_with_streaming"
|
|
|
|
"test_openai_agent_tools_agent"
|
|
|
|
# This test may require a specific version of langchain-community
|
2024-01-25 14:12:00 +00:00
|
|
|
"test_compatible_vectorstore_documentation"
|
2024-04-21 15:54:59 +00:00
|
|
|
# AssertionErrors
|
|
|
|
"test_callback_handlers"
|
|
|
|
"test_generic_fake_chat_model"
|
2024-05-15 15:35:15 +00:00
|
|
|
# Test is outdated
|
|
|
|
"test_serializable_mapping"
|
|
|
|
"test_person"
|
|
|
|
"test_aliases_hidden"
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "langchain" ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = langchain-core.updateScript;
|
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
meta = {
|
2023-05-24 13:37:59 +00:00
|
|
|
description = "Building applications with LLMs through composability";
|
2024-01-25 14:12:00 +00:00
|
|
|
homepage = "https://github.com/langchain-ai/langchain";
|
|
|
|
changelog = "https://github.com/langchain-ai/langchain/releases/tag/v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ natsukium ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "langchain-server";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
}
|