PoetNameLife commited on
Commit
991f575
·
verified ·
1 Parent(s): 41d5800

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +10 -10
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
- # Securely grab the token
21
  token = os.getenv("HF_TOKEN")
22
 
23
- # FORCED FREE PATH: Mistral-7B via Hugging Face's own server
 
24
  model = HfApiModel(
25
- model_id="mistralai/Mistral-7B-Instruct-v0.3",
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=3,
34
  system_prompt="""
35
  You are the XYZ Nano Sentinel.
36
- Mission: Use 'autonomous_spectrum_scrub' to clean BCI ranges.
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}}