chatgpt-retrieval-plugin: init at unstable-2023-03-28

This commit is contained in:
happysalada 2023-03-30 18:54:30 -04:00 committed by Yt
parent e58b3b8ce5
commit 8b5ca66432
11 changed files with 725 additions and 0 deletions

View File

@ -0,0 +1,26 @@
{ lib, buildPythonPackage, fetchPypi, pycryptodomex, filelock, urllib3, lxml }:
buildPythonPackage rec {
pname = "blobfile";
version = "2.0.1";
format = "wheel";
src = fetchPypi {
inherit pname version;
format = "wheel";
python = "py3";
dist = "py3";
hash = "sha256-b1Gz6UjzCpLnNKl0sk/ND2pRhB/Qg96WiJkjFIE1jaI=";
};
propagatedBuildInputs = [ pycryptodomex filelock urllib3 lxml ];
doCheck = false;
meta = with lib; {
homepage = "https://github.com/christopher-hesse/blobfile";
description = "Read Google Cloud Storage, Azure Blobs, and local paths with the same interface ";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
};
}

View File

@ -0,0 +1,43 @@
{ lib
, buildPythonPackage
, fetchPypi
, numpy
, pyyaml
, python-dateutil
, urllib3
, tqdm
, dnspython
, requests
, typing-extensions
, loguru
}:
buildPythonPackage rec {
pname = "pinecone-client";
version = "2.2.1";
src = fetchPypi {
inherit pname version;
hash = "sha256-CHjcruRHxGyNGz1xyFRonap+VI5QCaFxeAkHx9TnR4k=";
};
propagatedBuildInputs = [
numpy
pyyaml
python-dateutil
urllib3
tqdm
dnspython
requests
typing-extensions
loguru
];
doCheck = false;
meta = with lib; {
homepage = "https://www.pinecone.io/";
description = "The Pinecone python client";
license = licenses.mit;
maintainers = with maintainers; [happysalada];
};
}

View File

