data_juicer.tools.DJ_mcp_granular_ops module#

data_juicer.tools.DJ_mcp_granular_ops.resolve_signature_annotations(func, sig: Signature) Signature[源代码]#

Resolve postponed/string annotations into real runtime types.

When a module uses from __future__ import annotations, all annotations are stored as strings. This helper calls typing.get_type_hints on the original callable to obtain the real type objects and rebuilds the signature with them.

data_juicer.tools.DJ_mcp_granular_ops.process_parameter(name: str, param: Parameter) Parameter[源代码]#

Processes a function parameter: - Converts jsonargparse.typing.ClosedUnitInterval to a local equivalent annotation.

data_juicer.tools.DJ_mcp_granular_ops.create_operator_function(op, mcp)[源代码]#

Creates a callable function for a Data-Juicer operator class.

This function dynamically creates a function that can be registered as an MCP tool, with proper signature and documentation based on the operator's __init__ method.

data_juicer.tools.DJ_mcp_granular_ops.create_mcp_server(port: str = '8000')[源代码]#

Creates the FastMCP server and registers the tools.

参数:

port (str, optional) -- Port number. Defaults to "8000".