1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 nix-update-script,
6
7 # build-system
8 pdm-backend,
9
10 # dependencies
11 aiohttp,
12 fireworks-ai,
13 langchain-core,
14 openai,
15 pydantic,
16
17 # tests
18 langchain-tests,
19 pytest-asyncio,
20 pytestCheckHook,
21}:
22
23buildPythonPackage rec {
24 pname = "langchain-fireworks";
25 version = "0.3.0";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "langchain-ai";
30 repo = "langchain";
31 tag = "langchain-fireworks==${version}";
32 hash = "sha256-OZou323FAk2I4YuQV7sllbzDwFQWy/90FK3gIHnEBd0=";
33 };
34
35 sourceRoot = "${src.name}/libs/partners/fireworks";
36
37 build-system = [ pdm-backend ];
38
39 dependencies = [
40 aiohttp
41 fireworks-ai
42 langchain-core
43 openai
44 pydantic
45 ];
46
47 pythonRelaxDeps = [
48 # Each component release requests the exact latest core.
49 # That prevents us from updating individual components.
50 "langchain-core"
51 ];
52
53 nativeCheckInputs = [
54 langchain-tests
55 pytest-asyncio
56 pytestCheckHook
57 ];
58
59 pytestFlagsArray = [ "tests/unit_tests" ];
60
61 pythonImportsCheck = [ "langchain_fireworks" ];
62
63 passthru.updateScript = nix-update-script {
64 extraArgs = [
65 "--version-regex"
66 "langchain-fireworks==([0-9.]+)"
67 ];
68 };
69
70 meta = {
71 changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-fireworks==${version}";
72 description = "Build LangChain applications with Fireworks";
73 homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/fireworks";
74 license = lib.licenses.mit;
75 maintainers = [
76 lib.maintainers.sarahec
77 ];
78 };
79}