1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
freezegun,
grandalf,
jsonpatch,
langsmith,
numpy,
packaging,
poetry-core,
pydantic,
pytest-asyncio,
pytest-mock,
pytest-xdist,
pytestCheckHook,
pythonOlder,
pyyaml,
syrupy,
tenacity,
writeScript,
}:
buildPythonPackage rec {
pname = "langchain-core";
version = "0.2.9";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-core==${version}";
hash = "sha256-/BUn/NxaE9l3VY6dPshr1JJaHTGzn9NMQhSQ2De65Jg=";
};
sourceRoot = "${src.name}/libs/core";
pythonRelaxDeps = [
"langsmith"
"packaging"
];
build-system = [ poetry-core ];
dependencies = [
jsonpatch
langsmith
packaging
pydantic
pyyaml
tenacity
];
pythonImportsCheck = [ "langchain_core" ];
nativeCheckInputs = [
freezegun
grandalf
numpy
pytest-asyncio
pytest-mock
pytest-xdist
pytestCheckHook
syrupy
];
pytestFlagsArray = [ "tests/unit_tests" ];
disabledTests = [
# Fail for an unclear reason with:
# AssertionError: assert '6a92363c-4ac...-d344769ab6ac' == '09af124a-2ed...-671c64c72b70'
"test_config_traceable_handoff"
"test_config_traceable_async_handoff"
];
passthru = {
updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-update
set -eu -o pipefail
nix-update --commit --version-regex 'langchain-core==(.*)' python3Packages.langchain-core
nix-update --commit --version-regex 'langchain-text-splitters==(.*)' python3Packages.langchain-text-splitters
nix-update --commit --version-regex 'langchain==(.*)' python3Packages.langchain
nix-update --commit --version-regex 'langchain-community==(.*)' python3Packages.langchain-community
'';
};
meta = {
description = "Building applications with LLMs through composability";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/core";
changelog = "https://github.com/langchain-ai/langchain/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}
|