Percy3822 commited on
Commit
ddd62aa
·
verified ·
1 Parent(s): 04a16a9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +40 -15
README.md CHANGED
@@ -1,20 +1,45 @@
1
- # Brain (Router) — Online AI Network
 
 
 
 
 
 
 
2
 
3
- FastAPI service that orchestrates specialized Spaces:
4
- - Python AI (patch-first code fixes)
5
- - TTS (short spoken summaries)
 
 
 
6
  - (Later) STT streaming, Vision/OCR, Memory/RAG
7
 
8
- ## Env Vars
9
- - PYTHON_AI_URL = https://<you>-python_ai_space.hf.space
10
- - TTS_URL = https://<you>-tts_space.hf.space
11
- - STT_URL = (optional, future)
12
- - VISION_URL = (optional, future)
13
- - MEMORY_URL = (optional, future)
14
- - PROMPT_BUDGET_BYTES = 12000
15
- - MEMORY_BUDGET_BYTES = 6000
16
- - VIEWPORT_MAX_LINES = 60
 
17
 
18
- ## Run (locally)
19
  ```bash
20
- uvicorn app:app --reload --port 8000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }'