Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,6 +79,7 @@ def safe_parse_json_from_text(text: str):
|
|
| 79 |
# -------------------------------
|
| 80 |
# TRUE CORE FUNCTION (with objects)
|
| 81 |
# -------------------------------
|
|
|
|
| 82 |
def robot_watch_core(payload: Dict[str, Any]):
|
| 83 |
if isinstance(payload, str):
|
| 84 |
try:
|
|
@@ -158,16 +159,6 @@ Respond in STRICT JSON ONLY.
|
|
| 158 |
"vlm_raw": vlm_output
|
| 159 |
}
|
| 160 |
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
# -------------------------------
|
| 164 |
-
# REGISTER MCP TOOL (wrapper)
|
| 165 |
-
# -------------------------------
|
| 166 |
-
@mcp.tool()
|
| 167 |
-
def robot_watch(payload: Dict[str, Any]):
|
| 168 |
-
return robot_watch_core(payload)
|
| 169 |
-
|
| 170 |
-
|
| 171 |
# -------------------------------
|
| 172 |
# Gradio wrapper
|
| 173 |
# -------------------------------
|
|
@@ -184,7 +175,5 @@ app = gr.Interface(
|
|
| 184 |
api_name="predict"
|
| 185 |
)
|
| 186 |
|
| 187 |
-
print("Registered MCP tools:", mcp.tools.keys())
|
| 188 |
-
|
| 189 |
if __name__ == "__main__":
|
| 190 |
app.launch(mcp_server=True)
|
|
|
|
| 79 |
# -------------------------------
|
| 80 |
# TRUE CORE FUNCTION (with objects)
|
| 81 |
# -------------------------------
|
| 82 |
+
@mcp.tool(name="robot_watch")
|
| 83 |
def robot_watch_core(payload: Dict[str, Any]):
|
| 84 |
if isinstance(payload, str):
|
| 85 |
try:
|
|
|
|
| 159 |
"vlm_raw": vlm_output
|
| 160 |
}
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
# -------------------------------
|
| 163 |
# Gradio wrapper
|
| 164 |
# -------------------------------
|
|
|
|
| 175 |
api_name="predict"
|
| 176 |
)
|
| 177 |
|
|
|
|
|
|
|
| 178 |
if __name__ == "__main__":
|
| 179 |
app.launch(mcp_server=True)
|