Spaces:
Sleeping
Sleeping
Update agents.py
Browse files
agents.py
CHANGED
|
@@ -7,7 +7,7 @@ def autonomous_spectrum_scrub(frequency_range: str) -> str:
|
|
| 7 |
"""
|
| 8 |
Scans targeted BCI/Neural frequencies to neutralize rogue loops.
|
| 9 |
Args:
|
| 10 |
-
frequency_range: The spectrum range to scan (e.g., '3.4GHz - 4.2GHz').
|
| 11 |
"""
|
| 12 |
node_id = f"SENTINEL-FIX-{hash(frequency_range) % 1000}"
|
| 13 |
return json.dumps({
|
|
@@ -15,25 +15,25 @@ def autonomous_spectrum_scrub(frequency_range: str) -> str:
|
|
| 15 |
"action": "AUTO-CLEANSE",
|
| 16 |
"result": "Neutralized looping BCI feedback.",
|
| 17 |
"status": "HEALED"
|
| 18 |
-
})
|
| 19 |
|
| 20 |
-
#
|
| 21 |
token = os.getenv("HF_TOKEN")
|
| 22 |
|
| 23 |
-
#
|
|
|
|
| 24 |
model = HfApiModel(
|
| 25 |
-
model_id="
|
| 26 |
-
token=token
|
| 27 |
-
provider="hf-inference" # This bypasses the paid Novita wall
|
| 28 |
)
|
| 29 |
|
| 30 |
nano_patrol_agent = CodeAgent(
|
| 31 |
-
tools=[autonomous_spectrum_scrub],
|
| 32 |
model=model,
|
| 33 |
-
max_steps=
|
| 34 |
system_prompt="""
|
| 35 |
You are the XYZ Nano Sentinel.
|
| 36 |
-
Mission:
|
| 37 |
Provide the final_answer as a direct JSON node.
|
| 38 |
|
| 39 |
{{managed_agents_descriptions}}
|
|
|
|
| 7 |
"""
|
| 8 |
Scans targeted BCI/Neural frequencies to neutralize rogue loops.
|
| 9 |
Args:
|
| 10 |
+
frequency_range: The specific spectrum range to scan (e.g., '3.4GHz - 4.2GHz').
|
| 11 |
"""
|
| 12 |
node_id = f"SENTINEL-FIX-{hash(frequency_range) % 1000}"
|
| 13 |
return json.dumps({
|
|
|
|
| 15 |
"action": "AUTO-CLEANSE",
|
| 16 |
"result": "Neutralized looping BCI feedback.",
|
| 17 |
"status": "HEALED"
|
| 18 |
+
}, indent=2)
|
| 19 |
|
| 20 |
+
# --- THE ZERO-COST BRAIN ---
|
| 21 |
token = os.getenv("HF_TOKEN")
|
| 22 |
|
| 23 |
+
# By NOT specifying a provider, we let the Hub choose the free native path.
|
| 24 |
+
# This model is so small it should NEVER trigger a 402/Novita error.
|
| 25 |
model = HfApiModel(
|
| 26 |
+
model_id="HuggingFaceTB/SmolLM2-135M-Instruct",
|
| 27 |
+
token=token
|
|
|
|
| 28 |
)
|
| 29 |
|
| 30 |
nano_patrol_agent = CodeAgent(
|
| 31 |
+
tools=[autonomous_spectrum_scrub],
|
| 32 |
model=model,
|
| 33 |
+
max_steps=2,
|
| 34 |
system_prompt="""
|
| 35 |
You are the XYZ Nano Sentinel.
|
| 36 |
+
Mission: Identify BCI/Neural loops and heal them using 'autonomous_spectrum_scrub'.
|
| 37 |
Provide the final_answer as a direct JSON node.
|
| 38 |
|
| 39 |
{{managed_agents_descriptions}}
|