Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ DISCORD_BOT_TOKEN=
# Leave unset (or false) during normal development to avoid rate limits.
LANG2SQL_SYNC_COMMANDS=

# Optional comma-separated parent-channel IDs where non-admin guild members may
# ask DB questions. Empty means admin-only. Threads inherit the parent channel.
# Only positive numeric Discord IDs are accepted; malformed values fail startup.
LANG2SQL_DISCORD_QUERY_CHANNEL_IDS=

# Durable SQLite state for the Discord bot (sessions, audit, semantic reviews,
# encrypted credentials). Keep this file private and back it up with the key.
LANG2SQL_DATA_PATH=lang2sql_data.db

# OpenAI API key. Optional: when set, the agent uses gpt-4.1-mini. When unset,
# it falls back to the offline FakeLLM (deterministic canned tool cycles — fine
# for a smoke run, not for real answers).
Expand All @@ -22,6 +31,14 @@ LANG2SQL_LLM_BASE_URL=
# Model name as the server expects it (e.g. Qwen/Qwen3-14B-AWQ for vLLM).
LANG2SQL_LLM_MODEL=

# First-connect Enrich mode. "auto" runs one metadata-only LLM pass when a real
# OpenAI-compatible provider is configured; otherwise DB comments and physical
# names are used, plus a same-source Enrich cache when available. No mode
# samples raw rows.
# Use "metadata" to disable the LLM pass, or "llm" to require an attempted pass
# whose failure is reported explicitly while the deterministic catalog remains.
LANG2SQL_AUTO_METADATA_ENRICH=auto

# Fernet key used to encrypt stored secrets (DSNs / API keys) at rest. Optional:
# if unset, a key is auto-generated and persisted in the SQLite kv table. Set it
# in production so secrets decrypt across restarts and machines. Generate one:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/semantic-runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Semantic Runtime

on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read

jobs:
sqlite-duckdb-contract:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install runtime and verification dependencies
run: python -m pip install -e ".[duckdb]" pytest mypy ruff

- name: Require the DuckDB execution lane
run: python -c "import duckdb"

- name: Lint
run: ruff check src/lang2sql tests bench/local_model_semantic_eval.py examples/semantic_runtime_quickstart.py

- name: Type-check
run: mypy src/lang2sql examples/semantic_runtime_quickstart.py

- name: Run all tests with DuckDB installed
run: pytest -q
220 changes: 206 additions & 14 deletions README.md

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions bench/cases/public_semantic_cases.jsonl

Large diffs are not rendered by default.

Loading
Loading