1{
2 lib,
3 nix-update-script,
4 buildPythonPackage,
5 fetchPypi,
6 hatchling,
7 griffe,
8 mcp,
9 openai,
10 pydantic,
11 requests,
12 types-requests,
13 typing-extensions,
14}:
15
16buildPythonPackage rec {
17 pname = "openai-agents";
18 version = "0.0.13";
19 pyproject = true;
20
21 src = fetchPypi {
22 inherit version;
23 pname = "openai_agents";
24 hash = "sha256-a4AxXnXAa1MCxfKtui+eo4RflGFdrtRwa/uHF0D1YaU=";
25 };
26
27 # OpenAI 1.76.0 seems to not build currently
28 postPatch = ''
29 substituteInPlace pyproject.toml --replace-fail "openai>=1.76.0" "openai"
30 '';
31
32 build-system = [
33 hatchling
34 ];
35
36 dependencies = [
37 griffe
38 mcp
39 openai
40 pydantic
41 requests
42 types-requests
43 typing-extensions
44 ];
45
46 pythonImportsCheck = [
47 "agents"
48 ];
49
50 passthru.updateScript = nix-update-script { };
51
52 meta = {
53 changelog = "https://github.com/openai/openai-agents-python/releases/tag/${version}";
54 homepage = "https://github.com/openai/openai-agents-python";
55 description = "Lightweight, powerful framework for multi-agent workflows";
56 license = lib.licenses.mit;
57 maintainers = [ lib.maintainers.bryanhonof ];
58 };
59}