josephrw commited on
Commit
654a6ba
Β·
verified Β·
1 Parent(s): 2ae31c3

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +25 -2
app.py CHANGED
@@ -3255,8 +3255,11 @@ async def api_help():
3255
  {"method": "GET", "path": "/api/artifacts/{patch_hash}", "description": "Get single artifact as JSON", "params": [{"name": "patch_hash", "type": "text", "required": True, "placeholder": "artifact hash (in path)"}]},
3256
  {"method": "GET", "path": "/receipts", "description": "List all patch receipts (limit param)", "params": [{"name": "limit", "type": "text", "required": False, "placeholder": "50"}]},
3257
  {"method": "GET", "path": "/receipts/{receipt_id}", "description": "Get a specific receipt", "params": [{"name": "receipt_id", "type": "text", "required": True, "placeholder": "receipt ID (in path)"}]},
3258
- {"method": "POST", "path": "/audio/store", "description": "Store base64-encoded audio recording alongside an artifact", "params": [{"name": "patch_hash", "type": "text", "required": True, "placeholder": "hash"}, {"name": "audio_b64", "type": "textarea", "required": True, "placeholder": "base64 audio"}]},
3259
- {"method": "GET", "path": "/audio/{filename}", "description": "Serve an audio file", "params": [{"name": "filename", "type": "text", "required": True, "placeholder": "filename.webm (in path)"}]},
 
 
 
3260
  {"method": "GET", "path": "/diary", "description": "Lab diary page β€” notebook-style view of all artifacts", "params": []},
3261
  {"method": "POST", "path": "/terminal/create", "description": "Create a long-running terminal session for backtesting", "params": [{"name": "cwd", "type": "text", "required": False, "placeholder": "/tmp"}]},
3262
  {"method": "POST", "path": "/terminal/{session_id}/exec", "description": "Execute a command in a terminal session. Supports 300s timeout", "params": [{"name": "session_id", "type": "text", "required": True, "placeholder": "term_xxxx (in path)"}, {"name": "command", "type": "text", "required": True, "placeholder": "ls -la"}, {"name": "timeout", "type": "text", "required": False, "placeholder": "300"}]},
@@ -3420,6 +3423,26 @@ async def gpt_actions_schema():
3420
  "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "default": 50}}],
3421
  "responses": {"200": {"description": "List of receipts"}}}
3422
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3423
  "/capabilities": {
3424
  "get": {"summary": "List all capabilities", "operationId": "getCapabilities",
3425
  "responses": {"200": {"description": "Capability list"}}}
 
3255
  {"method": "GET", "path": "/api/artifacts/{patch_hash}", "description": "Get single artifact as JSON", "params": [{"name": "patch_hash", "type": "text", "required": True, "placeholder": "artifact hash (in path)"}]},
3256
  {"method": "GET", "path": "/receipts", "description": "List all patch receipts (limit param)", "params": [{"name": "limit", "type": "text", "required": False, "placeholder": "50"}]},
3257
  {"method": "GET", "path": "/receipts/{receipt_id}", "description": "Get a specific receipt", "params": [{"name": "receipt_id", "type": "text", "required": True, "placeholder": "receipt ID (in path)"}]},
3258
+ {"method": "POST", "path": "/audio/upload", "description": "Upload raw binary audio (webm). Optional patch_hash to link to artifact.", "params": [{"name": "patch_hash", "type": "text", "required": False, "placeholder": "artifact hash"}]},
3259
+ {"method": "POST", "path": "/audio/store", "description": "Store base64-encoded audio. Optional patch_hash for standalone recordings.", "params": [{"name": "patch_hash", "type": "text", "required": False, "placeholder": "artifact hash (optional)"}, {"name": "audio_b64", "type": "textarea", "required": True, "placeholder": "base64 audio data"}]},
3260
+ {"method": "POST", "path": "/audio/generate", "description": "Generate code from audio transcript. Creates temp session, runs observer β†’ builder β†’ receipt.", "params": [{"name": "transcript", "type": "textarea", "required": True, "placeholder": "transcribed text from audio"}, {"name": "audio_file", "type": "text", "required": False, "placeholder": "rec_xxx.webm"}, {"name": "mode", "type": "text", "required": False, "placeholder": "continuous_code"}]},
3261
+ {"method": "GET", "path": "/audio/list", "description": "List all recorded audio files with size and timestamp", "params": []},
3262
+ {"method": "GET", "path": "/audio/{filename}", "description": "Serve an audio file for playback", "params": [{"name": "filename", "type": "text", "required": True, "placeholder": "filename.webm (in path)"}]},
3263
  {"method": "GET", "path": "/diary", "description": "Lab diary page β€” notebook-style view of all artifacts", "params": []},
3264
  {"method": "POST", "path": "/terminal/create", "description": "Create a long-running terminal session for backtesting", "params": [{"name": "cwd", "type": "text", "required": False, "placeholder": "/tmp"}]},
3265
  {"method": "POST", "path": "/terminal/{session_id}/exec", "description": "Execute a command in a terminal session. Supports 300s timeout", "params": [{"name": "session_id", "type": "text", "required": True, "placeholder": "term_xxxx (in path)"}, {"name": "command", "type": "text", "required": True, "placeholder": "ls -la"}, {"name": "timeout", "type": "text", "required": False, "placeholder": "300"}]},
 
3423
  "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "default": 50}}],
3424
  "responses": {"200": {"description": "List of receipts"}}}
3425
  },
3426
+ "/audio/generate": {
3427
+ "post": {"summary": "Generate code from audio transcript β€” creates temp session, runs observer β†’ builder β†’ receipt", "operationId": "audioGenerate",
3428
+ "requestBody": {"required": True, "content": {"application/json": {"schema": {"type": "object", "properties": {"transcript": {"type": "string", "description": "Transcribed text from audio recording"}, "audio_file": {"type": "string", "description": "Audio filename from /audio/store"}, "mode": {"type": "string", "default": "continuous_code"}}, "required": ["transcript"]}}}},
3429
+ "responses": {"200": {"description": "Code patch generated from audio with receipt"}}}
3430
+ },
3431
+ "/audio/store": {
3432
+ "post": {"summary": "Store base64-encoded audio recording (standalone or linked to artifact)", "operationId": "audioStore",
3433
+ "requestBody": {"required": True, "content": {"application/json": {"schema": {"type": "object", "properties": {"audio_b64": {"type": "string", "description": "Base64-encoded audio data"}, "patch_hash": {"type": "string", "description": "Optional artifact hash to link audio to"}}, "required": ["audio_b64"]}}}},
3434
+ "responses": {"200": {"description": "Audio stored with filename and hash"}}}
3435
+ },
3436
+ "/audio/list": {
3437
+ "get": {"summary": "List all recorded audio files", "operationId": "audioList",
3438
+ "responses": {"200": {"description": "List of audio files with size and timestamp"}}}
3439
+ },
3440
+ "/audio/upload": {
3441
+ "post": {"summary": "Upload raw binary audio (webm)", "operationId": "audioUpload",
3442
+ "parameters": [{"name": "patch_hash", "in": "query", "required": False, "schema": {"type": "string"}, "description": "Optional artifact hash to link audio to"}],
3443
+ "requestBody": {"content": {"application/octet-stream": {"schema": {"type": "string", "format": "binary"}}}},
3444
+ "responses": {"200": {"description": "Audio stored with filename and hash"}}}
3445
+ },
3446
  "/capabilities": {
3447
  "get": {"summary": "List all capabilities", "operationId": "getCapabilities",
3448
  "responses": {"200": {"description": "Capability list"}}}