1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8
9 # dependencies
10 langchain-core,
11
12 # tests
13 httpx,
14 pytest-asyncio,
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "langchain-text-splitters";
20 version = "0.3.2";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "langchain-ai";
25 repo = "langchain";
26 rev = "refs/tags/langchain-text-splitters==${version}";
27 hash = "sha256-TaK8lnPxKUqwvKLtQIfzg2l8McQ1fd0g9vocHM0+kjY=";
28 };
29
30 sourceRoot = "${src.name}/libs/text-splitters";
31
32 build-system = [ poetry-core ];
33
34 dependencies = [ langchain-core ];
35
36 pythonImportsCheck = [ "langchain_text_splitters" ];
37
38 nativeCheckInputs = [
39 httpx
40 pytest-asyncio
41 pytestCheckHook
42 ];
43
44 pytestFlagsArray = [ "tests/unit_tests" ];
45
46 passthru = {
47 inherit (langchain-core) updateScript;
48 };
49
50 meta = {
51 changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-text-splitters==${version}";
52 description = "LangChain utilities for splitting into chunks a wide variety of text documents";
53 homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/text-splitters";
54 license = lib.licenses.mit;
55 maintainers = with lib.maintainers; [
56 fab
57 sarahec
58 ];
59 };
60}