Spaces:
Sleeping
Sleeping
|
Download STARTUP.md from YADUUG/NPS-ChatAgentBot: direct link, hf CLI and curl.
- Browser
- Download file 2.11 kB
-
https://huggingface.co/spaces/YADUUG/NPS-ChatAgentBot/resolve/main/STARTUP.md
- Command line
-
hf download hf://spaces/YADUUG/NPS-ChatAgentBot/STARTUP.md
-
curl -L -o STARTUP.md https://huggingface.co/spaces/YADUUG/NPS-ChatAgentBot/resolve/main/STARTUP.md
2.11 kB
Startup Instructions for NPS-AI
This guide explains how to set up and run the NPS-AI project, including the FastAPI chatbot and the autonomous browser agent.
Prerequisites
- Python 3.10+
- Ollama (for local agent inference)
- Mistral API Key (for chatbot RAG)
1. Environment Setup
- Clone the repository (if not already done).
- Create a
.envfile in the project root:cp .env.example .env # If .env.example exists # OR create manually: touch .env - Configure Environment Variables in
.env:MISTRAL_API_KEY=your_mistral_api_key_here # Optional Admin Credentials for file management ADMIN_USERNAME=admin ADMIN_PASSWORD=admin
2. Install Dependencies
Install the required Python packages:
pip install -r requirements.txt
Verify that playwright browsers are installed (required for the agent):
playwright install
3. Ollama Setup (For Agent)
The agent uses a local Ollama model (kimi-k2.5:cloud by default in nps_agent.py). Ensure Ollama is running and the model is pulled:
- Start Ollama:
ollama serve - Pull the Model:
(Note: If you use a different model, updateollama pull kimi-k2.5:cloudmodel_nameinnps_agent.py)
4. Running the Application
Option A: Run the Full Application (Chatbot + Agent API)
Start the FastAPI server:
python app.py
- URL:
http://localhost:7860 - Chatbot Interface: Accessible at the root URL (configured via static files in
frontend). - Agent Endpoint:
POST /agent/run
Option B: Run the Agent Standalone
To test the agent directly specifically:
python nps_agent.py
(This will prompt for a task input in the terminal)
Troubleshooting
- Import Errors: Ensure you are in the virtual environment (
source .venv/bin/activateor similar). - Browser Issues: Run
playwright installagain. - LLM Connection: Check if Ollama is running on port 11434 (
http://localhost:11434).