depot/third_party/nixpkgs/pkgs/development/python-modules/langgraph-sdk/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

64 lines
1.7 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
poetry-core,
# dependencies
httpx,
httpx-sse,
orjson,
# passthru
writeScript,
}:
buildPythonPackage rec {
pname = "langgraph-sdk";
version = "0.1.30";
pyproject = true;
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langgraph";
rev = "refs/tags/sdk==${version}";
hash = "sha256-gI12XuxFplqIKVlVjeO60YxT7WG/SSsZ0aWfjg5bHIs=";
};
sourceRoot = "${src.name}/libs/sdk-py";
build-system = [ poetry-core ];
dependencies = [
httpx
httpx-sse
orjson
];
pythonImportsCheck = [ "langgraph_sdk" ];
passthru = {
# python3Packages.langgraph-sdk depends on python3Packages.langgraph. langgraph-cli is independent of both.
updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-update
set -eu -o pipefail
nix-update --commit --version-regex '(.*)' python3Packages.langgraph
nix-update --commit --version-regex 'sdk==(.*)' python3Packages.langgraph-sdk
nix-update --commit --version-regex 'checkpoint==(.*)' python3Packages.langgraph-checkpoint
nix-update --commit --version-regex 'checkpointpostgres==(.*)' python3Packages.langgraph-checkpoint-postgres
nix-update --commit --version-regex 'checkpointsqlite==(.*)' python3Packages.langgraph-checkpoint-sqlite
'';
};
meta = {
description = "SDK for interacting with the LangGraph Cloud REST API";
homepage = "https://github.com/langchain-ai/langgraphtree/main/libs/sdk-py";
changelog = "https://github.com/langchain-ai/langgraph/releases/tag/sdk==${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ sarahec ];
};
}