Update README.md
Browse files
README.md
CHANGED
|
@@ -1,20 +1,45 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
- (Later) STT streaming, Vision/OCR, Memory/RAG
|
| 7 |
|
| 8 |
-
##
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
-
|
| 15 |
-
-
|
| 16 |
-
-
|
|
|
|
| 17 |
|
| 18 |
-
##
|
| 19 |
```bash
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: "Brain"
|
| 3 |
+
emoji: "🧠"
|
| 4 |
+
colorFrom: "pink"
|
| 5 |
+
colorTo: "purple"
|
| 6 |
+
sdk: "docker"
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
|
| 10 |
+
# 🧠 Brain (Router) — Online AI Network
|
| 11 |
+
|
| 12 |
+
This Space is the router for your multi-Space AI network.
|
| 13 |
+
It calls:
|
| 14 |
+
- *Python AI Space* → patch-first code fixes
|
| 15 |
+
- *TTS Space* → short spoken explanation
|
| 16 |
- (Later) STT streaming, Vision/OCR, Memory/RAG
|
| 17 |
|
| 18 |
+
## Endpoints
|
| 19 |
+
- *GET* /health
|
| 20 |
+
- *POST* /warmup
|
| 21 |
+
- *POST* /code_help (see examples below)
|
| 22 |
+
|
| 23 |
+
## Configure (Settings → Variables)
|
| 24 |
+
- PYTHON_AI_URL → e.g. https://<you>-python_ai_space.hf.space
|
| 25 |
+
- TTS_URL → e.g. https://<you>-tts_space.hf.space
|
| 26 |
+
- (optional) STT_URL, VISION_URL, MEMORY_URL
|
| 27 |
+
- (optional) PROMPT_BUDGET_BYTES=12000, MEMORY_BUDGET_BYTES=6000, VIEWPORT_MAX_LINES=60
|
| 28 |
|
| 29 |
+
## Quick test (replace URLs)
|
| 30 |
```bash
|
| 31 |
+
curl -X POST https://<you>-brain.hf.space/code_help \
|
| 32 |
+
-H "content-type: application/json" \
|
| 33 |
+
-d '{
|
| 34 |
+
"utterance": "please fix the error and make it run",
|
| 35 |
+
"telemetry": {
|
| 36 |
+
"file": "main.py",
|
| 37 |
+
"lang": "python",
|
| 38 |
+
"cursor": {"l":88,"c":12},
|
| 39 |
+
"viewport": {"start":72,"end":110, "text":"def foo():\n return bar\n\nresult = foo()\nprint(reslt)\n"},
|
| 40 |
+
"diag": [{"l":90,"sev":"error","msg":"NameError: reslt is not defined"}],
|
| 41 |
+
"term": "Traceback... NameError: reslt"
|
| 42 |
+
},
|
| 43 |
+
"memory": {"short": [], "sess": ["Prefer list comprehensions."], "proj": []},
|
| 44 |
+
"response_mode": "patch"
|
| 45 |
+
}'
|