Spaces:
Running on Zero
Running on Zero
File size: 1,950 Bytes
ca9a89c 8a28a8d ca9a89c 8a28a8d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | _GRADIO_INTEGRATION_EXPORTS = {
"register_high_level_mcp_apis",
"cleanup_dependencies_api_names",
"patch_gradio_api_suppression",
"HIGH_LEVEL_MCP_API_NAMES",
}
def __getattr__(name):
if name in _GRADIO_INTEGRATION_EXPORTS:
# Keep the transport-independent handlers importable in validation and
# CLI environments where Gradio is intentionally not installed.
from . import mcp_gradio_integration
return getattr(mcp_gradio_integration, name)
if name in ("types", "server", "client", "shared"):
raise ImportError(f"No module named 'mcp.{name}' in local mcp package")
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
from .get_task_list import handle_get_task_list
from .get_model_architecture_list import handle_get_model_architecture_list
from .get_model_list import handle_get_model_list
from .get_feature_list import handle_get_feature_list
from .get_model_features import handle_get_model_features
from .run import handle_run
from .get_task_status import handle_get_task_status
from .get_chain_schema import handle_get_chain_schema
from .error_schema import make_error, make_validation_error, make_not_found_error
MCP_FUNCTIONS = [
handle_get_task_list,
handle_get_model_architecture_list,
handle_get_model_list,
handle_get_feature_list,
handle_get_model_features,
handle_run,
handle_get_task_status,
handle_get_chain_schema,
]
__all__ = [
"handle_get_task_list",
"handle_get_model_architecture_list",
"handle_get_model_list",
"handle_get_feature_list",
"handle_get_model_features",
"handle_run",
"handle_get_task_status",
"handle_get_chain_schema",
"make_error",
"make_validation_error",
"make_not_found_error",
"register_high_level_mcp_apis",
"cleanup_dependencies_api_names",
"patch_gradio_api_suppression",
"HIGH_LEVEL_MCP_API_NAMES",
"MCP_FUNCTIONS",
]
|