depot/third_party/nixpkgs/pkgs/development/python-modules/langfuse/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

63 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
backoff,
httpx,
idna,
langchain,
llama-index,
openai,
packaging,
poetry-core,
pydantic,
pythonRelaxDepsHook,
wrapt,
}:
buildPythonPackage rec {
pname = "langfuse";
version = "2.36.1";
pyproject = true;
src = fetchFromGitHub {
owner = "langfuse";
repo = "langfuse-python";
rev = "refs/tags/v${version}";
hash = "sha256-qPSkATK+IRgtK43B9nr5rC3zZ7qm+/uBJrm7mVhZyUE=";
};
build-system = [ poetry-core ];
nativeBuildInputs = [ pythonRelaxDepsHook ];
pythonRelaxDeps = [ "packaging" ];
dependencies = [
backoff
httpx
idna
packaging
pydantic
wrapt
];
optional-dependencies = {
langchain = [ langchain ];
llama-index = [ llama-index ];
openai = [ openai ];
};
pythonImportsCheck = [ "langfuse" ];
# tests require network access and openai api key
doCheck = false;
meta = {
description = "Instrument your LLM app with decorators or low-level SDK and get detailed tracing/observability";
homepage = "https://github.com/langfuse/langfuse-python";
changelog = "https://github.com/langfuse/langfuse-python/releases/tag/${src.rev}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}