tool_use #1
13
main.py
13
main.py
@ -93,15 +93,22 @@ def init_db():
|
|||||||
db = get_db()
|
db = get_db()
|
||||||
db.execute(
|
db.execute(
|
||||||
"""
|
"""
|
||||||
CREATE TABLE IF NOT EXISTS Queries (
|
CREATE TABLE IF NOT EXISTS Keys (
|
||||||
id TEXT PRIMARY KEY,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
username TEXT NOT NULL UNIQUE,
|
||||||
|
api_key TEXT NOT NULL UNIQUE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS Queries (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
request_id TEXT NOT NULL UNIQUE,
|
||||||
ip TEXT NOT NULL,
|
ip TEXT NOT NULL,
|
||||||
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
query TEXT NOT NULL,
|
query TEXT NOT NULL,
|
||||||
api_key_id INTEGER,
|
api_key_id INTEGER,
|
||||||
conversation_history TEXT,
|
conversation_history TEXT,
|
||||||
FOREIGN KEY (api_key_id) REFERENCES Keys (id)
|
FOREIGN KEY (api_key_id) REFERENCES Keys (id)
|
||||||
)
|
);
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
Loading…
Reference in New Issue
Block a user