2024-05-16 10:12:14 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
2024-05-24 02:24:26 +00:00
|
|
|
fetchFromGitHub,
|
2025-03-15 11:04:06 -07:00
|
|
|
nix-update-script,
|
2024-09-06 12:03:30 +02:00
|
|
|
|
|
|
|
# build-system
|
2025-02-15 01:59:37 +00:00
|
|
|
pdm-backend,
|
2024-09-06 12:03:30 +02:00
|
|
|
|
|
|
|
# dependencies
|
2024-05-16 10:12:14 +02:00
|
|
|
langchain-core,
|
2024-09-06 12:03:30 +02:00
|
|
|
|
|
|
|
# tests
|
2024-09-15 00:10:57 +02:00
|
|
|
httpx,
|
2024-05-24 02:24:26 +00:00
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
2024-03-04 09:35:52 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "langchain-text-splitters";
|
2025-05-08 12:03:58 -07:00
|
|
|
version = "0.3.8";
|
2024-03-04 09:35:52 +01:00
|
|
|
pyproject = true;
|
|
|
|
|
2024-05-24 02:24:26 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "langchain-ai";
|
|
|
|
repo = "langchain";
|
2025-01-03 21:24:13 +01:00
|
|
|
tag = "langchain-text-splitters==${version}";
|
2025-05-08 12:03:58 -07:00
|
|
|
hash = "sha256-Ia3ZZ94uLZUVr1/w4HLPZLM6u8leA4OJtAwUf7eSAE0=";
|
2024-03-04 09:35:52 +01:00
|
|
|
};
|
|
|
|
|
2024-05-24 02:24:26 +00:00
|
|
|
sourceRoot = "${src.name}/libs/text-splitters";
|
2024-03-04 09:35:52 +01:00
|
|
|
|
2025-02-15 01:59:37 +00:00
|
|
|
build-system = [ pdm-backend ];
|
2024-03-04 09:35:52 +01:00
|
|
|
|
2025-03-18 14:21:33 -07:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
# Each component release requests the exact latest core.
|
|
|
|
# That prevents us from updating individul components.
|
|
|
|
"langchain-core"
|
|
|
|
];
|
|
|
|
|
2024-11-01 14:05:28 -07:00
|
|
|
dependencies = [ langchain-core ];
|
2024-03-04 09:35:52 +01:00
|
|
|
|
2024-05-16 10:12:14 +02:00
|
|
|
pythonImportsCheck = [ "langchain_text_splitters" ];
|
2024-03-04 09:35:52 +01:00
|
|
|
|
2024-05-24 02:24:26 +00:00
|
|
|
nativeCheckInputs = [
|
2024-09-15 00:10:57 +02:00
|
|
|
httpx
|
2024-05-24 02:24:26 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [ "tests/unit_tests" ];
|
|
|
|
|
2025-03-15 11:04:06 -07:00
|
|
|
passthru.updateScript = nix-update-script {
|
|
|
|
extraArgs = [
|
|
|
|
"--version-regex"
|
|
|
|
"^langchain-test-splitters==([0-9.]+)$"
|
|
|
|
];
|
2024-05-24 10:29:56 +09:00
|
|
|
};
|
|
|
|
|
2024-06-10 15:59:51 +02:00
|
|
|
meta = {
|
2024-07-18 23:27:30 +02:00
|
|
|
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-text-splitters==${version}";
|
|
|
|
description = "LangChain utilities for splitting into chunks a wide variety of text documents";
|
2024-03-04 09:35:52 +01:00
|
|
|
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/text-splitters";
|
2024-06-10 15:59:51 +02:00
|
|
|
license = lib.licenses.mit;
|
2024-11-01 14:05:28 -07:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
fab
|
|
|
|
sarahec
|
|
|
|
];
|
2024-03-04 09:35:52 +01:00
|
|
|
};
|
|
|
|
}
|