2024-09-19 14:13:22 -07:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
|
|
|
# build-system
|
2025-03-30 16:31:31 -07:00
|
|
|
pdm-backend,
|
2024-09-19 14:13:22 -07:00
|
|
|
|
|
|
|
# dependencies
|
|
|
|
langchain-core,
|
|
|
|
ollama,
|
|
|
|
|
|
|
|
# testing
|
2025-01-22 19:42:31 +09:00
|
|
|
langchain-tests,
|
2024-09-19 14:13:22 -07:00
|
|
|
pytestCheckHook,
|
|
|
|
pytest-asyncio,
|
|
|
|
syrupy,
|
|
|
|
|
2025-05-08 12:14:04 -07:00
|
|
|
# passthru
|
2024-09-19 14:13:22 -07:00
|
|
|
nix-update-script,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "langchain-ollama";
|
2025-05-22 10:49:16 +00:00
|
|
|
version = "0.3.3";
|
2024-09-19 14:13:22 -07:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "langchain-ai";
|
|
|
|
repo = "langchain";
|
2025-01-03 21:24:13 +01:00
|
|
|
tag = "langchain-ollama==${version}";
|
2025-05-22 10:49:16 +00:00
|
|
|
hash = "sha256-YxcxVyiPEZPvO4NyeDp8nTVfbxlOCLClWCmAlL5PPi0=";
|
2024-09-19 14:13:22 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "${src.name}/libs/partners/ollama";
|
|
|
|
|
2025-03-30 16:31:31 -07:00
|
|
|
build-system = [
|
|
|
|
pdm-backend
|
|
|
|
];
|
2024-09-19 14:13:22 -07:00
|
|
|
|
2025-03-18 14:21:33 -07:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
# Each component release requests the exact latest core.
|
2025-06-02 15:54:57 +02:00
|
|
|
# That prevents us from updating individual components.
|
2025-03-18 14:21:33 -07:00
|
|
|
"langchain-core"
|
|
|
|
];
|
|
|
|
|
2024-09-19 14:13:22 -07:00
|
|
|
dependencies = [
|
|
|
|
langchain-core
|
|
|
|
ollama
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2025-01-22 19:42:31 +09:00
|
|
|
langchain-tests
|
2024-09-19 14:13:22 -07:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-asyncio
|
|
|
|
syrupy
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [ "tests/unit_tests" ];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "langchain_ollama" ];
|
|
|
|
|
|
|
|
passthru.updateScript = nix-update-script {
|
|
|
|
extraArgs = [
|
|
|
|
"--version-regex"
|
2025-05-08 12:14:04 -07:00
|
|
|
"langchain-ollama==([0-9.]+)"
|
2024-09-19 14:13:22 -07:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-ollama==${version}";
|
|
|
|
description = "Integration package connecting Ollama and LangChain";
|
|
|
|
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/ollama";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ sarahec ];
|
|
|
|
};
|
|
|
|
}
|