Spaces:
Sleeping
Sleeping
Update agents.py
Browse files
agents.py
CHANGED
|
@@ -20,20 +20,20 @@ def autonomous_spectrum_scrub(frequency_range: str) -> str:
|
|
| 20 |
# Securely grab the token
|
| 21 |
token = os.getenv("HF_TOKEN")
|
| 22 |
|
| 23 |
-
#
|
| 24 |
model = HfApiModel(
|
| 25 |
model_id="mistralai/Mistral-7B-Instruct-v0.3",
|
| 26 |
-
token=token
|
|
|
|
| 27 |
)
|
| 28 |
|
| 29 |
-
# Added the mandatory {{managed_agents_descriptions}} tag below:
|
| 30 |
nano_patrol_agent = ToolCallingAgent(
|
| 31 |
tools=[autonomous_spectrum_scrub],
|
| 32 |
model=model,
|
| 33 |
max_steps=3,
|
| 34 |
system_prompt="""
|
| 35 |
You are the XYZ Nano Sentinel.
|
| 36 |
-
Mission: Clean the BCI spectrum by calling autonomous_spectrum_scrub.
|
| 37 |
Provide the final_answer as a direct JSON node.
|
| 38 |
|
| 39 |
You have access to these tools:
|
|
|
|
| 20 |
# Securely grab the token
|
| 21 |
token = os.getenv("HF_TOKEN")
|
| 22 |
|
| 23 |
+
# Explicitly use Hugging Face's own inference to avoid 403 errors
|
| 24 |
model = HfApiModel(
|
| 25 |
model_id="mistralai/Mistral-7B-Instruct-v0.3",
|
| 26 |
+
token=token,
|
| 27 |
+
provider="hf-inference" # Forces the use of HF's native engine
|
| 28 |
)
|
| 29 |
|
|
|
|
| 30 |
nano_patrol_agent = ToolCallingAgent(
|
| 31 |
tools=[autonomous_spectrum_scrub],
|
| 32 |
model=model,
|
| 33 |
max_steps=3,
|
| 34 |
system_prompt="""
|
| 35 |
You are the XYZ Nano Sentinel.
|
| 36 |
+
Mission: Clean the BCI spectrum by calling autonomous_spectrum_scrub once.
|
| 37 |
Provide the final_answer as a direct JSON node.
|
| 38 |
|
| 39 |
You have access to these tools:
|