Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / servers / chatgpt-retrieval-plugin / default.nix
blob05f7216209cd0164d84dc5d87fa887e129082d6a
1 { lib
2 , python3Packages
3 , fetchFromGitHub
4 , python3
5 , nix-update-script
6 , dasel
7 }:
9 python3Packages.buildPythonApplication {
10   pname = "chatgpt-retrieval-plugin";
11   version = "unstable-2023-03-28";
12   format = "pyproject";
14   src = fetchFromGitHub {
15     owner = "openai";
16     repo = "chatgpt-retrieval-plugin";
17     rev = "958bb787bf34823538482a9eb3157c5bf994a182";
18     hash = "sha256-fCNGzK5Uji6wGDTEwAf4FF/i+RC7ny3v4AsvQwIbehY=";
19   };
21   postPatch = ''
22     substituteInPlace pyproject.toml \
23       --replace 'fastapi = "^0.92.0"' 'fastapi = ">=0.92.0"' \
24       --replace 'python-dotenv = "^0.21.1"' 'python-dotenv = "*"' \
25       --replace 'python-multipart = "^0.0.6"' 'python-multipart = "^0.0.5"' \
26       --replace 'redis = "4.5.1"' 'redis = "^4.5.1"' \
27       --replace 'tiktoken = "^0.2.0"' 'tiktoken = "^0.3.0"' \
28       --replace 'packages = [{include = "server"}]' 'packages = [{include = "server"}, {include = "models"}, {include = "datastore"}, {include = "services"}]'
30     substituteInPlace server/main.py \
31       --replace 'directory=".well-known"' 'directory="/var/lib/chatgpt-retrieval-plugin/.well-known"' \
32       --replace '0.0.0.0' '127.0.0.1' \
33       --replace '8000' '8080'
35     ${dasel}/bin/dasel put -t string -f pyproject.toml -v '.well-known/*' '.tool.poetry.include.[]'
36   '';
38   nativeBuildInputs = with python3Packages; [
39     poetry-core
40   ];
42   propagatedBuildInputs = with python3.pkgs; [
43     fastapi
44     arrow
45     tiktoken
46     python-multipart
47     python-dotenv
48     openai
49     weaviate-client
50     pinecone-client
51     pymilvus
52     uvicorn
53     python-pptx
54     tenacity
55     pypdf2
56     qdrant-client
57     redis
58     docx2txt
59   ];
61   passthru = {
62     updateScript = nix-update-script { };
63   };
65   meta = with lib; {
66     broken = true; # dependencies are not up to date, the project doesn't look well maintained, this doesn't look like it's going in the right direction. I'm happy to handle maintainership to whoever wants to.
67     homepage = "https://github.com/openai/chatgpt-retrieval-plugin";
68     description = "Tool to search and find personal or work documents by asking questions in everyday language";
69     license = licenses.mit;
70     maintainers = with maintainers; [ happysalada ];
71   };