python3Packages.llm-tools-quickjs: init at 0.1

This commit is contained in:
Philip Taron 2025-05-29 13:42:18 -07:00
parent 2074fa159b
commit 7438a10a79
3 changed files with 55 additions and 1 deletions

View file

@ -0,0 +1,50 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
quickjs,
llm,
llm-tools-quickjs,
llm-echo,
pytestCheckHook,
writableTmpDirAsHomeHook,
}:
buildPythonPackage rec {
pname = "llm-tools-quickjs";
version = "0.1";
pyproject = true;
src = fetchFromGitHub {
owner = "simonw";
repo = "llm-tools-quickjs";
tag = version;
hash = "sha256-Si3VcHnRUj8Q/N8pRhltPOM6K64TX9DBH/u4WQxQJjQ=";
};
build-system = [
setuptools
llm
];
dependencies = [ quickjs ];
nativeCheckInputs = [
llm-echo
pytestCheckHook
writableTmpDirAsHomeHook
];
pythonImportsCheck = [ "llm_tools_quickjs" ];
passthru.tests = llm.mkPluginTest llm-tools-quickjs;
meta = {
description = "JavaScript execution as a tool for LLM";
homepage = "https://github.com/simonw/llm-tools-quickjs";
changelog = "https://github.com/simonw/llm-tools-quickjs/releases/tag/${version}/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ philiptaron ];
};
}

View file

@ -82,6 +82,7 @@ let
llm-sentence-transformers ? false,
llm-templates-fabric ? false,
llm-templates-github ? false,
llm-tools-quickjs ? false,
llm-venice ? false,
llm-video-frames ? false,
...
@ -162,7 +163,8 @@ let
patches = [ ./001-disable-install-uninstall-commands.patch ];
postPatch = ''
substituteInPlace llm/cli.py --replace-fail "@listOfPackagedPlugins@" "$(< ${listOfPackagedPlugins})"
substituteInPlace llm/cli.py \
--replace-fail "@listOfPackagedPlugins@" "$(< ${listOfPackagedPlugins})"
'';
dependencies = [

View file

@ -8334,6 +8334,8 @@ self: super: with self; {
llm-templates-github = callPackage ../development/python-modules/llm-templates-github { };
llm-tools-quickjs = callPackage ../development/python-modules/llm-tools-quickjs { };
llm-venice = callPackage ../development/python-modules/llm-venice { };
llm-video-frames = callPackage ../development/python-modules/llm-video-frames { };