From 56dd1fc71fc8d487610940b553135caa732995ae Mon Sep 17 00:00:00 2001 From: happysalada Date: Sat, 14 Sep 2024 17:59:47 -0400 Subject: [PATCH 1/2] gpt-researcher: init at 3.0.7 --- pkgs/by-name/gp/gpt-researcher/package.nix | 70 +++++++++++++++++++ .../python-modules/arxiv/default.nix | 51 ++++++++++++++ .../python-modules/htmldocx/default.nix | 41 +++++++++++ .../python-modules/permchain/default.nix | 37 ++++++++++ .../python-modules/tavily-python/default.nix | 44 ++++++++++++ pkgs/top-level/python-packages.nix | 8 +++ 6 files changed, 251 insertions(+) create mode 100644 pkgs/by-name/gp/gpt-researcher/package.nix create mode 100644 pkgs/development/python-modules/arxiv/default.nix create mode 100644 pkgs/development/python-modules/htmldocx/default.nix create mode 100644 pkgs/development/python-modules/permchain/default.nix create mode 100644 pkgs/development/python-modules/tavily-python/default.nix diff --git a/pkgs/by-name/gp/gpt-researcher/package.nix b/pkgs/by-name/gp/gpt-researcher/package.nix new file mode 100644 index 000000000000000..895356433952769 --- /dev/null +++ b/pkgs/by-name/gp/gpt-researcher/package.nix @@ -0,0 +1,70 @@ +{ + lib, + python3, + fetchFromGitHub, +}: + +python3.pkgs.buildPythonApplication rec { + pname = "gpt-researcher"; + version = "3.0.7"; + pyproject = true; + + src = fetchFromGitHub { + owner = "assafelovic"; + repo = "gpt-researcher"; + rev = "v${version}"; + hash = "sha256-XCSZrN8pmiNg14umqOAR0zRHvVdQAN/symeYIlDOB4c="; + }; + + build-system = [ + python3.pkgs.poetry-core + ]; + + dependencies = with python3.pkgs; [ + aiofiles + arxiv + beautifulsoup4 + colorama + duckduckgo-search + fastapi + htmldocx + jinja2 + langchain + langchain-community + langchain-openai + langgraph + lxml + markdown + md2pdf + mistune + openai + permchain + pydantic + pymupdf + python-docx + python-dotenv + python-multipart + pyyaml + requests + sqlalchemy + tavily-python + tiktoken + unstructured + uvicorn + ]; + + pythonImportsCheck = [ + "gpt_researcher" + ]; + + meta = { + description = "LLM based autonomous agent that does online comprehensive research on any given topic"; + homepage = "https://github.com/assafelovic/gpt-researcher"; + license = with lib.licenses; [ + asl20 + mit + ]; + maintainers = with lib.maintainers; [ happysalada ]; + mainProgram = "gpt-researcher"; + }; +} diff --git a/pkgs/development/python-modules/arxiv/default.nix b/pkgs/development/python-modules/arxiv/default.nix new file mode 100644 index 000000000000000..0a040594a467732 --- /dev/null +++ b/pkgs/development/python-modules/arxiv/default.nix @@ -0,0 +1,51 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + wheel, + feedparser, + pdoc, + pip-audit, + pytest, + requests, + ruff, +}: + +buildPythonPackage rec { + pname = "arxiv"; + version = "2.1.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "lukasschwab"; + repo = "arxiv.py"; + rev = version; + hash = "sha256-Niu3N0QTVxucboQx1FQq1757Hjj1VVWeDZn7O7YtjWY="; + }; + + build-system = [ + setuptools + wheel + ]; + + dependencies = [ + feedparser + pdoc + pip-audit + pytest + requests + ruff + ]; + + pythonImportsCheck = [ + "arxiv" + ]; + + meta = { + description = "Python wrapper for the arXiv API"; + homepage = "https://github.com/lukasschwab/arxiv.py"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ happysalada ]; + }; +} diff --git a/pkgs/development/python-modules/htmldocx/default.nix b/pkgs/development/python-modules/htmldocx/default.nix new file mode 100644 index 000000000000000..b2c59711acc8253 --- /dev/null +++ b/pkgs/development/python-modules/htmldocx/default.nix @@ -0,0 +1,41 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + wheel, + beautifulsoup4, + python-docx, +}: + +buildPythonPackage rec { + pname = "htmldocx"; + version = "0.0.6"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-tLzsiV+G16UP/HEzyiTYXCTzYU2ys30zow2dBGVKVIY="; + }; + + build-system = [ + setuptools + wheel + ]; + + dependencies = [ + beautifulsoup4 + python-docx + ]; + + pythonImportsCheck = [ + "htmldocx" + ]; + + meta = { + description = "Convert html to docx"; + homepage = "https://pypi.org/project/htmldocx"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/python-modules/permchain/default.nix b/pkgs/development/python-modules/permchain/default.nix new file mode 100644 index 000000000000000..ad6f22dbfcfc440 --- /dev/null +++ b/pkgs/development/python-modules/permchain/default.nix @@ -0,0 +1,37 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + poetry-core, + langchain, +}: + +buildPythonPackage rec { + pname = "permchain"; + version = "0.0.8"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-vp9tTa1v1oUP3E1xGM/KD2BpkoNgN2xRkb3Lei0ehMI="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + langchain + ]; + + pythonImportsCheck = [ + "permchain" + ]; + + meta = { + description = "Permchain"; + homepage = "https://pypi.org/project/permchain"; + license = with lib.licenses; [ elastic20 mit ]; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/python-modules/tavily-python/default.nix b/pkgs/development/python-modules/tavily-python/default.nix new file mode 100644 index 000000000000000..970e7f2b4b28367 --- /dev/null +++ b/pkgs/development/python-modules/tavily-python/default.nix @@ -0,0 +1,44 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + wheel, + httpx, + requests, + tiktoken, +}: + +buildPythonPackage rec { + pname = "tavily-python"; + version = "0.4.0"; + pyproject = true; + + src = fetchPypi { + pname = "tavily_python"; + inherit version; + hash = "sha256-5FFwQd0TXxcYWNfmWnyuCFWXhxu9waE9J5kKy1NuVcM="; + }; + + build-system = [ + setuptools + wheel + ]; + + dependencies = [ + httpx + requests + tiktoken + ]; + + pythonImportsCheck = [ + "tavily" + ]; + + meta = { + description = "Python wrapper for the Tavily API"; + homepage = "https://pypi.org/project/tavily-python"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ happysalada ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d53787ea328e906..698e0f47d583e47 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -810,6 +810,8 @@ self: super: with self; { arviz = callPackage ../development/python-modules/arviz { }; + arxiv = callPackage ../development/python-modules/arxiv { }; + arxiv2bib = callPackage ../development/python-modules/arxiv2bib { }; asana = callPackage ../development/python-modules/asana { }; @@ -5755,6 +5757,8 @@ self: super: with self; { htmldate = callPackage ../development/python-modules/htmldate { }; + htmldocx = callPackage ../development/python-modules/htmldocx { }; + htmllistparse = callPackage ../development/python-modules/htmllistparse { }; htmlmin = callPackage ../development/python-modules/htmlmin { }; @@ -9776,6 +9780,8 @@ self: super: with self; { periodiq = callPackage ../development/python-modules/periodiq { }; + permchain = callPackage ../development/python-modules/permchain { }; + permissionedforms = callPackage ../development/python-modules/permissionedforms { }; persim = callPackage ../development/python-modules/persim { }; @@ -15184,6 +15190,8 @@ self: super: with self; { tatsu = callPackage ../development/python-modules/tatsu { }; + tavily-python = callPackage ../development/python-modules/tavily-python { }; + taxi = callPackage ../development/python-modules/taxi { }; taxii2-client = callPackage ../development/python-modules/taxii2-client { }; From 18f45fb738dc29890bbe40fc43eeeca5fc10da96 Mon Sep 17 00:00:00 2001 From: happysalada Date: Sat, 14 Sep 2024 21:28:02 -0400 Subject: [PATCH 2/2] fix formatting --- pkgs/development/python-modules/permchain/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/permchain/default.nix b/pkgs/development/python-modules/permchain/default.nix index ad6f22dbfcfc440..1e959be1cf9754b 100644 --- a/pkgs/development/python-modules/permchain/default.nix +++ b/pkgs/development/python-modules/permchain/default.nix @@ -31,7 +31,10 @@ buildPythonPackage rec { meta = { description = "Permchain"; homepage = "https://pypi.org/project/permchain"; - license = with lib.licenses; [ elastic20 mit ]; - maintainers = with lib.maintainers; [ ]; + license = with lib.licenses; [ + elastic20 + mit + ]; + maintainers = with lib.maintainers; [ happysalada ]; }; }