1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
# build-system
hatchling,
# dependencies
aiohttp,
docstring-parser,
jiter,
openai,
pydantic,
rich,
tenacity,
typer,
# tests
anthropic,
diskcache,
fastapi,
google-generativeai,
jinja2,
pytest-asyncio,
pytestCheckHook,
python-dotenv,
redis,
}:
buildPythonPackage rec {
pname = "instructor";
version = "1.7.4";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "jxnl";
repo = "instructor";
tag = version;
hash = "sha256-TrNGTWnZShOYeMGonSEib7NiEbrwWNtujeWo2gaewf4=";
};
build-system = [ hatchling ];
dependencies = [
aiohttp
docstring-parser
jiter
openai
pydantic
rich
tenacity
typer
];
nativeCheckInputs = [
anthropic
diskcache
fastapi
google-generativeai
jinja2
pytest-asyncio
pytestCheckHook
python-dotenv
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"
# Checks magic values and this fails on Python 3.13
"test_raw_base64_autodetect_jpeg"
"test_raw_base64_autodetect_png"
];
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/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ mic92 ];
mainProgram = "instructor";
};
}
|