Initial vLLM agent strategy

This commit is contained in:
2026-07-21 16:04:18 +08:00
commit d17bb21bbb
48 changed files with 3006 additions and 0 deletions

18
app/storage/db.py Normal file
View File

@@ -0,0 +1,18 @@
from __future__ import annotations
import os
import sqlite3
from app.storage.schema import init_schema
def connect(db_path: str) -> sqlite3.Connection:
parent = os.path.dirname(os.path.abspath(db_path))
if parent and not os.path.exists(parent):
os.makedirs(parent, exist_ok=True)
conn = sqlite3.connect(db_path, timeout=30)
conn.row_factory = sqlite3.Row
conn.execute("PRAGMA journal_mode=WAL")
conn.execute("PRAGMA busy_timeout=30000")
init_schema(conn)
return conn