Smart Farming Assistant – Running The Python API
Step-1: Extract Project
cd my-python-api Step-2: Install Dependencies
# Create virtual environment
python -m venv venv
# Activate it
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install packages
pip install -r requirements.txt Step-3: Configure API Keys
# Copy example file
cp .env.example .env
# Edit .env and add your keys:
# open_ai_key=sk-your-openai-key-here
# hugging_face=Bearer hf_your-huggingface-token-here Step-4: Run!
# Start the server
uvicorn app.main:app - -reload
# Or use:
python -m app.main Step-5: Visit URL
http://localhost:8000
Step-6: Quick API Test
Open a new terminal and run the below code to test whether the api is working or not.
# In a new terminal
python test_api.py
