Spaces:
Sleeping
A newer version of the Gradio SDK is available:
6.8.0
β OpenFloor Playground Integration - FINAL FIX
Problem Identified
The OpenFloor Playground was showing "[No manifests found]" error because:
- The playground sends a POST request with an OFP envelope containing a
getManifestsevent - Our
/manifestendpoint was only returning a simple JSON manifest - The playground expected the manifest to be wrapped in an OFP response envelope
The Solution
Updated the /manifest endpoint to:
- β Accept both GET and POST requests
- β Detect OFP envelope format in POST body
- β Return manifest wrapped in OFP response envelope when requested via OFP
- β Maintain backward compatibility for simple GET/POST requests
Code Changes (app.py:114-156)
@app.api_route("/manifest", methods=["GET", "POST"])
async def get_manifest(request: Request):
"""Serve the assistant manifest for OFP Playground
Handles two formats:
1. Simple GET/POST: Returns manifest directly
2. OFP envelope POST with getManifests event: Returns manifest in OFP envelope
"""
manifest = sentinel.get_manifest()
# If POST with OFP envelope, wrap response in OFP format
if request.method == "POST":
try:
body = await request.json()
if "openFloor" in body:
openfloor_data = body["openFloor"]
events = openfloor_data.get("events", [])
# Check for getManifests event
for event in events:
if event.get("eventType") == "getManifests":
# Return OFP envelope with manifests
return JSONResponse(content={
"openFloor": {
"schema": {"version": "1.0.0"},
"conversation": openfloor_data.get("conversation", {}),
"sender": {
"speakerUri": config['sentinel']['speaker_uri']
},
"events": [{
"eventType": "manifests",
"parameters": {
"manifests": [manifest]
}
}]
}
})
except:
pass # Fall through to simple response
# Default: simple manifest return
return JSONResponse(content=manifest)
What Changed
Before (β Broken)
Request from Playground:
POST /manifest
{
"openFloor": {
"events": [{"eventType": "getManifests"}]
}
}
Response:
{
"identification": {...},
"capabilities": [...]
}
Result: Playground couldn't find manifests because they weren't in expected OFP envelope format
After (β Fixed)
Request from Playground:
POST /manifest
{
"openFloor": {
"events": [{"eventType": "getManifests"}]
}
}
Response:
{
"openFloor": {
"schema": {"version": "1.0.0"},
"events": [{
"eventType": "manifests",
"parameters": {
"manifests": [{
"identification": {...},
"capabilities": [...]
}]
}
}]
}
}
Result: β Playground finds and displays the manifest!
Testing
Local Testing
# Test with the provided script
chmod +x test_ofp_manifest.py
python test_ofp_manifest.py
Expected output:
β
PASS - Simple GET
β
PASS - Simple POST
β
PASS - OFP Envelope
π All tests passed!
HuggingFace Spaces
After pushing to HF Spaces, wait 1-2 minutes for rebuild, then:
- Go to: https://openfloor.dev/playground
- Enter:
https://bladeszasza-ofpbadword.hf.space/manifest - Click "Get Manifest"
β Should now show your sentinel instead of "[No manifests found]"
Deployment Status
- β Code updated locally
- β Committed to git
- β Pushed to HuggingFace Spaces (commit 98028d2)
- β³ Waiting for HF Spaces rebuild (1-2 minutes)
Next Steps
Wait for HF Spaces rebuild (check the logs at your Space page)
Test in OpenFloor Playground:
- URL: https://openfloor.dev/playground
- Manifest:
https://bladeszasza-ofpbadword.hf.space/manifest - Click "Get Manifest"
- Should see: "Content Moderator Sentinel" π
Test with profane messages:
- Send: "hello how are you darling?" (clean)
- Send: "ass" (profane)
- Check dashboard at:
https://bladeszasza-ofpbadword.hf.space/gradio - Violations should increase!
Summary
All Issues Fixed:
β Issue 1: HuggingFace Spaces infinite loop - FIXED β Issue 2: Manifest endpoint 404 - FIXED β Issue 3: Manifest POST method not allowed - FIXED β Issue 4: OFP envelope format not recognized - FIXED
Your OFP Bad Word Sentinel is now fully compatible with the OpenFloor Playground! π
Troubleshooting
Still seeing "[No manifests found]"?
Check HF Spaces rebuilt:
- Go to your Space page
- Check the "Logs" tab
- Should see recent build timestamp
Force rebuild if needed:
- Settings β Factory reboot
Test manifest endpoint directly:
curl https://bladeszasza-ofpbadword.hf.space/manifestShould return JSON
Check dashboard:
- Visit:
https://bladeszasza-ofpbadword.hf.space/ - Should redirect to
/gradio - Dashboard should load
- Visit:
Dashboard not accessible?
- Try direct URL:
https://bladeszasza-ofpbadword.hf.space/gradio - Check HF Spaces logs for errors
- Verify Space is running (not sleeping)
Status: β READY FOR OPENFLOOR PLAYGROUND!
Just wait for the HF Spaces rebuild and test in the playground! π