summaryrefslogtreecommitdiff
path: root/Omni/Bild/Deps
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Bild/Deps')
-rw-r--r--Omni/Bild/Deps/Python.nix2
-rw-r--r--Omni/Bild/Deps/llm-ollama.nix57
-rw-r--r--Omni/Bild/Deps/openai-python.nix99
3 files changed, 137 insertions, 21 deletions
diff --git a/Omni/Bild/Deps/Python.nix b/Omni/Bild/Deps/Python.nix
index bb01139..3a0562d 100644
--- a/Omni/Bild/Deps/Python.nix
+++ b/Omni/Bild/Deps/Python.nix
@@ -2,9 +2,11 @@
"cryptography"
"flask"
"llm"
+ "llm-ollama"
"ludic"
"mypy"
"nltk"
+ "ollama"
"openai"
"requests"
"slixmpp"
diff --git a/Omni/Bild/Deps/llm-ollama.nix b/Omni/Bild/Deps/llm-ollama.nix
index 15b26cc..3956bb7 100644
--- a/Omni/Bild/Deps/llm-ollama.nix
+++ b/Omni/Bild/Deps/llm-ollama.nix
@@ -1,47 +1,62 @@
{
+ lib,
buildPythonPackage,
fetchFromGitHub,
- lib,
+ # build-system
+ setuptools,
llm,
+ # dependencies
+ click,
ollama,
+ pydantic,
+ # tests
pytestCheckHook,
- setuptools,
- pythonOlder,
}:
buildPythonPackage rec {
pname = "llm-ollama";
- version = "0.3.0";
+ version = "0.8.2";
pyproject = true;
- disabled = pythonOlder "3.8";
-
src = fetchFromGitHub {
owner = "taketwo";
- repo = pname;
- rev = "refs/tags/${version}";
- hash = "sha256-Ar0Ux8BNGY0i764CEk7+48J6jnndlRIIMPZ9tFpXiy4=";
+ repo = "llm-ollama";
+ tag = version;
+ hash = "sha256-/WAugfkI4izIQ7PoKM9epd/4vFxYPvsiwDbEqqTdMq4=";
};
- nativeBuildInputs = [setuptools];
+ build-system = [
+ setuptools
+ # Follows the reasoning from https://github.com/NixOS/nixpkgs/pull/327800#discussion_r1681586659 about including llm in build-system
+ llm
+ ];
- buildInputs = [llm ollama];
+ dependencies = [
+ click
+ ollama
+ pydantic
+ ];
- propagatedBuildInputs = [ollama];
+ nativeCheckInputs = [
+ pytestCheckHook
+ ];
+ # These tests try to access the filesystem and fail
disabledTests = [
- # wants to mkdir in the /homeless-shelter
- "test_registered_models"
+ "test_registered_model"
+ "test_registered_chat_models"
+ "test_registered_embedding_models"
+ "test_registered_models_when_ollama_is_down"
];
- nativeCheckInputs = [pytestCheckHook];
-
- pythonImportsCheck = ["llm_ollama"];
+ pythonImportsCheck = [
+ "llm_ollama"
+ ];
- meta = with lib; {
+ meta = {
+ description = "LLM plugin providing access to Ollama models using HTTP API";
homepage = "https://github.com/taketwo/llm-ollama";
- description = "LLM plugin providing access to local Ollama models usting HTTP API";
changelog = "https://github.com/taketwo/llm-ollama/releases/tag/${version}";
- license = licenses.asl20;
- maintainers = with maintainers; [bsima];
+ license = lib.licenses.asl20;
+ maintainers = with lib.maintainers; [erethon];
};
}
diff --git a/Omni/Bild/Deps/openai-python.nix b/Omni/Bild/Deps/openai-python.nix
new file mode 100644
index 0000000..79db11c
--- /dev/null
+++ b/Omni/Bild/Deps/openai-python.nix
@@ -0,0 +1,99 @@
+{
+ lib,
+ buildPythonPackage,
+ pythonOlder,
+ # build-system
+ hatchling,
+ hatch-fancy-pypi-readme,
+ # dependencies
+ anyio,
+ distro,
+ httpx,
+ jiter,
+ pydantic,
+ sniffio,
+ tqdm,
+ typing-extensions,
+ numpy,
+ pandas,
+ pandas-stubs,
+ # check deps
+ pytestCheckHook,
+ dirty-equals,
+ inline-snapshot,
+ nest-asyncio,
+ pytest-asyncio,
+ pytest-mock,
+ respx,
+ sources,
+}:
+buildPythonPackage rec {
+ pname = "openai";
+ version = sources.openai-python.version;
+ pyproject = true;
+
+ disabled = pythonOlder "3.8";
+
+ src = sources.openai-python;
+
+ build-system = [
+ hatchling
+ hatch-fancy-pypi-readme
+ ];
+
+ dependencies = [
+ anyio
+ distro
+ httpx
+ jiter
+ pydantic
+ sniffio
+ tqdm
+ typing-extensions
+ ];
+
+ optional-dependencies = {
+ datalib = [
+ numpy
+ pandas
+ pandas-stubs
+ ];
+ };
+
+ pythonImportsCheck = ["openai"];
+
+ nativeCheckInputs = [
+ pytestCheckHook
+ dirty-equals
+ inline-snapshot
+ nest-asyncio
+ pytest-asyncio
+ pytest-mock
+ respx
+ ];
+
+ pytestFlagsArray = [
+ "-W"
+ "ignore::DeprecationWarning"
+ ];
+
+ disabledTests = [
+ # Tests make network requests
+ "test_copy_build_request"
+ "test_basic_attribute_access_works"
+ ];
+
+ disabledTestPaths = [
+ # Test makes network requests
+ "tests/api_resources"
+ ];
+
+ meta = with lib; {
+ description = "Python client library for the OpenAI API";
+ homepage = "https://github.com/openai/openai-python";
+ changelog = "https://github.com/openai/openai-python/releases/tag/v${version}";
+ license = licenses.mit;
+ maintainers = with maintainers; [malo];
+ mainProgram = "openai";
+ };
+}