Unverified Commit d8c405df authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

python313Packages.docling-serve: add docling-mcp (#441022)

parents 4460181b cff6d490
Loading
Loading
Loading
Loading
+101 −0
Original line number Diff line number Diff line
{
  lib,
  accelerate,
  buildPythonPackage,
  docling,
  fetchFromGitHub,
  hatchling,
  httpx,
  llama-index-core,
  llama-index-embeddings-huggingface,
  llama-index-embeddings-openai,
  llama-index-llms-openai-like,
  llama-index-node-parser-docling,
  llama-index-readers-docling,
  llama-index-readers-file,
  llama-index-vector-stores-milvus,
  llama-index,
  llama-stack-client,
  mcp,
  ollama,
  pydantic-settings,
  pydantic,
  pytest-asyncio,
  pytestCheckHook,
  python-dotenv,
  smolagents,
  torch,
  transformers,
}:

buildPythonPackage rec {
  pname = "docling-mcp";
  version = "1.2.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "docling-project";
    repo = "docling-mcp";
    tag = "v${version}";
    hash = "sha256-ktJ5K+1Qb7/lUHPkmv2FMnSe6PiIQ1BvWj5qIG8xfdE=";
  };

  pythonRemoveDeps = [
    # Disabled due to circular dependency
    "mellea"
  ];

  build-system = [ hatchling ];

  dependencies = [
    docling
    httpx
    mcp
    pydantic
    pydantic-settings
    python-dotenv
  ];

  optional-dependencies = {
    llama-index-rag = [
      llama-index
      llama-index-core
      llama-index-embeddings-huggingface
      llama-index-embeddings-openai
      llama-index-llms-openai-like
      llama-index-node-parser-docling
      llama-index-readers-docling
      llama-index-readers-file
      llama-index-vector-stores-milvus
    ];
    llama-stack = [ llama-stack-client ];
    smolagents = [
      accelerate
      ollama
      smolagents
      torch
      transformers
    ];
  };

  nativeCheckInputs = [
    pytest-asyncio
    pytestCheckHook
  ];

  pythonImportsCheck = [ "docling_mcp" ];

  disabledTestPaths = [
    # Tests require network access
    "tests/test_mcp_server.py"
    "tests/test_conversion_tools.py"
  ];

  meta = {
    description = "Making docling agentic through MCP";
    homepage = "https://github.com/docling-project/docling-mcp";
    changelog = "https://github.com/docling-project/docling-mcp/blob/${src.tag}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
  # python dependencies
  docling,
  docling-jobkit,
  docling-mcp,
  fastapi,
  httpx,
  pydantic-settings,
@@ -57,6 +58,7 @@ buildPythonPackage rec {
  dependencies = [
    docling
    (docling-jobkit.override { inherit withTesserocr withRapidocr; })
    docling-mcp
    fastapi
    httpx
    pydantic-settings
+39 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  docling-core,
  fetchPypi,
  hatchling,
  llama-index-core,
}:

buildPythonPackage rec {
  pname = "llama-index-node-parser-docling";
  version = "0.4.0";
  pyproject = true;

  src = fetchPypi {
    pname = "llama_index_node_parser_docling";
    inherit version;
    hash = "sha256-3D2X5sKAaweJG5w5qVeCEMgvKPZVUdI4/GsSwB9zfQ4=";
  };

  build-system = [ hatchling ];

  dependencies = [
    docling-core
    llama-index-core
  ];

  pythonImportsCheck = [ "llama_index.node_parser.docling" ];

  # Module has no tests
  doCheck = false;

  meta = {
    description = "Llama-index node_parser docling integration";
    homepage = "https://pypi.org/project/llama-index-node-parser-docling/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}
+43 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  docling-core,
  docling,
  fetchPypi,
  hatchling,
  llama-index-core,
  numpy,
}:

buildPythonPackage rec {
  pname = "llama-index-readers-docling";
  version = "0.4.0";
  pyproject = true;

  src = fetchPypi {
    pname = "llama_index_readers_docling";
    inherit version;
    hash = "sha256-b9UxJWlh/KnfTIOcKe9jiWCD1VknqeJH2hQjrDNmsOg=";
  };

  build-system = [ hatchling ];

  dependencies = [
    docling
    docling-core
    llama-index-core
    numpy
  ];

  pythonImportsCheck = [ "llama_index.readers.docling" ];

  # Module has no tests
  doCheck = false;

  meta = {
    description = "Llama-index readers docling integration";
    homepage = "https://pypi.org/project/llama-index-readers-docling/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}
+39 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchPypi,
  hatchling,
  llama-index-core,
  pymilvus,
}:

buildPythonPackage rec {
  pname = "llama-index-vector-stores-milvus";
  version = "0.9.1";
  pyproject = true;

  src = fetchPypi {
    pname = "llama_index_vector_stores_milvus";
    inherit version;
    hash = "sha256-8alWmT1CglPpvDqbav7AoahIOcabchsiUmrAbBeOyZI=";
  };

  build-system = [ hatchling ];

  dependencies = [
    llama-index-core
    pymilvus
  ];

  pythonImportsCheck = [ "llama_index.vector_stores.milvus" ];

  # Module has no tests
  doCheck = false;

  meta = {
    description = "Llama-index vector_stores milvus integration";
    homepage = "https://pypi.org/project/llama-index-vector-stores-milvus/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}
Loading