@ -0,0 +1,46 @@
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, grpcio-tools
, ujson
, grpcio
, pandas
, mmh3
, setuptools-scm
}:
buildPythonPackage rec {
pname = "pymilvus";
version = "2.2.4";
src = fetchPypi {
inherit pname version;
hash = "sha256-gj+psVoS6vcM4bNWzpwvKJJETTeCmZe6RwlzDkcvWo8=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "grpcio-tools>=1.47.0, <=1.48.0" "grpcio-tools>=1.47.0, <=1.52.0" \
--replace "grpcio>=1.47.0,<=1.48.0" "grpcio>=1.47.0,<=1.53.0" \
--replace "ujson>=2.0.0,<=5.4.0" "ujson>=2.0.0,<=5.7.0"
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
propagatedBuildInputs = [
grpcio
grpcio-tools
ujson
pandas
mmh3
] ++ lib.optionals stdenv.isLinux [ setuptools-scm ];
doCheck = false;
meta = with lib; {
homepage = "https://github.com/milvus-io/pymilvus";
description = "Python SDK for Milvus. ";
license = licenses.mit;
maintainers = with maintainers; [happysalada];
};
}

View File

@ -0,0 +1,38 @@
{ lib
, buildPythonPackage
, fetchPypi
, lxml
, xlsxwriter
, pillow
}:
buildPythonPackage rec {
pname = "python-pptx";
version = "0.6.21";
src = fetchPypi {
inherit pname version;
hash = "sha256-d5iiqviVY1ZbPHEgwKz+mv93XbDbNYBUTjv0hAwuN48=";
};
# postPatch = ''
# substituteInPlace setup.py \
# --replace "grpcio-tools>=1.47.0, <=1.48.0" "grpcio-tools>=1.47.0, <=1.52.0" \
# --replace "grpcio>=1.47.0,<=1.48.0" "grpcio>=1.47.0,<=1.53.0" \
# --replace "ujson>=2.0.0,<=5.4.0" "ujson>=2.0.0,<=5.7.0"
# '';
propagatedBuildInputs = [
lxml
xlsxwriter
pillow
];
doCheck = false;
meta = with lib; {
homepage = "https://github.com/scanny/python-pptx";
description = "Create Open XML PowerPoint documents in Python";
license = licenses.mit;
maintainers = with maintainers; [happysalada];
};
}

View File

@ -0,0 +1,35 @@
{ lib, buildPythonPackage, fetchPypi, python3Packages, numpy, httpx, grpcio, typing-extensions, grpcio-tools, pydantic, urllib3, h2 }:
buildPythonPackage rec {
pname = "qdrant-client";
version = "1.1.0";
src = fetchPypi {
pname = "qdrant_client";
inherit version;
hash = "sha256-tiWPQXjYkUM77rgKYbQG4jdi9c/I2WTMq5y+9zLax/0=";
};
format = "pyproject";
nativeBuildInputs = with python3Packages; [
poetry-core
];
# postPatch = ''
# substituteInPlace setup.cfg \
# --replace "validators>=0.18.2,<0.20.0" "validators>=0.18.2,<0.21.0"
# '';
propagatedBuildInputs = [ numpy httpx grpcio typing-extensions grpcio-tools pydantic urllib3 h2 ];
doCheck = false;
meta = with lib; {
homepage = "https://github.com/qdrant/qdrant-client";
description = "Python client for Qdrant vector search engine";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
};
}

View File

@ -0,0 +1,373 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aho-corasick"
version = "0.7.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
dependencies = [
"memchr",
]
[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "bit-set"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
dependencies = [
"bit-vec",
]
[[package]]
name = "bit-vec"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bstr"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09"
dependencies = [
"memchr",
"once_cell",
"regex-automata",
"serde",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "fancy-regex"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0678ab2d46fa5195aaf59ad034c083d351377d4af57f3e073c074d0da3e3c766"
dependencies = [
"bit-set",
"regex",
]
[[package]]
name = "indoc"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306"
[[package]]
name = "libc"
version = "0.2.140"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
[[package]]
name = "lock_api"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
dependencies = [
"autocfg",
"scopeguard",
]
[[package]]
name = "memchr"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "memoffset"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "parking_lot"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
version = "0.9.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
"windows-sys",
]
[[package]]
name = "proc-macro2"
version = "1.0.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534"
dependencies = [
"unicode-ident",
]
[[package]]
name = "pyo3"
version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "268be0c73583c183f2b14052337465768c07726936a260f480f0857cb95ba543"
dependencies = [
"cfg-if",
"indoc",
"libc",
"memoffset",
"parking_lot",
"pyo3-build-config",
"pyo3-ffi",
"pyo3-macros",
"unindent",
]
[[package]]
name = "pyo3-build-config"
version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28fcd1e73f06ec85bf3280c48c67e731d8290ad3d730f8be9dc07946923005c8"
dependencies = [
"once_cell",
"target-lexicon",
]
[[package]]
name = "pyo3-ffi"
version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f6cb136e222e49115b3c51c32792886defbfb0adead26a688142b346a0b9ffc"
dependencies = [
"libc",
"pyo3-build-config",
]
[[package]]
name = "pyo3-macros"
version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94144a1266e236b1c932682136dc35a9dee8d3589728f68130c7c3861ef96b28"
dependencies = [
"proc-macro2",
"pyo3-macros-backend",
"quote",
"syn",
]
[[package]]
name = "pyo3-macros-backend"
version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8df9be978a2d2f0cdebabb03206ed73b11314701a5bfe71b0d753b81997777f"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "quote"
version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "redox_syscall"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
"bitflags",
]
[[package]]
name = "regex"
version = "1.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
[[package]]
name = "regex-syntax"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "scopeguard"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "serde"
version = "1.0.159"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065"
[[package]]
name = "smallvec"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]]
name = "syn"
version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "target-lexicon"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5"
[[package]]
name = "tiktoken"
version = "0.3.3"
dependencies = [
"bstr",
"fancy-regex",
"pyo3",
"regex",
"rustc-hash",
]
[[package]]
name = "unicode-ident"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
[[package]]
name = "unindent"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c"
[[package]]
name = "windows-sys"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
[[package]]
name = "windows_i686_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
[[package]]
name = "windows_i686_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
[[package]]
name = "windows_x86_64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"

View File

@ -0,0 +1,59 @@
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pythonOlder
, rustPlatform
, setuptools-rust
, libiconv
, requests
, regex
, blobfile
}:
let
pname = "tiktoken";
version = "0.3.3";
src = fetchPypi {
inherit pname version;
hash = "sha256-l7WLe/2pRXkeyFXlPRZujsIMY3iUK5OFGmyRnd+dBJY=";
};
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
in
buildPythonPackage {
inherit pname version src postPatch;
format = "setuptools";
disabled = pythonOlder "3.8";
nativeBuildInput = [
setuptools-rust
];
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src postPatch;
name = "${pname}-${version}";
hash = "sha256-27xR7xVH/u40Xl4VbJW/yEbURf0UcGPG5QK/04igseA=";
};
nativeBuildInputs = [
rustPlatform.cargoSetupHook
setuptools-rust
] ++ (with rustPlatform; [ rust.cargo rust.rustc ]);
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
propagatedBuildInputs = [
requests
regex
blobfile
];
meta = with lib; {
description = "tiktoken is a fast BPE tokeniser for use with OpenAI's models.";
homepage = "https://github.com/openai/tiktoken";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
};
}

