data_juicer.tools.DJ_mcp_granular_ops module#
- data_juicer.tools.DJ_mcp_granular_ops.resolve_signature_annotations(func, sig: Signature) Signature[source]#
Resolve postponed/string annotations into real runtime types.
When a module uses
from __future__ import annotations, all annotations are stored as strings. This helper callstyping.get_type_hintson 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[source]#
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)[source]#
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.