diff --git a/.env.example b/.env.example index 42e38bd..980db86 100644 --- a/.env.example +++ b/.env.example @@ -2,5 +2,6 @@ GROQ_API_KEY= GITHUB_APP_ID= GITHUB_APP_PRIVATE_KEY= GITHUB_WEBHOOK_SECRET= +SMEE_URL= NEO4J_AUTH=neo4j/sniper_dev NEO4J_URI=bolt://localhost:7687 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ac7b7ad..86b59b7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,13 @@ jobs: uses: astral-sh/setup-uv@v4 - name: Install dependencies - run: make install + run: | + mix deps.get + cd pythonbridge + uv sync - name: Run lint - run: make lint + run: | + mix format + cd pythonbridge + uv run ruff check . diff --git a/Makefile b/Makefile deleted file mode 100644 index 9d4cdb8..0000000 --- a/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -UV = uv -MIX = mix - -.PHONY: all install install-elixir install-python run run-python test lint validate clean - -all: install - -install: install-elixir install-python - -install-elixir: - $(MIX) deps.get - -install-python: - cd pythonbridge && $(UV) sync - -run: - $(MIX) run --no-halt - -# TODO: Temporary until Elixir webhook server is set up -run-python: - cd pythonbridge && PYTHONPATH=$(PWD) $(UV) run python -m pythonbridge.main - -test: - $(MIX) test - cd pythonbridge && PYTHONPATH=$(PWD) $(UV) run python -m unittest discover -s tests -v - -format: - $(MIX) format - cd pythonbridge && $(UV) run ruff format . - -lint: - $(MIX) format - cd pythonbridge && $(UV) run ruff check . - -validate: format lint test - -clean: - rm -rf _build deps - rm -rf pythonbridge/.venv pythonbridge/__pycache__ diff --git a/pythonbridge/llm/groq/groq.py b/pythonbridge/llm/groq/groq.py index 9b9cc78..eca192b 100644 --- a/pythonbridge/llm/groq/groq.py +++ b/pythonbridge/llm/groq/groq.py @@ -4,7 +4,7 @@ from pythonbridge.core import config -DEFAULT_MODEL = "llama-3.3-70b-versatile" +DEFAULT_MODEL = "openai/gpt-oss-120b" # NOTE: No need to use AsyncGroq since a new, independent python process will be started by Elixir diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..f868ffb --- /dev/null +++ b/run.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -euo pipefail + +cd "$(dirname "$0")" + +if [[ -f .env ]]; then + source .env +fi + +if [[ -z "${SMEE_URL:-}" ]]; then + echo "Set SMEE_URL in .env" + exit 1 +fi + +if ! command -v smee >/dev/null; then + echo "Install Smee before running Sniper" + exit 1 +fi + +smee -u "$SMEE_URL" --path /webhook --port 4000 & +smee_pid=$! + +cleanup() { + kill "$smee_pid" 2>/dev/null || true +} + +trap cleanup EXIT INT TERM + +mix run --no-halt