mirror of
https://github.com/dataforcanada/d4c-service-geo-assistant.git
synced 2026-06-13 14:31:01 +02:00
2d5af2adb97077da0e382942f8d792bcdbb70f8f
* Set asyncio_mode="auto" in pytest.ini config Xref https://pytest-asyncio.readthedocs.io/en/latest/reference/configuration.html#asyncio-mode * Add test-python GitHub Actions CI workflow * Add `--color=yes` flag to force GitHub Actions logs to have color Xref https://github.com/pytest-dev/pytest/issues/7443 * Refactor contents of test_api.py slightly Using some ruff rules * Delete test_api.py * Make test_get_place async * Make get_place async, and call .ainvoke method on it
Geo Assistant
A geographic assistant that helps answer questions and perform tasks related to locations and geographic data.
Environment Setup
The project uses environment variables for configuration. Copy .env.example to .env and customize as needed:
cp .env.example .env
Edit .env to set your configuration:
OLLAMA_MODEL: Model name (default:llama3.2)OLLAMA_BASE_URL: Ollama server URL (default:http://localhost:11434)API_BASE_URL: API base URL for the frontend (default:http://localhost:8000)
The application will automatically load these variables from the .env file.
Development Setup
Pre-commit Hooks
This project uses pre-commit hooks to ensure code quality. To set up pre-commit:
- Install dependencies (including pre-commit):
uv sync
- Install the git hooks:
uv run pre-commit install
Pre-commit will now automatically run ruff linting and formatting checks before each commit.
To manually run pre-commit on all files:
uv run pre-commit run --all-files
Running the API
uvicorn geo_assistant.api.app:app --reload
The API will be available at http://localhost:8000.
Running the Frontend
streamlit run src/geo_assistant/frontend/app.py
The frontend will be available at http://localhost:8501.
Languages
Python
100%