View File

@ -0,0 +1,27 @@
{ lib, buildPythonPackage, fetchPypi, authlib, tqdm, validators }:
buildPythonPackage rec {
pname = "weaviate-client";
version = "3.15.4";
src = fetchPypi {
inherit pname version;
hash = "sha256-XmHr/+++32KwdR195WL/1ThHF8juat/KTqbrFQ0BLhw=";
};
postPatch = ''
substituteInPlace setup.cfg \
--replace "validators>=0.18.2,<0.20.0" "validators>=0.18.2,<0.21.0"
'';
propagatedBuildInputs = [ authlib tqdm validators ];
doCheck = false;
meta = with lib; {
homepage = "https://github.com/weaviate/weaviate-python-client";
description = "A python native client for easy interaction with a Weaviate instance.";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
};
}

View File

@ -0,0 +1,62 @@
{ lib
, python3Packages
, fetchFromGitHub
, python3
, nix-update-script
}:
python3Packages.buildPythonApplication {
pname = "chatgpt-retrieval-plugin";
version = "unstable-2023-03-28";
src = fetchFromGitHub {
owner = "openai";
repo = "chatgpt-retrieval-plugin";
rev = "958bb787bf34823538482a9eb3157c5bf994a182";
hash = "sha256-fCNGzK5Uji6wGDTEwAf4FF/i+RC7ny3v4AsvQwIbehY=";
};
format = "pyproject";
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'python-dotenv = "^0.21.1"' 'python-dotenv = "*"' \
--replace 'python-multipart = "^0.0.6"' 'python-multipart = "^0.0.5"' \
--replace 'tiktoken = "^0.2.0"' 'tiktoken = "^0.3.0"'
'';
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 = "The ChatGPT Retrieval Plugin lets you easily search and find personal or work documents by asking questions in everyday language. ";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
};
}

View File

@ -404,6 +404,8 @@ with pkgs;
chatgpt-cli = callPackage ../tools/misc/chatgpt-cli { };
chatgpt-retrieval-plugin = callPackage ../servers/chatgpt-retrieval-plugin { };
checkov = callPackage ../development/tools/analysis/checkov {
python3 = python311;
};

View File

@ -1352,6 +1352,8 @@ self: super: with self; {
blis = callPackage ../development/python-modules/blis { };
blobfile = callPackage ../development/python-modules/blobfile { };
blockchain = callPackage ../development/python-modules/blockchain { };
blockdiag = callPackage ../development/python-modules/blockdiag { };
@ -7233,6 +7235,8 @@ self: super: with self; {
pixcat = callPackage ../development/python-modules/pixcat { };
pinecone-client = callPackage ../development/python-modules/pinecone-client { };
psrpcore = callPackage ../development/python-modules/psrpcore { };
pypemicro = callPackage ../development/python-modules/pypemicro { };
@ -7498,6 +7502,8 @@ self: super: with self; {
python-owasp-zap-v2-4 = callPackage ../development/python-modules/python-owasp-zap-v2-4 { };
python-pptx = callPackage ../development/python-modules/python-pptx { };
python-songpal = callPackage ../development/python-modules/python-songpal { };
python-swiftclient = callPackage ../development/python-modules/python-swiftclient { };
@ -8554,6 +8560,8 @@ self: super: with self; {
pymilter = callPackage ../development/python-modules/pymilter { };
pymilvus = callPackage ../development/python-modules/pymilvus { };
pymitv = callPackage ../development/python-modules/pymitv { };
pymfy = callPackage ../development/python-modules/pymfy { };
@ -9913,6 +9921,8 @@ self: super: with self; {
qdldl = callPackage ../development/python-modules/qdldl { };
qdrant-client = callPackage ../development/python-modules/qdrant-client { };
qds_sdk = callPackage ../development/python-modules/qds_sdk { };
qiling = callPackage ../development/python-modules/qiling { };
@ -11708,6 +11718,8 @@ self: super: with self; {
tika = callPackage ../development/python-modules/tika { };
tiktoken = callPackage ../development/python-modules/tiktoken { };
tikzplotlib = callPackage ../development/python-modules/tikzplotlib { };
tiledb = callPackage ../development/python-modules/tiledb {
@ -12496,6 +12508,8 @@ self: super: with self; {
weasyprint = callPackage ../development/python-modules/weasyprint { };
weaviate-client = callPackage ../development/python-modules/weaviate-client { };
web3 = callPackage ../development/python-modules/web3 { };
webargs = callPackage ../development/python-modules/webargs { };