about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/chatgpt-retrieval-plugin
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
committerAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
commit99fcaeccb89621dd492203ce1f2d551c06f228ed (patch)
tree41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/servers/chatgpt-retrieval-plugin
parent59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff)
parent75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff)
downloadnixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/config/console.nix
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/nixos/modules/services/networking/ssh/sshd.nix
	nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix
	nixpkgs/pkgs/applications/networking/irc/weechat/default.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/interpreters/python/default.nix
	nixpkgs/pkgs/development/node-packages/overrides.nix
	nixpkgs/pkgs/development/tools/b4/default.nix
	nixpkgs/pkgs/servers/dict/dictd-db.nix
	nixpkgs/pkgs/servers/mail/public-inbox/default.nix
	nixpkgs/pkgs/tools/security/pinentry/default.nix
	nixpkgs/pkgs/tools/text/unoconv/default.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/servers/chatgpt-retrieval-plugin')
-rw-r--r--nixpkgs/pkgs/servers/chatgpt-retrieval-plugin/default.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/chatgpt-retrieval-plugin/default.nix b/nixpkgs/pkgs/servers/chatgpt-retrieval-plugin/default.nix
new file mode 100644
index 000000000000..b7accc881e61
--- /dev/null
+++ b/nixpkgs/pkgs/servers/chatgpt-retrieval-plugin/default.nix
@@ -0,0 +1,71 @@
+{ lib
+, python3Packages
+, fetchFromGitHub
+, python3
+, nix-update-script
+, dasel
+}:
+
+python3Packages.buildPythonApplication {
+  pname = "chatgpt-retrieval-plugin";
+  version = "unstable-2023-03-28";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "openai";
+    repo = "chatgpt-retrieval-plugin";
+    rev = "958bb787bf34823538482a9eb3157c5bf994a182";
+    hash = "sha256-fCNGzK5Uji6wGDTEwAf4FF/i+RC7ny3v4AsvQwIbehY=";
+  };
+
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace 'fastapi = "^0.92.0"' 'fastapi = ">=0.92.0"' \
+      --replace 'python-dotenv = "^0.21.1"' 'python-dotenv = "*"' \
+      --replace 'python-multipart = "^0.0.6"' 'python-multipart = "^0.0.5"' \
+      --replace 'redis = "4.5.1"' 'redis = "^4.5.1"' \
+      --replace 'tiktoken = "^0.2.0"' 'tiktoken = "^0.3.0"' \
+      --replace 'packages = [{include = "server"}]' 'packages = [{include = "server"}, {include = "models"}, {include = "datastore"}, {include = "services"}]'
+
+    substituteInPlace server/main.py \
+      --replace 'directory=".well-known"' 'directory="/var/lib/chatgpt-retrieval-plugin/.well-known"' \
+      --replace '0.0.0.0' '127.0.0.1' \
+      --replace '8000' '8080'
+
+    ${dasel}/bin/dasel put -t string -f pyproject.toml -v '.well-known/*' '.tool.poetry.include.[]'
+  '';
+
+  nativeBuildInputs = with python3Packages; [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    fastapi
+    arrow
+    tiktoken
+    python-multipart
+    python-dotenv
+    openai
+    weaviate-client
+    pinecone-client
+    pymilvus
+    uvicorn
+    python-pptx
+    tenacity
+    pypdf2
+    qdrant-client
+    redis
+    docx2txt
+  ];
+
+  passthru = {
+    updateScript = nix-update-script { };
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/openai/chatgpt-retrieval-plugin";
+    description = "Tool to search and find personal or work documents by asking questions in everyday language";
+    license = licenses.mit;
+    maintainers = with maintainers; [ happysalada ];
+  };
+}