-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
62 lines (56 loc) · 3.02 KB
/
Copy pathconfig.example.yaml
File metadata and controls
62 lines (56 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# ============================================================
# Talk-to-DB v3 — the ONLY file you need to edit.
#
# 1. Copy this to config.yaml
# 2. Paste your Anthropic API key
# 3. Point database.url at your database
# 4. python run.py → http://127.0.0.1:7860
# ============================================================
anthropic:
api_key: "" # sk-ant-… (ANTHROPIC_API_KEY env var overrides)
model: "claude-sonnet-4-6"
database:
# SQL: any SQLAlchemy URL. Mongo: a mongodb:// or mongodb+srv:// URL — the
# backend is auto-detected from the scheme, no extra config needed.
# mongomock://demo is a bundled, zero-setup in-memory Mongo demo (no real
# MongoDB server needed) — the Mongo-side equivalent of the SQLite demo.
# Examples:
# sqlite:///data/demo.db ← bundled demo (default)
# postgresql+psycopg2://user:pass@host:5432/dbname
# mysql+pymysql://user:pass@host:3306/dbname
# mongodb://user:pass@host:27017/dbname ← database name required in the path
# mongomock://demo ← bundled Mongo demo, zero setup
url: "sqlite:///data/demo.db"
# type: "sql" # optional override; auto-detected from
# the URL scheme otherwise. Implemented:
# "sql" (sqlite/postgres/mysql), "mongodb".
# Multi-source mode: connect to several datastores independently and answer
# one question across all of them via POST /api/ask/multi. Leave this empty
# (the default) for single-source mode using `database` above — that's the
# common case and costs nothing extra. Uncomment to try it with the bundled
# demos:
# sources:
# - name: shop_sql
# database:
# url: "sqlite:///data/demo.db"
# - name: shop_reviews
# database:
# url: "mongomock://demo"
# ── Everything below is optional — safe defaults are built in ──
guardrails:
read_only: true # hard-blocks anything that is not a SELECT
max_rows: 200 # rows returned to the UI (LIMIT force-injected)
max_result_rows_to_model: 50 # rows the LLM sees when summarising
statement_timeout_seconds: 15 # per-query wall-clock timeout
max_agent_turns: 6 # self-correction budget before giving up
history_turns: 6 # how many prior conversation turns to keep in context
allowed_tables: [] # empty = all introspected tables/collections
denied_tables: [] # always hidden (e.g. ["users_pii", "audit_log"]) — applies to SQL tables and Mongo collections alike
sample_rows_in_schema: 3 # 0 = never send real cell values to the LLM
server:
host: "127.0.0.1" # keep loopback unless you know what you're doing
port: 7860
auth_token: "" # set to require Authorization: Bearer <token>
rate_limit_per_minute: 30
logging:
audit_file: "data/audit.log" # every query executed or blocked is recorded here