1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 pdm-backend,
8
9 # dependencies
10 langchain-core,
11 langchain-openai,
12
13 # testing
14 langchain-tests,
15 pytestCheckHook,
16 pytest-asyncio,
17 syrupy,
18
19 # passthru
20 gitUpdater,
21}:
22
23buildPythonPackage rec {
24 pname = "langchain-deepseek";
25 version = "0.1.4";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "langchain-ai";
30 repo = "langchain";
31 tag = "langchain-deepseek==${version}";
32 hash = "sha256-lIlThVpyZF5osiCyYMO8kQUNtG5eUjXGZLdgRraj4Yc=";
33 };
34
35 sourceRoot = "${src.name}/libs/partners/deepseek";
36
37 build-system = [
38 pdm-backend
39 ];
40
41 pythonRelaxDeps = [
42 # Each component release requests the exact latest core.
43 # That prevents us from updating individual components.
44 "langchain-core"
45 ];
46
47 dependencies = [
48 langchain-core
49 langchain-openai
50 ];
51
52 nativeCheckInputs = [
53 langchain-tests
54 pytestCheckHook
55 pytest-asyncio
56 syrupy
57 ];
58
59 enabledTestPaths = [ "tests/unit_tests" ];
60
61 pythonImportsCheck = [ "langchain_deepseek" ];
62
63 passthru = {
64 # python updater script sets the wrong tag
65 skipBulkUpdate = true;
66 updateScript = gitUpdater {
67 rev-prefix = "langchain-deepseek==";
68 };
69 };
70
71 meta = {
72 changelog = "https://github.com/langchain-ai/langchain/releases/tag/${src.tag}";
73 description = "Integration package connecting DeepSeek and LangChain";
74 homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/deepseek";
75 license = lib.licenses.mit;
76 maintainers = with lib.maintainers; [ sarahec ];
77 };
78}