472aeafc57
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
99 lines
1.7 KiB
Nix
99 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
poetry-core,
|
|
|
|
# dependencies
|
|
aiohttp,
|
|
docstring-parser,
|
|
jiter,
|
|
openai,
|
|
pydantic,
|
|
rich,
|
|
tenacity,
|
|
typer,
|
|
|
|
# tests
|
|
anthropic,
|
|
diskcache,
|
|
fastapi,
|
|
google-generativeai,
|
|
jinja2,
|
|
pytest-asyncio,
|
|
pytestCheckHook,
|
|
redis,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "instructor";
|
|
version = "1.5.0";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jxnl";
|
|
repo = "instructor";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-UrLbKDaQu2ioQHqKKS8SdRTpQj+Z0w+bcLrRuZT3DC0=";
|
|
};
|
|
|
|
pythonRelaxDeps = [
|
|
"docstring-parser"
|
|
"jiter"
|
|
"pydantic"
|
|
"tenacity"
|
|
];
|
|
|
|
build-system = [ poetry-core ];
|
|
|
|
dependencies = [
|
|
aiohttp
|
|
docstring-parser
|
|
jiter
|
|
openai
|
|
pydantic
|
|
rich
|
|
tenacity
|
|
typer
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
anthropic
|
|
diskcache
|
|
fastapi
|
|
google-generativeai
|
|
jinja2
|
|
pytest-asyncio
|
|
pytestCheckHook
|
|
redis
|
|
];
|
|
|
|
pythonImportsCheck = [ "instructor" ];
|
|
|
|
disabledTests = [
|
|
# Tests require OpenAI API key
|
|
"successfully"
|
|
"test_mode_functions_deprecation_warning"
|
|
"test_partial"
|
|
|
|
# Requires unpackaged `vertexai`
|
|
"test_json_preserves_description_of_non_english_characters_in_json_mode"
|
|
];
|
|
|
|
disabledTestPaths = [
|
|
# Tests require OpenAI API key
|
|
"tests/test_distil.py"
|
|
"tests/llm/"
|
|
];
|
|
|
|
meta = {
|
|
description = "Structured outputs for llm";
|
|
homepage = "https://github.com/jxnl/instructor";
|
|
changelog = "https://github.com/jxnl/instructor/releases/tag/v${version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ mic92 ];
|
|
mainProgram = "instructor";
|
|
};
|
|
}
|