2024-08-16 22:53:06 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2025-03-15 11:04:06 -07:00
|
|
|
nix-update-script,
|
2024-09-15 13:37:01 +02:00
|
|
|
|
|
|
|
# build-system
|
|
|
|
poetry-core,
|
|
|
|
|
|
|
|
# dependencies
|
2024-08-16 22:53:06 +02:00
|
|
|
boto3,
|
|
|
|
langchain-core,
|
|
|
|
numpy,
|
2025-01-22 13:05:37 +09:00
|
|
|
pydantic,
|
2024-09-15 13:37:01 +02:00
|
|
|
|
|
|
|
# tests
|
2025-01-22 19:42:31 +09:00
|
|
|
langchain-tests,
|
2024-09-15 13:37:01 +02:00
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
2024-08-16 22:53:06 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "langchain-aws";
|
2025-05-01 16:09:26 -07:00
|
|
|
version = "0.2.22";
|
2024-08-16 22:53:06 +02:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "langchain-ai";
|
|
|
|
repo = "langchain-aws";
|
2025-05-01 16:09:26 -07:00
|
|
|
tag = "langchain-aws==${version}";
|
2025-01-22 13:05:37 +09:00
|
|
|
hash = "sha256-tEkwa+rpitGxstci754JH5HCqD7+WX0No6ielJJnbxk=";
|
2024-08-16 22:53:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail "--snapshot-warn-unused" "" \
|
|
|
|
--replace-fail "--cov=langchain_aws" ""
|
2025-01-22 13:05:37 +09:00
|
|
|
substituteInPlace tests/unit_tests/{test_standard.py,chat_models/test_bedrock_converse.py} \
|
|
|
|
--replace-fail "langchain_standard_tests" "langchain_tests"
|
2024-08-16 22:53:06 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
sourceRoot = "${src.name}/libs/aws";
|
|
|
|
|
|
|
|
build-system = [ poetry-core ];
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
boto3
|
|
|
|
langchain-core
|
|
|
|
numpy
|
2025-01-22 13:05:37 +09:00
|
|
|
pydantic
|
2024-08-16 22:53:06 +02:00
|
|
|
];
|
|
|
|
|
2024-10-27 11:00:54 -07:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
# Boto @ 1.35 has outstripped the version requirement
|
|
|
|
"boto3"
|
2025-03-18 14:21:33 -07:00
|
|
|
# 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-10-27 11:00:54 -07:00
|
|
|
];
|
|
|
|
|
2024-08-16 22:53:06 +02:00
|
|
|
nativeCheckInputs = [
|
2025-01-22 19:42:31 +09:00
|
|
|
langchain-tests
|
2024-08-16 22:53:06 +02:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [ "tests/unit_tests" ];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "langchain_aws" ];
|
|
|
|
|
2025-03-15 11:04:06 -07:00
|
|
|
passthru.updateScript = nix-update-script {
|
|
|
|
extraArgs = [
|
|
|
|
"--version-regex"
|
2025-05-01 16:09:26 -07:00
|
|
|
"langchain-aws==([0-9.]+)"
|
2025-03-15 11:04:06 -07:00
|
|
|
];
|
2024-09-15 10:35:02 -07:00
|
|
|
};
|
|
|
|
|
2024-08-16 22:53:06 +02:00
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/langchain-ai/langchain-aws/releases/tag/v${version}";
|
|
|
|
description = "Build LangChain application on AWS";
|
|
|
|
homepage = "https://github.com/langchain-ai/langchain-aws/";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
drupol
|
|
|
|
natsukium
|
2025-02-06 10:55:24 -08:00
|
|
|
sarahec
|
2024-08-16 22:53:06 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|